diff --git a/cross-files/iossimulator-arm64.ini b/cross-files/iossimulator-arm64.ini index a4bd31b..2266ad3 100644 --- a/cross-files/iossimulator-arm64.ini +++ b/cross-files/iossimulator-arm64.ini @@ -15,14 +15,14 @@ strip = ['strip'] pkgconfig = ['pkg-config'] [built-in options] -c_args = ['-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk', '-miphoneos-version-min=12.0'] -cpp_args = ['-stdlib=libc++', '-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk', '-miphoneos-version-min=12.0'] -objc_args = ['-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk', '-miphoneos-version-min=12.0'] -objcpp_args = ['-stdlib=libc++', '-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk', '-miphoneos-version-min=12.0'] -c_link_args = ['-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk', '-miphoneos-version-min=12.0'] -cpp_link_args = ['-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk', '-miphoneos-version-min=12.0'] -objc_link_args = ['-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk', '-miphoneos-version-min=12.0'] -objcpp_link_args = ['-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk', '-miphoneos-version-min=12.0'] +c_args = ['-target', 'arm64-apple-ios-simulator', '-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk', '-miphoneos-version-min=12.0'] +cpp_args = ['-target', 'arm64-apple-ios-simulator', '-stdlib=libc++', '-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk', '-miphoneos-version-min=12.0'] +objc_args = ['-target', 'arm64-apple-ios-simulator', '-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk', '-miphoneos-version-min=12.0'] +objcpp_args = ['-target', 'arm64-apple-ios-simulator', '-stdlib=libc++', '-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk', '-miphoneos-version-min=12.0'] +c_link_args = ['-target', 'arm64-apple-ios-simulator', '-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk', '-miphoneos-version-min=12.0'] +cpp_link_args = ['-target', 'arm64-apple-ios-simulator', '-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk', '-miphoneos-version-min=12.0'] +objc_link_args = ['-target', 'arm64-apple-ios-simulator', '-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk', '-miphoneos-version-min=12.0'] +objcpp_link_args = ['-target', 'arm64-apple-ios-simulator', '-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk', '-miphoneos-version-min=12.0'] [properties] cmake_osx_sysroot = '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk' diff --git a/patches/ltmain-target-passthrough.patch b/patches/ltmain-target-passthrough.patch new file mode 100644 index 0000000..74fc5f8 --- /dev/null +++ b/patches/ltmain-target-passthrough.patch @@ -0,0 +1,11 @@ +--- a/ltmain.sh ++++ b/ltmain.sh +@@ -7154,7 +7154,7 @@ + # Tru64 UNIX uses -model [arg] to determine the layout of C++ + # classes, name mangling, and exception handling. + # Darwin uses the -arch flag to determine output architecture. +- -model|-arch|-isysroot|--sysroot) ++ -model|-arch|-isysroot|--sysroot|-target) + func_append compiler_flags " $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" diff --git a/scripts/libass/build.sh b/scripts/libass/build.sh index b19120d..cc69b5f 100644 --- a/scripts/libass/build.sh +++ b/scripts/libass/build.sh @@ -5,6 +5,8 @@ set -u # treat unset variables as an error cd ${SRC_DIR} +patch -p1 <${PROJECT_DIR}/patches/ltmain-target-passthrough.patch + cp ${PROJECT_DIR}/scripts/libass/meson.build ./meson.build meson setup build \ --cross-file ${PROJECT_DIR}/cross-files/${OS}-${ARCH}.ini \ diff --git a/scripts/libogg/build.sh b/scripts/libogg/build.sh index ca5dafa..097aa36 100644 --- a/scripts/libogg/build.sh +++ b/scripts/libogg/build.sh @@ -5,6 +5,8 @@ set -u # treat unset variables as an error cd ${SRC_DIR} +patch -p1 <${PROJECT_DIR}/patches/ltmain-target-passthrough.patch + cp ${PROJECT_DIR}/scripts/libogg/meson.* . meson setup build \ diff --git a/scripts/libs-arch/build.sh b/scripts/libs-arch/build.sh index d4d04f9..b91d1cd 100644 --- a/scripts/libs-arch/build.sh +++ b/scripts/libs-arch/build.sh @@ -27,7 +27,3 @@ ${PROJECT_DIR}/scripts/libs-arch/relink-dylibs.sh ${PROJECT_DIR} @rpath ${OUTPUT # remove signatures codesign --remove ${OUTPUT_DIR}/*.dylib - -if [ "${OS}" == "iossimulator" ] && [ "${ARCH}" == "arm64" ]; then - sh ${PROJECT_DIR}/scripts/libs-arch/fix-iossimulator-arm64.sh ${OUTPUT_DIR} -fi diff --git a/scripts/libs-arch/fix-iossimulator-arm64.sh b/scripts/libs-arch/fix-iossimulator-arm64.sh deleted file mode 100644 index 4217219..0000000 --- a/scripts/libs-arch/fix-iossimulator-arm64.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh - -set -e # exit immediately if a command exits with a non-zero status -set -u # treat unset variables as an error - -# The Apple sdk for the arm64 simulator produces dylib whose platform in the -# headers is `IOS` and not `IOSSIMULATOR`. This is wrong. -# So, this script replaces the platform header with `IOSSIMULATOR`. -# See: https://bogo.wtf/arm64-to-sim-dylibs.html - -LIBS_DIR=$1 - -ARCH=arm64 -IOSSIMULATOR=7 - -find "${LIBS_DIR}" -type f | while read DYLIB; do - echo "${DYLIB}" - - PLATFORM=$IOSSIMULATOR - MINOS=$(xcrun vtool -arch arm64 -show "${DYLIB}" | grep minos | cut -d ' ' -f6) - SDK=$(xcrun vtool -arch arm64 -show "${DYLIB}" | grep sdk | cut -d ' ' -f8) - - xcrun vtool \ - -arch $ARCH \ - -set-build-version $IOSSIMULATOR $MINOS $SDK \ - -replace \ - -output "${DYLIB}" \ - "${DYLIB}" -done diff --git a/scripts/libvorbis/build.sh b/scripts/libvorbis/build.sh index 8fbb30e..8f9f447 100644 --- a/scripts/libvorbis/build.sh +++ b/scripts/libvorbis/build.sh @@ -5,6 +5,11 @@ set -u # treat unset variables as an error cd ${SRC_DIR} +patch -p1 <${PROJECT_DIR}/patches/ltmain-target-passthrough.patch + +# Fix building on modern macOS +sed -i '' 's/\-force_cpusubtype_ALL//g' configure + cp ${PROJECT_DIR}/scripts/libvorbis/meson.* . meson setup build \ diff --git a/scripts/libvorbis/meson.build b/scripts/libvorbis/meson.build index 094d16a..b09cc8a 100644 --- a/scripts/libvorbis/meson.build +++ b/scripts/libvorbis/meson.build @@ -9,6 +9,7 @@ p = mod.add_project('configure', '--prefix=@PREFIX@', '--disable-static', '--enable-shared', + '--disable-tests' ], verbose: true, ) diff --git a/scripts/libx264/meson.build b/scripts/libx264/meson.build index bcb26c5..81b7dba 100644 --- a/scripts/libx264/meson.build +++ b/scripts/libx264/meson.build @@ -9,7 +9,6 @@ c_args = get_option('c_args') p = mod.add_project('configure', configure_options : [ '--prefix=@PREFIX@', - '--disable-static', '--enable-shared', '--disable-cli' ], diff --git a/scripts/libxml2/build.sh b/scripts/libxml2/build.sh index c487319..919aa1c 100644 --- a/scripts/libxml2/build.sh +++ b/scripts/libxml2/build.sh @@ -5,6 +5,8 @@ set -u # treat unset variables as an error cd ${SRC_DIR} +patch -p1 <${PROJECT_DIR}/patches/ltmain-target-passthrough.patch + cp ${PROJECT_DIR}/scripts/libxml2/meson.build ./meson.build meson setup build \ --cross-file ${PROJECT_DIR}/cross-files/${OS}-${ARCH}.ini \