aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-06-04 13:52:13 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-06-04 13:52:13 -0700
commit218ad95d7de4da07262ad1244178ca6c8c3b30cf (patch)
treea48cc8d544cbf35b5ddbc9891403a91e13c783fd
parentd9606022b414c61741a31f980ddabc0741799da8 (diff)
downloadsubsurface-218ad95d7de4da07262ad1244178ca6c8c3b30cf.tar.gz
Build script: fix several bugs
With this I can now successfully run this on Mac and Arch Linux, both running "fresh" and running in an existing build directory (i.e., getting the updates right). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rwxr-xr-xscripts/build.sh18
1 files changed, 12 insertions, 6 deletions
diff --git a/scripts/build.sh b/scripts/build.sh
index 829659f9a..f51314a5f 100755
--- a/scripts/build.sh
+++ b/scripts/build.sh
@@ -31,6 +31,9 @@ fi
mkdir -p install-root
INSTALL_ROOT=$SRC/install-root
+# make sure we find our own packages first (e.g., libgit2 only uses pkg_config to find libssh2)
+export PKG_CONFIG_PATH=$INSTALL_ROOT/lib/pkgconfig:$PKG_CONFIG_PATH
+
echo Building in $SRC, installing in $INSTALL_ROOT
# if on a mac, let's build our own libssh2
@@ -63,6 +66,8 @@ fi
# build libgit2
+cd $SRC
+
if [ ! -d libgit2 ] ; then
if [[ $1 = local ]] ; then
git clone $SRC/../libgit2 libgit2
@@ -72,15 +77,16 @@ if [ ! -d libgit2 ] ; then
fi
cd libgit2
# let's build with a recent enough version of master for the latest features
-git pull
-if [ ! git checkout c11daac9de2 ] ; then
+git pull origin master
+if ! git checkout c11daac9de2 ; then
echo "Can't find the right commit in libgit2 - giving up"
exit 1
fi
mkdir -p build
cd build
cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_ROOT -DCMAKE_BUILD_TYPE=Release -DBUILD_CLAR=OFF ..
-cmake --build . --target install
+make -j4
+make install
if [ $PLATFORM = Darwin ] ; then
# in order for macdeployqt to do its job correctly, we need the full path in the dylib ID
@@ -105,7 +111,7 @@ if [ ! -d libdivecomputer ] ; then
fi
cd libdivecomputer
git pull
-if [ ! git checkout Subsurface-testing ] ; then
+if ! git checkout Subsurface-testing ; then
echo "can't check out the Subsurface-testing branch of libdivecomputer -- giving up"
exit 1
fi
@@ -129,7 +135,7 @@ if [ ! -d marble-source ] ; then
fi
cd marble-source
git pull
-if [ ! git checkout Subsurface-testing ] ; then
+if ! git checkout Subsurface-testing ; then
echo "can't check out the Subsurface-testing branch of marble -- giving up"
exit 1
fi
@@ -157,7 +163,7 @@ if [ ! -d grantlee ] ; then
fi
fi
cd grantlee
-if [ ! git checkout v5.0.0 ] ; then
+if ! git checkout v5.0.0 ; then
echo "can't check out v5.0.0 of grantlee -- giving up"
exit 1
fi