diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f0ecd5b..be198e9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,18 +15,23 @@ 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.7 - uses: actions/setup-java@v1 + uses: actions/setup-java@v4 with: - java-version: 1.7 + java-version: 7 + distribution: zulu + - name: Install build dependencies + run: | + sudo apt update + sudo apt -y install autoconf python3 python-is-python3 unzip zip systemtap-sdt-dev gcc-multilib g++-multilib libxtst-dev libasound2-dev libelf-dev libfontconfig1-dev libx11-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: "jdk8-${{matrix.arch}}" path: jdk8*.tar.xz @@ -36,46 +41,46 @@ jobs: uses: mxschmitt/action-tmate@v3 - name: Upload JRE build output - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: 'jre8-${{matrix.arch}}' path: jre8*.tar.xz - name: Upload JRE debuginfo build output - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: "jre8-debuginfo-${{matrix.arch}}" 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 jre8-aarch32 - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: jre8-aarch32 path: pojav - name: Get jre8-aarch64 - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: jre8-aarch64 path: pojav - name: Get jre8-x86 - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: jre8-x86 path: pojav - name: Get jre8-x86_64 - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: jre8-x86_64 path: pojav - name: Repack JRE run: bash "repackjre.sh" $GITHUB_WORKSPACE/pojav $GITHUB_WORKSPACE/pojav/jre8-pojav - name: Upload artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: jre8-pojav path: pojav/jre8-pojav/* diff --git a/buildjdk.sh b/buildjdk.sh index 0509782..25aaedd 100755 --- a/buildjdk.sh +++ b/buildjdk.sh @@ -2,7 +2,7 @@ set -e . setdevkitpath.sh -if [ "$TARGET_JDK" == "arm" ] +if [[ "$TARGET_JDK" == "arm" ]] then export TARGET_JDK=aarch32 export TARGET_PHYS=aarch32-linux-androideabi @@ -15,7 +15,7 @@ export FREETYPE_DIR=$PWD/freetype-$BUILD_FREETYPE_VERSION/build_android-$TARGET_ export CUPS_DIR=$PWD/cups-2.2.4 export CFLAGS+=" -DLE_STANDALONE" # -I$FREETYPE_DIR -I$CUPS_DI -# if [ "$TARGET_JDK" == "aarch32" ] || [ "$TARGET_JDK" == "aarch64" ] +# if [[ "$TARGET_JDK" == "aarch32" ]] || [[ "$TARGET_JDK" == "aarch64" ]] # then # export CFLAGS+=" -march=armv7-a+neon" # fi @@ -26,7 +26,7 @@ export CFLAGS+=" -DLE_STANDALONE" # -I$FREETYPE_DIR -I$CUPS_DI # cp -R /usr/include/X11 $ANDROID_INCLUDE/ # cp -R /usr/include/fontconfig $ANDROID_INCLUDE/ -if [ "$BUILD_IOS" != "1" ]; then +if [[ "$BUILD_IOS" != "1" ]]; then export CFLAGS+=" -O3 -D__ANDROID__" ln -s -f /usr/include/X11 $ANDROID_INCLUDE/ @@ -35,7 +35,6 @@ if [ "$BUILD_IOS" != "1" ]; then export LDFLAGS+=" -L`pwd`/dummy_libs" - sudo apt -y install systemtap-sdt-dev gcc-multilib g++-multilib libxtst-dev libasound2-dev libelf-dev libfontconfig1-dev libx11-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 @@ -61,15 +60,15 @@ ln -s -f $CUPS_DIR/cups $ANDROID_INCLUDE/ cd openjdk # Apply patches -if [ "$BUILD_IOS" != "1" ]; then +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 + if [[ "$TARGET_JDK" != "aarch32" ]]; then git apply --reject --whitespace=fix ../patches/jdk8u_android_main.diff || echo "git apply failed (main non-universal patch set)" else git apply --reject --whitespace=fix ../patches/jdk8u_android_aarch32.diff || echo "git apply failed (aarch32 non-universal patch set)" fi - if [ "$TARGET_JDK" == "x86" ]; 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 fi @@ -102,7 +101,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 @@ -111,7 +110,7 @@ fi cd build/${JVM_PLATFORM}-${TARGET_JDK}-normal-${JVM_VARIANTS}-${JDK_DEBUG_LEVEL} make JOBS=4 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=4 images fi diff --git a/buildlibs.sh b/buildlibs.sh index 3fd14f6..b099b24 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 LDFLAGS=-"arch arm64 -isysroot $thesysroot -miphoneos-version-min=12.0" export CC=$thecc @@ -34,7 +34,7 @@ else --with-harfbuzz=no $EXTRA_ARGS \ || error_code=$? fi -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 @@ -43,6 +43,6 @@ fi CFLAGS=-fno-rtti CXXFLAGS=-fno-rtti make -j4 make install -if [ -f "${namefreetype}.a" ]; then +if [[ -f "${namefreetype}.a" ]]; then clang -fPIC -shared $LDFLAGS -lbz2 -Wl,-all_load ${namefreetype}.a -o ${namefreetype}.dylib fi diff --git a/ci_build_arch_aarch64.sh b/ci_build_arch_aarch64.sh index 7092868..9342d4c 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-darwin18.2 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/clonejdk.sh b/clonejdk.sh index 7d740c0..3b6fcf1 100755 --- a/clonejdk.sh +++ b/clonejdk.sh @@ -1,8 +1,8 @@ #!/bin/bash set -e -if [ "$TARGET_JDK" == "arm" ]; then +if [[ "$TARGET_JDK" == "arm" ]]; then git clone --depth 1 https://github.com/openjdk/aarch32-port-jdk8u openjdk -elif [ "$BUILD_IOS" == "1" ]; then +elif [[ "$BUILD_IOS" == "1" ]]; then git clone --depth 1 --branch ios https://github.com/PojavLauncherTeam/openjdk-multiarch-jdk8u openjdk else # Use aarch32 repo because it also has aarch64 diff --git a/removejdkdebuginfo.sh b/removejdkdebuginfo.sh index 4a1ca01..0193d35 100755 --- a/removejdkdebuginfo.sh +++ b/removejdkdebuginfo.sh @@ -1,7 +1,7 @@ #!/bin/bash set -e -if [ "$TARGET_JDK" == "arm" ]; then +if [[ "$TARGET_JDK" == "arm" ]]; then export TARGET_JDK=aarch32 fi @@ -13,7 +13,7 @@ mkdir dizout cp -r $imagespath/j2re-image jreout cp -r $imagespath/j2sdk-image jdkout -if [ "$TARGET_JDK" == "x86" ]; then +if [[ "$TARGET_JDK" == "x86" ]]; then export TARGET_JDK=i386 fi @@ -29,7 +29,7 @@ mv jreout/lib/libfreetype.dylib.6 jreout/lib/libfreetype.dylib || echo "Move exi find jreout -name "*.diz" -delete find jdkout -name "*.diz" -exec mv {} dizout/ \; -if [ "$BUILD_IOS" == "1" ]; then +if [[ "$BUILD_IOS" == "1" ]]; then install_name_tool -id @rpath/libfreetype.dylib jdkout/jre/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/jre/lib/libfontmanager.dylib diff --git a/repackjre.sh b/repackjre.sh index 0b6696a..b693e06 100755 --- a/repackjre.sh +++ b/repackjre.sh @@ -83,7 +83,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 c4eac4e..ffda375 100755 --- a/setdevkitpath.sh +++ b/setdevkitpath.sh @@ -2,39 +2,39 @@ # https://github.com/PojavLauncherTeam/openjdk-multiarch-jdk8u/blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.c export NDK_VERSION=r10e -if [ -z "$BUILD_FREETYPE_VERSION" ] +if [[ -z "$BUILD_FREETYPE_VERSION" ]] then export BUILD_FREETYPE_VERSION="2.10.4" 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 [ "$TARGET_JDK" == "aarch32" ] || [ "$TARGET_JDK" == "arm" ] || [ "$TARGET_JDK" == "x86" ] +if [[ "$TARGET_JDK" == "aarch32" ]] || [[ "$TARGET_JDK" == "arm" ]] || [[ "$TARGET_JDK" == "x86" ]] then echo "VM variant: client" - if [ -z "$JVM_VARIANTS" ] + if [[ -z "$JVM_VARIANTS" ]] then export JVM_VARIANTS=client fi else echo "VM variant: server" - if [ -z "$JVM_VARIANTS" ] + if [[ -z "$JVM_VARIANTS" ]] then export JVM_VARIANTS=server fi 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 d729fa4..4950fe6 100755 --- a/tarjdk.sh +++ b/tarjdk.sh @@ -1,10 +1,10 @@ #!/bin/bash set -e -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 +git clone --depth 1 -b 'v2.2.0' https://github.com/termux/termux-elf-cleaner cd termux-elf-cleaner autoreconf --install bash configure