diff options
author | ashleyh <gh@ashleyh.eu> | 2014-02-26 22:10:25 +0000 |
---|---|---|
committer | ashleyh <gh@ashleyh.eu> | 2014-02-26 22:10:25 +0000 |
commit | 00ba300d3941d5e9d59ffffcb760eb0f9d1079ef (patch) | |
tree | 2b22d404b040adf2441af3b8369db44b800ac5ab /scripts | |
parent | 14cbd618ec4930878afc6f9073d9ebb9e514fd75 (diff) | |
parent | 314791dca7b80e167165694222dfc0f70dd77e5c (diff) | |
download | rneovim-00ba300d3941d5e9d59ffffcb760eb0f9d1079ef.tar.gz rneovim-00ba300d3941d5e9d59ffffcb760eb0f9d1079ef.tar.bz2 rneovim-00ba300d3941d5e9d59ffffcb760eb0f9d1079ef.zip |
Merge branch 'master' into pr36
Conflicts:
README.md
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/common.sh | 50 | ||||
-rw-r--r-- | scripts/compile-libuv.sh | 10 | ||||
-rw-r--r-- | scripts/get-libuv.sh | 16 |
3 files changed, 47 insertions, 29 deletions
diff --git a/scripts/common.sh b/scripts/common.sh index d7653c6aa1..9efa3d5e6c 100644 --- a/scripts/common.sh +++ b/scripts/common.sh @@ -1,3 +1,16 @@ +platform='unknown' +unameval=`uname` +if [ "$unameval" = 'Linux' ]; then + platform='linux' +elif [ "$unameval" = 'FreeBSD' ]; then + platform='freebsd' +fi + +sha1sumcmd='sha1sum' +if [ "$platform" = 'freebsd' ]; then + sha1sumcmd='shasum' +fi + pkgroot="$(pwd)" deps="$pkgroot/.deps" prefix="$deps/usr" @@ -10,23 +23,34 @@ download() { if [ ! -d "$tgt" ]; then mkdir -p "$tgt" + local download_command="" if which wget > /dev/null 2>&1; then - tmp_dir=$(mktemp -d "/tmp/download_sha1check_XXXXXXX") - fifo="$tmp_dir/fifo" - mkfifo "$fifo" - # download, untar and calculate sha1 sum in one pass - (wget "$url" -O - | tee "$fifo" | \ - (cd "$tgt"; tar --strip-components=1 -xvzf -)) & - sum=$(sha1sum < "$fifo" | cut -d ' ' -f1) - rm -rf "$tmp_dir" - if [ "$sum" != "$sha1" ]; then - echo "SHA1 sum doesn't match, expected '$sha1' got '$sum'" - exit 1 - fi + # -O - to send output to stdout + download_command="wget --no-verbose $url -O -" + elif which curl >/dev/null 2>&1; then + # -L to follow the redirects that github will send us + # -sS to supress the progress bar, but show errors + # curl sends output to stdout by default + download_command="curl -L -sS $url" else - echo "Missing wget utility" + echo "Missing wget utility and curl utility" exit 1 fi + local tmp_dir=$(mktemp -d "/tmp/download_sha1check_XXXXXXX") + local fifo="$tmp_dir/fifo" + mkfifo "$fifo" + echo "Downloading $url..." + # download, untar and calculate sha1 sum in one pass + ($download_command | tee "$fifo" | \ + (cd "$tgt"; tar --strip-components=1 -xzf -)) & + local sum=$("$sha1sumcmd" < "$fifo" | cut -d ' ' -f1) + rm -rf "$tmp_dir" + if [ "$sum" != "$sha1" ]; then + echo "SHA1 sum doesn't match, expected '$sha1' got '$sum'" + exit 1 + else + echo "Download complete." + fi fi } diff --git a/scripts/compile-libuv.sh b/scripts/compile-libuv.sh new file mode 100644 index 0000000000..f07120ed56 --- /dev/null +++ b/scripts/compile-libuv.sh @@ -0,0 +1,10 @@ +. scripts/common.sh + +uv_dir="third-party/libuv" + +cd "$uv_dir" +sh autogen.sh +./configure --prefix="$prefix" +make +make install +rm "$prefix/lib/"libuv*.{so,dylib} "$prefix/lib/"libuv*.{so,dylib}.* || true diff --git a/scripts/get-libuv.sh b/scripts/get-libuv.sh deleted file mode 100644 index 9f3eceb218..0000000000 --- a/scripts/get-libuv.sh +++ /dev/null @@ -1,16 +0,0 @@ -. scripts/common.sh - -uv_repo=joyent/libuv -uv_ver=v0.11.19 -uv_dir="$deps/uv-$uv_ver" -uv_sha1=5539d8e99e22b438cf4a412d4cec70ac6bb519fc - -rm -rf "$uv_dir" - -github_download "$uv_repo" "$uv_ver" "$uv_dir" "$uv_sha1" -cd "$uv_dir" -sh autogen.sh -./configure --prefix="$prefix" -make -make install -rm "$prefix/lib/"libuv*.{so,dylib} "$prefix/lib/"libuv*.{so,dylib}.* || true |