#!/bin/bash set -e merge_binaries() { X86DIR=$1 ARMDIR=$2 echo "Merging ARM64 binaries from $ARMDIR into fat binaries at $X86DIR..." IFS=" " pushd "$X86DIR" for X86BIN in $(find . -type f \( -name '*.dylib' -o -name '*.a' -o -perm +111 \)); do if file "$X86DIR/$X86BIN" | grep "Mach-O " >/dev/null; then ARMBIN="${ARMDIR}/${X86BIN}" echo "Merge $ARMBIN to $X86BIN..." lipo -create "$X86BIN" "$ARMBIN" -o "$X86BIN" fi done popd } if [ "$#" -ne 1 ]; then echo "Syntax: $0 " exit 1 fi export MACOSX_DEPLOYMENT_TARGET=11.0 NPROCS="$(getconf _NPROCESSORS_ONLN)" SCRIPTDIR=$(realpath $(dirname "${BASH_SOURCE[0]}")) INSTALLDIR="$1" if [ "${INSTALLDIR:0:1}" != "/" ]; then INSTALLDIR="$PWD/$INSTALLDIR" fi FREETYPE=2.13.2 HARFBUZZ=8.3.1 SDL2=2.30.6 ZSTD=1.5.6 LIBPNG=1.6.43 LIBJPEG=9f LIBWEBP=1.4.0 FFMPEG=7.0.2 MOLTENVK=1.2.9 QT=6.7.2 CPUINFO=7524ad504fdcfcf75a18a133da6abd75c5d48053 DISCORD_RPC=144f3a3f1209994d8d9e8a87964a989cb9911c1e SHADERC=feb2460bf3a504d67011246edeb810c45ea58826 SOUNDTOUCH=463ade388f3a51da078dc9ed062bf28e4ba29da7 SPIRV_CROSS=vulkan-sdk-1.3.290.0 mkdir -p deps-build cd deps-build export PKG_CONFIG_PATH="$INSTALLDIR/lib/pkgconfig:$PKG_CONFIG_PATH" export LDFLAGS="-L$INSTALLDIR/lib $LDFLAGS" export CFLAGS="-I$INSTALLDIR/include $CFLAGS" export CXXFLAGS="-I$INSTALLDIR/include $CXXFLAGS" CMAKE_COMMON=( -DCMAKE_BUILD_TYPE=Release -DCMAKE_SHARED_LINKER_FLAGS="-dead_strip -dead_strip_dylibs" -DCMAKE_PREFIX_PATH="$INSTALLDIR" -DCMAKE_INSTALL_PREFIX="$INSTALLDIR" -DCMAKE_INSTALL_NAME_DIR='$/lib' ) CMAKE_ARCH_X64=-DCMAKE_OSX_ARCHITECTURES="x86_64" CMAKE_ARCH_ARM64=-DCMAKE_OSX_ARCHITECTURES="arm64" CMAKE_ARCH_UNIVERSAL=-DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" cat > SHASUMS <