diff --git a/.gitignore b/.gitignore index 461c1c17..d403dbbc 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,7 @@ ios-missing-include/Xm dizout jreout jdkout +libffi-3.4.2/ +*.tar.xz +*.tar.gz +.DS_Store \ No newline at end of file diff --git a/README.md b/README.md index 44784c15..2b3b567b 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ Based on http://openjdk.java.net/projects/mobile/android.html #### iOS - You should get latest Xcode (tested with Xcode 12). +- Code: `ci_build_arch_aarch64.sh` ### Platform and architecture specific environment variables diff --git a/build-framework/build-and-sign.sh b/build-framework/build-and-sign.sh new file mode 100644 index 00000000..ab85ee53 --- /dev/null +++ b/build-framework/build-and-sign.sh @@ -0,0 +1,74 @@ +# For every *.dylib file in dylibs/, create a framework for it +# and copy it to out/ + + +mkdir -p out + +info_plist_template=' + + + + + BuildMachineOSBuild + 18C54 + CFBundleDevelopmentRegion + en + CFBundleExecutable + {libname} + CFBundleIdentifier + {sanatised_libname} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + {libname} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSupportedPlatforms + + iPhoneOS + + CFBundleVersion + 1 + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 16B91 + DTPlatformName + iphoneos + DTPlatformVersion + 14.0 + DTSDKBuild + 16B91 + DTSDKName + iphoneos + DTXcode + 1010 + DTXcodeBuild + 10B61 + MinimumOSVersion + 15.0 + UIDeviceFamily + + 1 + 2 + + + +' + +# lipo -create libffi.framework/libffi.8.dylib -output libffi.framework/libffi +# rm libffi.framework/libffi.8.dylib +# codesign --force --sign YOUR_IDENTITY + +for lib in "libjli" "libjvm" "libattach" "libj2pcsc" "liblcms" "libawt" "libj2pkcs11" "libmanagement" "libawt_headless" "libjaas_unix" "libmlib_image" "libdt_socket" "libjava" "libnet" "libffi.8" "libjava_crw_demo" "libnio" "libfontmanager" "libjawt" "libnpt" "libfreetype" "libjdwp" "libsunec" "libhprof" "libjpeg" "libunpack" "libinstrument" "libjsdt" "libverify" "libj2gss" "libjsig" "libzip" + do + sanatised_libname=$(echo $lib | sed 's/_//g') + mkdir -p out/$lib.framework + codesign --force --sign YOUR_IDENTITY --identifier $sanatised_libname dylibs/$lib.dylib + lipo -create dylibs/$lib.dylib -output out/$lib.framework/$lib + # Write the Info.plist file + # sanitise the libname to remove underscores + echo "$info_plist_template" | sed "s/{libname}/$lib/g" | sed "s/{sanatised_libname}/$sanatised_libname/g" > out/$lib.framework/Info.plist + done \ No newline at end of file diff --git a/buildjdk.sh b/buildjdk.sh index 425205ab..8bf40253 100755 --- a/buildjdk.sh +++ b/buildjdk.sh @@ -68,9 +68,9 @@ export LIBFFI_LIBS="-L$LIBFFI_DIR/lib" # --with-sysroot="$(xcrun --sdk iphoneos --show-sdk-path)" \ bash ./configure \ --openjdk-target=$TARGET_PHYS \ - --with-extra-cflags="$CFLAGS" \ - --with-extra-cxxflags="$CFLAGS" \ - --with-extra-ldflags="$LDFLAGS" \ + --with-extra-cflags="$CFLAGS -miphoneos-version-min=15.0" \ + --with-extra-cxxflags="$CFLAGS -miphoneos-version-min=15.0" \ + --with-extra-ldflags="$LDFLAGS-miphoneos-version-min=15.0" \ --enable-option-checking=fatal \ --with-jdk-variant=normal \ --with-jvm-variants="${JVM_VARIANTS/AND/,}" \ diff --git a/buildlibs.sh b/buildlibs.sh index 2c78fbbb..dc8bd72d 100755 --- a/buildlibs.sh +++ b/buildlibs.sh @@ -9,10 +9,10 @@ if [ "$BUILD_IOS" == "1" ]; then echo "Building libffi" cd libffi-3.4.2 - python generate-darwin-source-and-headers.py --only-ios + python3 generate-darwin-source-and-headers.py --only-ios xcodebuild -arch arm64 cd build_iphoneos-arm64 - make prefix=`pwd` install + sudo make prefix=`pwd` install cd ../.. echo "Building Freetype" diff --git a/ci_build_arch_aarch64.sh b/ci_build_arch_aarch64.sh index a75bd217..7de97c97 100755 --- a/ci_build_arch_aarch64.sh +++ b/ci_build_arch_aarch64.sh @@ -1,5 +1,7 @@ #!/bin/bash set -e +export BUILD_IOS=1 + if [ "$BUILD_IOS" == "1" ]; then export TARGET=aarch64-apple-darwin18.2 else diff --git a/clonejdk.sh b/clonejdk.sh index af00eb06..4f6a03df 100755 --- a/clonejdk.sh +++ b/clonejdk.sh @@ -3,7 +3,7 @@ set -e if [ "$TARGET_JDK" == "arm" ]; then git clone --depth 1 https://github.com/PojavLauncherTeam/openjdk-aarch32-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 --branch ios https://github.com/thebaselab/openjdk-multiarch-jdk8u openjdk else git clone --depth 1 https://github.com/PojavLauncherTeam/openjdk-multiarch-jdk8u openjdk fi