From 7745c9ef4351b05e412223eb6b78d23c7670b030 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Mon, 12 Aug 2024 17:29:36 +1000 Subject: [PATCH] Deps: Make some libraries optional for Linux --- scripts/deps/build-dependencies-linux.sh | 340 ++++++++++++++--------- 1 file changed, 207 insertions(+), 133 deletions(-) diff --git a/scripts/deps/build-dependencies-linux.sh b/scripts/deps/build-dependencies-linux.sh index 1aaa34ae9..eafaf2bd2 100755 --- a/scripts/deps/build-dependencies-linux.sh +++ b/scripts/deps/build-dependencies-linux.sh @@ -2,11 +2,39 @@ set -e -if [ "$#" -ne 1 ]; then - echo "Syntax: $0 " +if [ "$#" -lt 1 ]; then + echo "Syntax: $0 [-system-libjpeg] [-system-libpng] [-system-libwebp] [-system-zstd] [-system-qt] [-skip-download] " exit 1 fi +for arg in "$@"; do + if [ "$arg" == "-system-libjpeg" ]; then + echo "Skipping building libjpeg." + SKIP_LIBJPEG=true + shift + elif [ "$arg" == "-system-libpng" ]; then + echo "Skipping building libpng." + SKIP_LIBPNG=true + shift + elif [ "$arg" == "-system-libwebp" ]; then + echo "Skipping building libwebp." + SKIP_LIBWEBP=true + shift + elif [ "$arg" == "-system-zstd" ]; then + echo "Skipping building zstd." + SKIP_ZSTD=true + shift + elif [ "$arg" == "-system-qt" ]; then + echo "Skipping building Qt." + SKIP_QT=true + shift + elif [ "$arg" == "-skip-download" ]; then + echo "Not downloading sources." + SKIP_DOWNLOAD=true + shift + fi +done + SCRIPTDIR=$(realpath $(dirname "${BASH_SOURCE[0]}")) NPROCS="$(getconf _NPROCESSORS_ONLN)" INSTALLDIR="$1" @@ -31,48 +59,84 @@ SPIRV_CROSS=vulkan-sdk-1.3.290.0 mkdir -p deps-build cd deps-build +if [ "$SKIP_DOWNLOAD" != true ]; then + curl -C - -L \ + -O "https://github.com/ianlancetaylor/libbacktrace/archive/$LIBBACKTRACE.zip" \ + -O "https://github.com/libsdl-org/SDL/releases/download/release-$SDL2/SDL2-$SDL2.tar.gz" \ + -o "cpuinfo-$CPUINFO.tar.gz" "https://github.com/stenzek/cpuinfo/archive/$CPUINFO.tar.gz" \ + -o "discord-rpc-$DISCORD_RPC.tar.gz" "https://github.com/stenzek/discord-rpc/archive/$DISCORD_RPC.tar.gz" \ + -o "shaderc-$SHADERC.tar.gz" "https://github.com/stenzek/shaderc/archive/$SHADERC.tar.gz" \ + -o "soundtouch-$SOUNDTOUCH.tar.gz" "https://github.com/stenzek/soundtouch/archive/$SOUNDTOUCH.tar.gz" +fi + cat > SHASUMS <> SHASUMS <> SHASUMS <> SHASUMS <> SHASUMS <> SHASUMS <