#!/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)" INSTALLDIR="$1" if [ "${INSTALLDIR:0:1}" != "/" ]; then INSTALLDIR="$PWD/$INSTALLDIR" fi FREETYPE=2.13.2 HARFBUZZ=8.3.1 SDL=SDL2-2.30.2 ZLIB=1.3.1 ZSTD=1.5.5 LIBPNG=1.6.43 LIBJPEG=9f LIBWEBP=1.3.2 MOLTENVK=1.2.8 QT=6.7.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_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 <