Skip to content

Commit 90b3327

Browse files
committed
Feat: use corretto-8 for iOS
1 parent a753e0e commit 90b3327

File tree

8 files changed

+2034
-11
lines changed

8 files changed

+2034
-11
lines changed

buildjdk.sh

+6-4
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ if [[ "$BUILD_IOS" != "1" ]]; then
4141
ar cru dummy_libs/libthread_db.a
4242
else
4343
ln -s -f /opt/X11/include/X11 $ANDROID_INCLUDE/
44-
platform_args="--with-toolchain-type=clang"
44+
platform_args="--with-toolchain-type=clang SDKNAME=iphoneos"
4545
# --disable-precompiled-headers
4646
AUTOCONF_x11arg="--with-x=/opt/X11/include/X11 --prefix=/usr/lib"
47-
sameflags="-arch arm64 -isysroot $thesysroot -miphoneos-version-min=12.0 -DHEADLESS=1 -I$PWD/ios-missing-include -Wno-implicit-function-declaration"
47+
sameflags="-arch arm64 -isysroot $thesysroot -miphoneos-version-min=11.0 -DHEADLESS=1 -I$PWD/ios-missing-include -Wno-implicit-function-declaration"
4848
export CFLAGS+=" $sameflags"
4949
export CXXFLAGS="$sameflags"
50-
export LDFLAGS+=" -miphoneos-version-min=12.0"
50+
export LDFLAGS+=" -miphoneos-version-min=11.0"
5151

5252
HOMEBREW_NO_AUTO_UPDATE=1 brew install ldid xquartz
5353
fi
@@ -60,8 +60,8 @@ ln -s -f $CUPS_DIR/cups $ANDROID_INCLUDE/
6060
cd openjdk
6161

6262
# Apply patches
63+
git reset --hard
6364
if [[ "$BUILD_IOS" != "1" ]]; then
64-
git reset --hard
6565
git apply --reject --whitespace=fix ../patches/jdk8u_android.diff || echo "git apply failed (universal patch set)"
6666
if [[ "$TARGET_JDK" != "aarch32" ]]; then
6767
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
7171
if [[ "$TARGET_JDK" == "x86" ]]; then
7272
git apply --reject --whitespace=fix ../patches/jdk8u_android_page_trap_fix.diff || echo "git apply failed (x86 page trap fix)"
7373
fi
74+
else
75+
git apply --reject --whitespace=fix ../patches/jdk8u_ios.diff || echo "git apply failed (ios patch set)"
7476
fi
7577

7678
# --with-extra-cxxflags="$CXXFLAGS -Dchar16_t=uint16_t -Dchar32_t=uint32_t" \

clonejdk.sh

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

ios-missing-include/CoreAudio

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

ios-missing-include/IOKit

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

ios-missing-include/fontconfig

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/opt/X11/include/fontconfig

macos-host-cc

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ set -e
44
# hack: remove iOS CFLAGS
55
if [ "$(uname -m)" == "x86_64" ]; then
66
args=${@/arm64/x86_64}
7+
else
8+
args=$@
79
fi
810
args=${args/"-isysroot $thesysroot"/}
9-
args=${args/"-miphoneos-version-min=12.0"/}
10-
11+
args=${args/"-miphoneos-version-min=11.0"/}
1112
$thecxx $args --stdlib=libc++ -isysroot $themacsysroot

patches/jdk8u_ios.diff

+2,015
Large diffs are not rendered by default.

removejdkdebuginfo.sh

+6-4
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@ if [[ "$TARGET_JDK" == "x86" ]]; then
1717
export TARGET_JDK=i386
1818
fi
1919

20-
mv jdkout/jre/lib/${TARGET_JDK}/libfreetype.so.6 jdkout/lib/${TARGET_JDK}/libfreetype.so || echo "Move exit $?"
21-
mv jdkout/jre/lib/libfreetype.dylib.6 jdkout/jre/lib/libfreetype.dylib || echo "Move exit $?"
22-
mv jreout/lib/${TARGET_JDK}/libfreetype.so.6 jreout/lib/${TARGET_JDK}/libfreetype.so || echo "Move exit $?"
23-
mv jreout/lib/libfreetype.dylib.6 jreout/lib/libfreetype.dylib || echo "Move exit $?"
20+
if [[ "$BUILD_IOS" != "1" ]]; then
21+
mv jdkout/jre/lib/${TARGET_JDK}/libfreetype.so.6 jdkout/lib/${TARGET_JDK}/libfreetype.so || echo "Move exit $?"
22+
mv jdkout/jre/lib/libfreetype.dylib.6 jdkout/jre/lib/libfreetype.dylib || echo "Move exit $?"
23+
mv jreout/lib/${TARGET_JDK}/libfreetype.so.6 jreout/lib/${TARGET_JDK}/libfreetype.so || echo "Move exit $?"
24+
mv jreout/lib/libfreetype.dylib.6 jreout/lib/libfreetype.dylib || echo "Move exit $?"
25+
fi
2426

2527
# mv jreout/lib/${TARGET_JDK}/libfontmanager.diz jreout/lib/${TARGET_JDK}/libfontmanager.diz.keep
2628
# find jreout -name "*.diz" | xargs -- rm

0 commit comments

Comments
 (0)