From 87fdb40a03063b09811d4e3f303432f62b12e25d Mon Sep 17 00:00:00 2001 From: Sean Long Date: Fri, 21 Feb 2014 21:32:35 -0800 Subject: [PATCH] First pass on getting build working on FreeBSD. --- README.md | 4 ++++ scripts/common.sh | 15 ++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 71beae8eba..291acaa653 100644 --- a/README.md +++ b/README.md @@ -178,6 +178,10 @@ For Ubuntu 12.04: sudo apt-get install build-essential cmake libncurses5-dev +For FreeBSD 10: + + sudo pkg install cmake libtool sha + For OsX: * Install [Xcode](https://developer.apple.com/) diff --git a/scripts/common.sh b/scripts/common.sh index d7653c6aa1..8c5d8a61ab 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" @@ -17,7 +30,7 @@ download() { # 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) + sum=$("$sha1sumcmd" < "$fifo" | cut -d ' ' -f1) rm -rf "$tmp_dir" if [ "$sum" != "$sha1" ]; then echo "SHA1 sum doesn't match, expected '$sha1' got '$sum'"