summaryrefslogtreecommitdiffstats
path: root/scripts/get-dep-lib.sh
diff options
context:
space:
mode:
authorGravatar jan Iversen <jani@libreoffice.org>2018-05-15 16:48:47 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-05-17 11:16:50 -0700
commit6d3637fce0eae7e568845af4ad422c403c33342b (patch)
treed103e3b2e28272cba0608b7da76b76eedb1d3644 /scripts/get-dep-lib.sh
parent77b9a62f7f1f7132cf47ac0e00c5167c084de2ae (diff)
downloadsubsurface-6d3637fce0eae7e568845af4ad422c403c33342b.tar.gz
build-system: made get-dep-lib faster and more robust.
Secured git work only happens when cloning a dir. There is a version for hidapi, but scripts/build.sh (which are the source for that part of depend) has a line: # there is no good tag, so just build master and then continues with master, so it should be good enough for get-dep-lib as well. Signed-off-by: Jan Iversen <jani@apache.org>
Diffstat (limited to 'scripts/get-dep-lib.sh')
-rwxr-xr-xscripts/get-dep-lib.sh93
1 files changed, 34 insertions, 59 deletions
diff --git a/scripts/get-dep-lib.sh b/scripts/get-dep-lib.sh
index 4d4f5e1c0..14a9231cb 100755
--- a/scripts/get-dep-lib.sh
+++ b/scripts/get-dep-lib.sh
@@ -54,10 +54,8 @@ set -e
# get ready to download needed sources
cd ${INSTDIR}
-if [[ $BUILD = *"libcurl"* ]]; then
- if [ ! -d libcurl ] ; then
- git clone https://github.com/curl/curl libcurl
- fi
+if [[ "$BUILD" = *"libcurl"* && ! -d libcurl ]]; then
+ git clone https://github.com/curl/curl libcurl
pushd libcurl
git fetch origin
if ! git checkout $CURRENT_LIBCURL ; then
@@ -67,18 +65,14 @@ if [[ $BUILD = *"libcurl"* ]]; then
popd
fi
-if [[ $BUILD = *"libftdi"* ]]; then
- if [ ! -d libftdi1 ] ; then
- curl -O https://www.intra2net.com/en/developer/libftdi/download/libftdi1-${CURRENT_LIBFTDI}.tar.bz2
- tar -jxf libftdi1-${CURRENT_LIBFTDI}.tar.bz2
+if [[ "$BUILD" = *"libftdi"* && ! -d libftdi1 ]]; then
+ curl -O https://www.intra2net.com/en/developer/libftdi/download/libftdi1-${CURRENT_LIBFTDI}.tar.bz2
+ tar -jxf libftdi1-${CURRENT_LIBFTDI}.tar.bz2
mv libftdi1-${CURRENT_LIBFTDI} libftdi1
- fi
fi
-if [[ $BUILD = *"libgit2"* ]]; then
- if [ ! -d libgit2 ] ; then
- git clone https://github.com/libgit2/libgit2.git
- fi
+if [[ "$BUILD" = *"libgit2"* && ! -d libgit2 ]]; then
+ git clone https://github.com/libgit2/libgit2.git
pushd libgit2
git fetch origin
if ! git checkout ${CURRENT_LIBGIT2} ; then
@@ -88,10 +82,8 @@ if [[ $BUILD = *"libgit2"* ]]; then
popd
fi
-if [[ $BUILD = *"libssh2"* ]]; then
- if [ ! -d libssh2 ] ; then
- git clone https://github.com/libssh2/libssh2
- fi
+if [[ "$BUILD" = *"libssh2"* && ! -d libssh2 ]]; then
+ git clone https://github.com/libssh2/libssh2
pushd libssh2
git fetch origin
if ! git checkout $CURRENT_LIBSSH2 ; then
@@ -101,10 +93,8 @@ if [[ $BUILD = *"libssh2"* ]]; then
popd
fi
-if [[ $BUILD = *"libusb"* ]]; then
- if [ ! -d libusb ] ; then
- git clone https://github.com/libusb/libusb
- fi
+if [[ "$BUILD" = *"libusb"* && ! -d libusb ]]; then
+ git clone https://github.com/libusb/libusb
pushd libusb
git fetch origin
if ! git checkout $CURRENT_LIBUSB ; then
@@ -114,10 +104,8 @@ if [[ $BUILD = *"libusb"* ]]; then
popd
fi
-if [[ $BUILD = *"libxml2"* ]]; then
- if [ ! -d libxml2 ] ; then
- git clone https://github.com/GNOME/libxml2.git
- fi
+if [[ "$BUILD" = *"libxml2"* && ! -d libxml2 ]]; then
+ git clone https://github.com/GNOME/libxml2.git
pushd libxml2
git fetch origin
if ! git checkout $CURRENT_LIBXML2 ; then
@@ -127,10 +115,8 @@ if [[ $BUILD = *"libxml2"* ]]; then
popd
fi
-if [[ $BUILD = *"libxslt"* ]]; then
- if [ ! -d libxslt ] ; then
- git clone https://github.com/GNOME/libxslt.git
- fi
+if [[ "$BUILD" = *"libxslt"* && ! -d libxslt ]]; then
+ git clone https://github.com/GNOME/libxslt.git
pushd libxslt
git fetch origin
if ! git checkout $CURRENT_LIBXSLT ; then
@@ -140,18 +126,14 @@ if [[ $BUILD = *"libxslt"* ]]; then
popd
fi
-if [[ $BUILD = *"libzip"* ]]; then
- if [ ! -d libzip ] ; then
- curl -O https://libzip.org/download/libzip-${CURRENT_LIBZIP}.tar.gz
- tar xzf libzip-${CURRENT_LIBZIP}.tar.gz
- mv libzip-${CURRENT_LIBZIP} libzip
- fi
+if [[ "$BUILD" = *"libzip"* && ! -d libzip ]]; then
+ curl -O https://libzip.org/download/libzip-${CURRENT_LIBZIP}.tar.gz
+ tar xzf libzip-${CURRENT_LIBZIP}.tar.gz
+ mv libzip-${CURRENT_LIBZIP} libzip
fi
-if [[ $BUILD = *"googlemaps"* ]]; then
- if [ ! -d googlemaps ] ; then
- git clone https://github.com/Subsurface-divelog/googlemaps.git
- fi
+if [[ "$BUILD" = *"googlemaps"* && ! -d googlemaps ]]; then
+ git clone https://github.com/Subsurface-divelog/googlemaps.git
pushd googlemaps
git fetch origin
git checkout master
@@ -159,23 +141,20 @@ if [[ $BUILD = *"googlemaps"* ]]; then
popd
fi
-if [[ $BUILD = *"hidapi"* ]]; then
- if [ ! -d hidapi ] ; then
- git clone https://github.com/signal11/hidapi
- fi
+if [[ "$BUILD" = *"hidapi"* && ! -d hidapi ]]; then
+ git clone https://github.com/signal11/hidapi
pushd hidapi
git fetch origin
- if ! git checkout $CURRENT_HIDAPI ; then
- echo "Can't find the right tag in hidapi - giving up"
- exit -1
- fi
+ # there is no good tag, so just build master
+# if ! git checkout $CURRENT_HIDAPI ; then
+# echo "Can't find the right tag in hidapi - giving up"
+# exit -1
+# fi
popd
fi
-if [[ $BUILD = *"openssl"* ]]; then
- if [ ! -d openssl ] ; then
- git clone https://github.com/openssl/openssl
- fi
+if [[ "$BUILD" = *"openssl"* && ! -d openssl ]]; then
+ git clone https://github.com/openssl/openssl
pushd openssl
git fetch origin
if ! git checkout $CURRENT_OPENSSL ; then
@@ -185,12 +164,8 @@ if [[ $BUILD = *"openssl"* ]]; then
popd
fi
-if [[ $BUILD = *"sqlite"* ]]; then
- if [ ! -d sqlite ] ; then
- curl -O http://www.sqlite.org/2017/sqlite-autoconf-${CURRENT_SQLITE}.tar.gz
- tar -zxf sqlite-autoconf-${CURRENT_SQLITE}.tar.gz
- mv sqlite-autoconf-${CURRENT_SQLITE} sqlite
- fi
+if [[ "$BUILD" = *"sqlite"* && ! -d sqlite ]]; then
+ curl -O http://www.sqlite.org/2017/sqlite-autoconf-${CURRENT_SQLITE}.tar.gz
+ tar -zxf sqlite-autoconf-${CURRENT_SQLITE}.tar.gz
+ mv sqlite-autoconf-${CURRENT_SQLITE} sqlite
fi
-
-exit 0