#!/usr/bin/env bash # SPDX-FileCopyrightText: 2019-2024 Connor McLaughlin # SPDX-License-Identifier: CC-BY-NC-ND-4.0 set -e if [ "$#" -lt 1 ]; then echo "Syntax: $0 [-system-freetype] [-system-harfbuzz] [-system-libjpeg] [-system-libpng] [-system-libwebp] [-system-zstd] [-system-qt] [-skip-download] [-skip-cleanup] " exit 1 fi for arg in "$@"; do if [ "$arg" == "-system-freetype" ]; then echo "Skipping building FreeType." SKIP_FREETYPE=true shift elif [ "$arg" == "-system-harfbuzz" ]; then echo "Skipping building HarfBuzz." SKIP_HARFBUZZ=true shift elif [ "$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 elif [ "$arg" == "-skip-cleanup" ]; then echo "Not removing build directory." SKIP_CLEANUP=true shift fi done SCRIPTDIR=$(realpath $(dirname "${BASH_SOURCE[0]}")) NPROCS="$(getconf _NPROCESSORS_ONLN)" INSTALLDIR="$1" if [ "${INSTALLDIR:0:1}" != "/" ]; then INSTALLDIR="$PWD/$INSTALLDIR" fi FREETYPE=2.13.3 HARFBUZZ=10.0.1 LIBBACKTRACE=86885d14049fab06ef8a33aac51664230ca09200 LIBJPEGTURBO=3.0.4 LIBPNG=1.6.44 LIBWEBP=1.4.0 SDL2=2.30.7 QT=6.7.3 ZSTD=1.5.6 CPUINFO=7524ad504fdcfcf75a18a133da6abd75c5d48053 DISCORD_RPC=144f3a3f1209994d8d9e8a87964a989cb9911c1e LUNASVG=9af1ac7b90658a279b372add52d6f77a4ebb482c SHADERC=1c0d3d18819aa75ec74f1fbd9ff0461e1b69a4d6 SOUNDTOUCH=463ade388f3a51da078dc9ed062bf28e4ba29da7 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.tar.gz" \ -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 "lunasvg-$LUNASVG.tar.gz" "https://github.com/stenzek/lunasvg/archive/$LUNASVG.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 <> SHASUMS <> SHASUMS <