Feat: use corretto-8 for iOS

This commit is contained in:
Duy Tran Khanh 2024-07-22 00:52:19 +01:00 committed by khanhduytran0
parent a753e0e862
commit 90b332788a
8 changed files with 2034 additions and 11 deletions

View File

@ -41,13 +41,13 @@ if [[ "$BUILD_IOS" != "1" ]]; then
ar cru dummy_libs/libthread_db.a
else
ln -s -f /opt/X11/include/X11 $ANDROID_INCLUDE/
platform_args="--with-toolchain-type=clang"
platform_args="--with-toolchain-type=clang SDKNAME=iphoneos"
# --disable-precompiled-headers
AUTOCONF_x11arg="--with-x=/opt/X11/include/X11 --prefix=/usr/lib"
sameflags="-arch arm64 -isysroot $thesysroot -miphoneos-version-min=12.0 -DHEADLESS=1 -I$PWD/ios-missing-include -Wno-implicit-function-declaration"
sameflags="-arch arm64 -isysroot $thesysroot -miphoneos-version-min=11.0 -DHEADLESS=1 -I$PWD/ios-missing-include -Wno-implicit-function-declaration"
export CFLAGS+=" $sameflags"
export CXXFLAGS="$sameflags"
export LDFLAGS+=" -miphoneos-version-min=12.0"
export LDFLAGS+=" -miphoneos-version-min=11.0"
HOMEBREW_NO_AUTO_UPDATE=1 brew install ldid xquartz
fi
@ -60,8 +60,8 @@ ln -s -f $CUPS_DIR/cups $ANDROID_INCLUDE/
cd openjdk
# Apply patches
git reset --hard
if [[ "$BUILD_IOS" != "1" ]]; then
git reset --hard
git apply --reject --whitespace=fix ../patches/jdk8u_android.diff || echo "git apply failed (universal patch set)"
if [[ "$TARGET_JDK" != "aarch32" ]]; then
git apply --reject --whitespace=fix ../patches/jdk8u_android_main.diff || echo "git apply failed (main non-universal patch set)"
@ -71,6 +71,8 @@ if [[ "$BUILD_IOS" != "1" ]]; then
if [[ "$TARGET_JDK" == "x86" ]]; then
git apply --reject --whitespace=fix ../patches/jdk8u_android_page_trap_fix.diff || echo "git apply failed (x86 page trap fix)"
fi
else
git apply --reject --whitespace=fix ../patches/jdk8u_ios.diff || echo "git apply failed (ios patch set)"
fi
# --with-extra-cxxflags="$CXXFLAGS -Dchar16_t=uint16_t -Dchar32_t=uint32_t" \

View File

@ -3,7 +3,7 @@ set -e
if [[ "$TARGET_JDK" == "arm" ]]; then
git clone --depth 1 https://github.com/openjdk/aarch32-port-jdk8u openjdk
elif [[ "$BUILD_IOS" == "1" ]]; then
git clone --depth 1 --branch ios https://github.com/PojavLauncherTeam/openjdk-multiarch-jdk8u openjdk
git clone --depth 1 https://github.com/corretto/corretto-8 openjdk
else
# Use aarch32 repo because it also has aarch64

View File

@ -0,0 +1 @@
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreAudio.framework/Headers

1
ios-missing-include/IOKit Symbolic link
View File

@ -0,0 +1 @@
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers

View File

@ -0,0 +1 @@
/opt/X11/include/fontconfig

View File

@ -4,8 +4,9 @@ set -e
# hack: remove iOS CFLAGS
if [ "$(uname -m)" == "x86_64" ]; then
args=${@/arm64/x86_64}
else
args=$@
fi
args=${args/"-isysroot $thesysroot"/}
args=${args/"-miphoneos-version-min=12.0"/}
args=${args/"-miphoneos-version-min=11.0"/}
$thecxx $args --stdlib=libc++ -isysroot $themacsysroot

2015
patches/jdk8u_ios.diff Normal file

File diff suppressed because it is too large Load Diff

View File

@ -17,10 +17,12 @@ if [[ "$TARGET_JDK" == "x86" ]]; then
export TARGET_JDK=i386
fi
mv jdkout/jre/lib/${TARGET_JDK}/libfreetype.so.6 jdkout/lib/${TARGET_JDK}/libfreetype.so || echo "Move exit $?"
mv jdkout/jre/lib/libfreetype.dylib.6 jdkout/jre/lib/libfreetype.dylib || echo "Move exit $?"
mv jreout/lib/${TARGET_JDK}/libfreetype.so.6 jreout/lib/${TARGET_JDK}/libfreetype.so || echo "Move exit $?"
mv jreout/lib/libfreetype.dylib.6 jreout/lib/libfreetype.dylib || echo "Move exit $?"
if [[ "$BUILD_IOS" != "1" ]]; then
mv jdkout/jre/lib/${TARGET_JDK}/libfreetype.so.6 jdkout/lib/${TARGET_JDK}/libfreetype.so || echo "Move exit $?"
mv jdkout/jre/lib/libfreetype.dylib.6 jdkout/jre/lib/libfreetype.dylib || echo "Move exit $?"
mv jreout/lib/${TARGET_JDK}/libfreetype.so.6 jreout/lib/${TARGET_JDK}/libfreetype.so || echo "Move exit $?"
mv jreout/lib/libfreetype.dylib.6 jreout/lib/libfreetype.dylib || echo "Move exit $?"
fi
# mv jreout/lib/${TARGET_JDK}/libfontmanager.diz jreout/lib/${TARGET_JDK}/libfontmanager.diz.keep
# find jreout -name "*.diz" | xargs -- rm