diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3c59535..065fb34 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,28 +15,33 @@ jobs: fail-fast: false name: "Build for Android ${{matrix.arch}}" - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: set up JDK 1.17 - uses: actions/setup-java@v1 + uses: actions/setup-java@v4 with: - java-version: 1.17 + java-version: 17 + distribution: temurin + - name: Install build dependencies + run: | + sudo apt update + sudo apt -y install autoconf python3 python-is-python3 unzip zip systemtap-sdt-dev libxtst-dev libasound2-dev libelf-dev libfontconfig1-dev libx11-dev libxext-dev libxrandr-dev libxrender-dev libxtst-dev libxt-dev - name: Build with CI build script run: bash "ci_build_arch_${{matrix.arch}}.sh" - name: Upload JDK build output - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: "jdk17-${{matrix.arch}}" path: jdk17*.tar.xz - name: Upload JRE build output - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: 'jre17-${{matrix.arch}}' path: jre17*.tar.xz - name: Upload JRE debuginfo build output - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: "jre17-debuginfo-${{matrix.arch}}" path: dizout @@ -47,7 +52,7 @@ jobs: continue-on-error: true steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Build with CI build script run: | @@ -57,53 +62,53 @@ jobs: bash "ci_build_arch_aarch64.sh" - name: Upload JDK build output - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: "jdk17-ios-aarch64" path: jdk17*.tar.xz - name: Upload JRE build output - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: 'jre17-ios-aarch64' path: jre17*.tar.xz - name: Upload JRE debuginfo build output - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: "jre17-ios-debuginfo-aarch64" path: dizout pojav: needs: build_android - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Get jre17-aarch32 - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: jre17-aarch32 path: pojav - name: Get jre17-aarch64 - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: jre17-aarch64 path: pojav - name: Get jre17-x86 - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: jre17-x86 path: pojav - name: Get jre17-x86_64 - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: jre17-x86_64 path: pojav - name: Repack JRE run: bash "repackjre.sh" $GITHUB_WORKSPACE/pojav $GITHUB_WORKSPACE/pojav/jre17-pojav - name: Upload artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: jre17-pojav path: pojav/jre17-pojav/* diff --git a/buildjdk.sh b/buildjdk.sh index c45752b..9b0318b 100755 --- a/buildjdk.sh +++ b/buildjdk.sh @@ -5,18 +5,18 @@ set -e export FREETYPE_DIR=$PWD/freetype-$BUILD_FREETYPE_VERSION/build_android-$TARGET_SHORT export CUPS_DIR=$PWD/cups-2.2.4 export CFLAGS+=" -DLE_STANDALONE" # -I$FREETYPE_DIR -I$CUPS_DI -if [ "$TARGET_JDK" == "arm" ] # || [ "$BUILD_IOS" == "1" ] +if [[ "$TARGET_JDK" == "arm" ]] # || [[ "$BUILD_IOS" == "1" ]] then export CFLAGS+=" -O3 -D__thumb__" else - if [ "$TARGET_JDK" == "x86" ]; then + if [[ "$TARGET_JDK" == "x86" ]]; then export CFLAGS+=" -O3 -mstackrealign" else export CFLAGS+=" -O3" fi fi -# if [ "$TARGET_JDK" == "aarch32" ] || [ "$TARGET_JDK" == "aarch64" ] +# if [[ "$TARGET_JDK" == "aarch32" ]] || [[ "$TARGET_JDK" == "aarch64" ]] # then # export CFLAGS+=" -march=armv7-a+neon" # fi @@ -27,7 +27,7 @@ fi # cp -R /usr/include/X11 $ANDROID_INCLUDE/ # cp -R /usr/include/fontconfig $ANDROID_INCLUDE/ -if [ "$BUILD_IOS" != "1" ]; then +if [[ "$BUILD_IOS" != "1" ]]; then chmod +x android-wrapped-clang chmod +x android-wrapped-clang++ ln -s -f /usr/include/X11 $ANDROID_INCLUDE/ @@ -41,8 +41,6 @@ if [ "$BUILD_IOS" != "1" ]; then export CFLAGS+=" -DANDROID" export LDFLAGS+=" -L$PWD/dummy_libs" - sudo apt -y install systemtap-sdt-dev libxtst-dev libasound2-dev libelf-dev libfontconfig1-dev libx11-dev libxext-dev libxrandr-dev libxrender-dev libxtst-dev libxt-dev - # Create dummy libraries so we won't have to remove them in OpenJDK makefiles mkdir -p dummy_libs ar cru dummy_libs/libpthread.a @@ -52,7 +50,7 @@ else ln -s -f /opt/X11/include/X11 $ANDROID_INCLUDE/ ln -sfn $themacsysroot/System/Library/Frameworks/CoreAudio.framework/Headers $ANDROID_INCLUDE/CoreAudio ln -sfn $themacsysroot/System/Library/Frameworks/IOKit.framework/Headers $ANDROID_INCLUDE/IOKit - if [ "$(uname -p)" == "arm" ]; then + if [[ "$(uname -p)" == "arm" ]]; then ln -s -f /opt/homebrew/include/fontconfig $ANDROID_INCLUDE/ else ln -s -f /usr/local/include/fontconfig $ANDROID_INCLUDE/ @@ -77,7 +75,7 @@ cd openjdk # Apply patches git reset --hard -if [ "$BUILD_IOS" != "1" ]; then +if [[ "$BUILD_IOS" != "1" ]]; then git apply --reject --whitespace=fix ../patches/jdk17u_android.diff || echo "git apply failed (Android patch set)" else git apply --reject --whitespace=fix ../patches/jdk17u_ios.diff || echo "git apply failed (iOS patch set)" @@ -114,7 +112,7 @@ bash ./configure \ --x-libraries=/usr/lib \ $platform_args || \ error_code=$? -if [ "$error_code" -ne 0 ]; then +if [[ "$error_code" -ne 0 ]]; then echo "\n\nCONFIGURE ERROR $error_code , config.log:" cat config.log exit $error_code @@ -122,14 +120,14 @@ fi jobs=4 -if [ "$BUILD_IOS" == "1" ]; then +if [[ "$BUILD_IOS" == "1" ]]; then jobs=$(sysctl -n hw.ncpu) fi cd build/${JVM_PLATFORM}-${TARGET_JDK}-${JVM_VARIANTS}-${JDK_DEBUG_LEVEL} make JOBS=$jobs images || \ error_code=$? -if [ "$error_code" -ne 0 ]; then +if [[ "$error_code" -ne 0 ]]; then echo "Build failure, exited with code $error_code. Trying again." make JOBS=$jobs images fi diff --git a/buildlibs.sh b/buildlibs.sh index 134d66c..6a8960e 100755 --- a/buildlibs.sh +++ b/buildlibs.sh @@ -5,7 +5,7 @@ cd freetype-$BUILD_FREETYPE_VERSION echo "Building Freetype" -if [ "$BUILD_IOS" != "1" ]; then +if [[ "$BUILD_IOS" != "1" ]]; then export PATH=$TOOLCHAIN/bin:$PATH ./configure \ --host=$TARGET \ @@ -15,7 +15,7 @@ if [ "$BUILD_IOS" != "1" ]; then --with-harfbuzz=no $EXTRA_ARGS \ || error_code=$? -if [ "$error_code" -ne 0 ]; then +if [[ "$error_code" -ne 0 ]]; then echo "\n\nCONFIGURE ERROR $error_code , config.log:" cat ${PWD}/builds/unix/config.log exit $error_code diff --git a/ci_build_arch_aarch64.sh b/ci_build_arch_aarch64.sh index 4588b66..5428d5c 100755 --- a/ci_build_arch_aarch64.sh +++ b/ci_build_arch_aarch64.sh @@ -1,6 +1,6 @@ #!/bin/bash set -e -if [ "$BUILD_IOS" == "1" ]; then +if [[ "$BUILD_IOS" == "1" ]]; then export TARGET=aarch64-apple-ios else export TARGET=aarch64-linux-android diff --git a/ci_build_global.sh b/ci_build_global.sh index 2e262a2..0f7b14c 100755 --- a/ci_build_global.sh +++ b/ci_build_global.sh @@ -4,10 +4,7 @@ set -e export JDK_DEBUG_LEVEL=release -if [ "$BUILD_IOS" != "1" ]; then - sudo apt update - sudo apt -y install autoconf python unzip zip - +if [[ "$BUILD_IOS" != "1" ]]; then wget -nc -nv -O android-ndk-$NDK_VERSION-linux-x86_64.zip "https://dl.google.com/android/repository/android-ndk-$NDK_VERSION-linux-x86_64.zip" ./extractndk.sh ./maketoolchain.sh diff --git a/removejdkdebuginfo.sh b/removejdkdebuginfo.sh index 7411a3c..2ebe4ec 100755 --- a/removejdkdebuginfo.sh +++ b/removejdkdebuginfo.sh @@ -8,7 +8,7 @@ imagespath=openjdk/build/${JVM_PLATFORM}-${TARGET_JDK}-${JVM_VARIANTS}-${JDK_DEB rm -rf dizout jreout jdkout dSYM-temp mkdir -p dizout dSYM-temp/{lib,bin} -if [ "$BUILD_IOS" != "1" ]; then +if [[ "$BUILD_IOS" != "1" ]]; then cp freetype-$BUILD_FREETYPE_VERSION/build_android-$TARGET_SHORT/lib/libfreetype.so $imagespath/jdk/lib/ fi @@ -22,7 +22,7 @@ cp -r $imagespath/jdk jdkout export EXTRA_JLINK_OPTION= -if [ "$TARGET_JDK" == "aarch64" ] || [ "$TARGET_JDK" == "x86_64" ]; then +if [[ "$TARGET_JDK" == "aarch64" ]] || [[ "$TARGET_JDK" == "x86_64" ]]; then echo "Building for aarch64 or x86_64, introducing JVMCI module" export EXTRA_JLINK_OPTION=,jdk.internal.vm.ci fi @@ -38,7 +38,7 @@ jlink \ --release-info=jdkout/release \ --compress=0 -if [ "$BUILD_IOS" != "1" ]; then +if [[ "$BUILD_IOS" != "1" ]]; then cp freetype-$BUILD_FREETYPE_VERSION/build_android-$TARGET_SHORT/lib/libfreetype.so jreout/lib/ fi @@ -53,7 +53,7 @@ find jdkout -name "*.dSYM" | xargs -- rm -rf #TODO: fix .dSYM stuff -if [ "$BUILD_IOS" == "1" ]; then +if [[ "$BUILD_IOS" == "1" ]]; then install_name_tool -id @rpath/libfreetype.dylib jdkout/lib/libfreetype.dylib install_name_tool -id @rpath/libfreetype.dylib jreout/lib/libfreetype.dylib install_name_tool -change build_android-arm64/lib/libfreetype.dylib @rpath/libfreetype.dylib jdkout/lib/libfontmanager.dylib diff --git a/repackjre.sh b/repackjre.sh index 4109298..44aa5bc 100755 --- a/repackjre.sh +++ b/repackjre.sh @@ -68,7 +68,7 @@ makearch i386 x86 makearch amd64 x86_64 # if running under GitHub Actions, write commit sha, else formatted system date -if [ -n "$GITHUB_SHA" ] +if [[ -n "$GITHUB_SHA" ]] then echo $GITHUB_SHA>"$out"/version else diff --git a/setdevkitpath.sh b/setdevkitpath.sh index 67b594d..594118f 100755 --- a/setdevkitpath.sh +++ b/setdevkitpath.sh @@ -2,29 +2,29 @@ # https://github.com/PojavLauncherTeam/openjdk-multiarch-jdk8u/blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.c export NDK_VERSION=r21 -if [ -z "$BUILD_FREETYPE_VERSION" ] +if [[ -z "$BUILD_FREETYPE_VERSION" ]] then export BUILD_FREETYPE_VERSION="2.10.0" fi -if [ -z "$JDK_DEBUG_LEVEL" ] +if [[ -z "$JDK_DEBUG_LEVEL" ]] then export JDK_DEBUG_LEVEL=release fi -if [ "$TARGET_JDK" == "aarch64" ] +if [[ "$TARGET_JDK" == "aarch64" ]] then export TARGET_SHORT=arm64 else export TARGET_SHORT=$TARGET_JDK fi -if [ -z "$JVM_VARIANTS" ] +if [[ -z "$JVM_VARIANTS" ]] then export JVM_VARIANTS=server fi -if [ "$BUILD_IOS" == "1" ]; then +if [[ "$BUILD_IOS" == "1" ]]; then export JVM_PLATFORM=macosx export thecc=$(xcrun -find -sdk iphoneos clang) diff --git a/tarjdk.sh b/tarjdk.sh index fe91a23..740c45a 100755 --- a/tarjdk.sh +++ b/tarjdk.sh @@ -2,7 +2,7 @@ set -e . setdevkitpath.sh -if [ "$BUILD_IOS" != "1" ]; then +if [[ "$BUILD_IOS" != "1" ]]; then unset AR AS CC CXX LD OBJCOPY RANLIB STRIP CPPFLAGS LDFLAGS git clone https://github.com/termux/termux-elf-cleaner || true