mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
build-system: Use a list instead of string + regexp
There are actually more datatypes in bash than just strings. One can for example hold a list of strings in a list, and use that to keep track of what we're expected to do. Signed-off-by: Anton Lundin <glance@acc.umu.se>
This commit is contained in:
parent
c4bf9e6d6e
commit
1157ad3faf
1 changed files with 56 additions and 61 deletions
|
|
@ -110,22 +110,22 @@ if [ "$(which curl)" == "" ] ; then
|
||||||
else
|
else
|
||||||
CURL="curl -O "
|
CURL="curl -O "
|
||||||
fi
|
fi
|
||||||
BUILD_COMMON="libzip libgit2 googlemaps"
|
COMMON_PACKAGES=(libzip libgit2 googlemaps)
|
||||||
case ${PLATFORM} in
|
case ${PLATFORM} in
|
||||||
scripts)
|
scripts)
|
||||||
BUILD="${BUILD_COMMON} hidapi libcurl libusb openssl libssh2"
|
PACKAGES=("${COMMON_PACKAGES[@]}" hidapi libcurl libusb openssl libssh2)
|
||||||
;;
|
;;
|
||||||
ios)
|
ios)
|
||||||
BUILD="${BUILD_COMMON} libxslt"
|
PACKAGES=("${COMMON_PACKAGES[@]}" libxslt)
|
||||||
;;
|
;;
|
||||||
android)
|
android)
|
||||||
BUILD="${BUILD_COMMON} libxslt sqlite libxml2 openssl libftdi libusb"
|
PACKAGES=("${COMMON_PACKAGES[@]}" libxslt sqlite libxml2 openssl libftdi libusb)
|
||||||
;;
|
;;
|
||||||
single)
|
single)
|
||||||
BUILD="$3"
|
PACKAGES=("$3")
|
||||||
;;
|
;;
|
||||||
singleAndroid)
|
singleAndroid)
|
||||||
BUILD="$3"
|
PACKAGES=("$3")
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Unknown platform ${PLATFORM}, choose between native, ios or android"
|
echo "Unknown platform ${PLATFORM}, choose between native, ios or android"
|
||||||
|
|
@ -139,58 +139,53 @@ set -e
|
||||||
# get ready to download needed sources
|
# get ready to download needed sources
|
||||||
cd "${INSTDIR}"
|
cd "${INSTDIR}"
|
||||||
|
|
||||||
if [[ "$BUILD" = *"libcurl"* ]]; then
|
for package in "${PACKAGES[@]}" ; do
|
||||||
|
case "$package" in
|
||||||
|
libcurl)
|
||||||
git_checkout_library libcurl $CURRENT_LIBCURL https://github.com/curl/curl.git
|
git_checkout_library libcurl $CURRENT_LIBCURL https://github.com/curl/curl.git
|
||||||
fi
|
;;
|
||||||
|
libgit2)
|
||||||
if [[ "$BUILD" = *"libgit2"* ]]; then
|
|
||||||
git_checkout_library libgit2 $CURRENT_LIBGIT2 https://github.com/libgit2/libgit2.git
|
git_checkout_library libgit2 $CURRENT_LIBGIT2 https://github.com/libgit2/libgit2.git
|
||||||
fi
|
;;
|
||||||
|
libssh2)
|
||||||
if [[ "$BUILD" = *"libssh2"* ]]; then
|
|
||||||
git_checkout_library libssh2 $CURRENT_LIBSSH2 https://github.com/libssh2/libssh2.git
|
git_checkout_library libssh2 $CURRENT_LIBSSH2 https://github.com/libssh2/libssh2.git
|
||||||
fi
|
;;
|
||||||
|
libusb)
|
||||||
if [[ "$BUILD" = *"libusb"* ]]; then
|
|
||||||
git_checkout_library libusb $CURRENT_LIBUSB https://github.com/libusb/libusb.git
|
git_checkout_library libusb $CURRENT_LIBUSB https://github.com/libusb/libusb.git
|
||||||
fi
|
;;
|
||||||
|
libxml2)
|
||||||
if [[ "$BUILD" = *"libxml2"* ]];then
|
|
||||||
git_checkout_library libxml2 $CURRENT_LIBXML2 https://github.com/GNOME/libxml2.git
|
git_checkout_library libxml2 $CURRENT_LIBXML2 https://github.com/GNOME/libxml2.git
|
||||||
fi
|
;;
|
||||||
|
libxslt)
|
||||||
if [[ "$BUILD" = *"libxslt"* ]]; then
|
|
||||||
git_checkout_library libxslt $CURRENT_XSLT https://github.com/GNOME/libxslt.git
|
git_checkout_library libxslt $CURRENT_XSLT https://github.com/GNOME/libxslt.git
|
||||||
fi
|
;;
|
||||||
|
breeze-icons)
|
||||||
if [[ "$BUILD" = *"breeze-icons"* ]]; then
|
|
||||||
git_checkout_library breeze-icons master https://github.com/kde/breeze-icons.git
|
git_checkout_library breeze-icons master https://github.com/kde/breeze-icons.git
|
||||||
fi
|
;;
|
||||||
|
googlemaps)
|
||||||
if [[ "$BUILD" = *"googlemaps"* ]]; then
|
|
||||||
git_checkout_library googlemaps master https://github.com/Subsurface-divelog/googlemaps.git
|
git_checkout_library googlemaps master https://github.com/Subsurface-divelog/googlemaps.git
|
||||||
fi
|
;;
|
||||||
|
hidapi)
|
||||||
if [[ "$BUILD" = *"hidapi"* ]]; then
|
|
||||||
git_checkout_library hidapi master https://github.com/signal11/hidapi.git
|
git_checkout_library hidapi master https://github.com/signal11/hidapi.git
|
||||||
fi
|
;;
|
||||||
|
kirigami)
|
||||||
if [[ "$BUILD" = *"kirigami"* ]]; then
|
|
||||||
git_checkout_library kirigami $CURRENT_KIRIGAMI https://github.com/KDE/kirigami.git
|
git_checkout_library kirigami $CURRENT_KIRIGAMI https://github.com/KDE/kirigami.git
|
||||||
fi
|
;;
|
||||||
|
openssl)
|
||||||
if [[ "$BUILD" = *"openssl"* ]]; then
|
|
||||||
git_checkout_library openssl $CURRENT_OPENSSL https://github.com/openssl/openssl.git
|
git_checkout_library openssl $CURRENT_OPENSSL https://github.com/openssl/openssl.git
|
||||||
fi
|
;;
|
||||||
|
libzip)
|
||||||
if [[ "$BUILD" = *"libzip"* ]]; then
|
|
||||||
curl_download_library libzip https://subsurface-divelog.org/downloads/ libzip-${CURRENT_LIBZIP}.tar.xz
|
curl_download_library libzip https://subsurface-divelog.org/downloads/ libzip-${CURRENT_LIBZIP}.tar.xz
|
||||||
fi
|
;;
|
||||||
|
libftdi)
|
||||||
if [[ "$BUILD" = *"libftdi"* ]]; then
|
|
||||||
curl_download_library libftdi1 https://www.intra2net.com/en/developer/libftdi/download/ libftdi1-${CURRENT_LIBFTDI}.tar.bz2
|
curl_download_library libftdi1 https://www.intra2net.com/en/developer/libftdi/download/ libftdi1-${CURRENT_LIBFTDI}.tar.bz2
|
||||||
fi
|
;;
|
||||||
|
sqlite)
|
||||||
if [[ "$BUILD" = *"sqlite"* ]]; then
|
|
||||||
curl_download_library sqlite http://www.sqlite.org/2017/ sqlite-autoconf-${CURRENT_SQLITE}.tar.gz
|
curl_download_library sqlite http://www.sqlite.org/2017/ sqlite-autoconf-${CURRENT_SQLITE}.tar.gz
|
||||||
fi
|
;;
|
||||||
|
*)
|
||||||
|
echo "unknown package \"$package\""
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue