build: docker jre21 compat, CI updated for both 21 and 17

This commit is contained in:
Mathias-Boulay 2024-06-15 17:56:40 +02:00
parent 7fc629ab1c
commit 75de467a28
12 changed files with 5886 additions and 39 deletions

View File

@ -12,42 +12,54 @@ jobs:
strategy:
matrix:
arch: ["aarch32", "aarch64", "x86", "x86_64"]
version: [17, 21]
fail-fast: false
name: "Build for Android ${{matrix.arch}}"
name: "Build Java ${{ matrix.version }} for Android ${{matrix.arch}}"
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: set up JDK 1.17
- name: set up JDK 1.${{ matrix.version }}
uses: actions/setup-java@v4
with:
java-version: 17
java-version: ${{ matrix.version }}
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 "1_ci_build_arch_${{matrix.arch}}.sh"
run: export TARGET_VERSION=${{ matrix.version }} && bash "1_ci_build_arch_${{matrix.arch}}.sh"
- name: Upload JDK build output
uses: actions/upload-artifact@v4
with:
name: "jdk17-${{matrix.arch}}"
path: jdk17*.tar.xz
name: "jdk${{ matrix.version }}-${{matrix.arch}}"
path: jdk${{ matrix.version }}*.tar.xz
- name: Upload JRE build output
uses: actions/upload-artifact@v4
with:
name: "jre17-${{matrix.arch}}"
path: jre17*.tar.xz
name: "jre${{ matrix.version }}-${{matrix.arch}}"
path: jre${{ matrix.version }}*.tar.xz
- name: Upload JRE debuginfo build output
uses: actions/upload-artifact@v4
with:
name: "jre17-debuginfo-${{matrix.arch}}"
name: "jre${{ matrix.version }}-debuginfo-${{matrix.arch}}"
path: dizout
build_iosport:
name: "Build for iOS aarch64"
strategy:
matrix:
version: [17, 21]
fail-fast: false
name: "Build Java ${{ matrix.version }} for iOS aarch64"
runs-on: MacStadium
continue-on-error: true
steps:
@ -57,7 +69,7 @@ jobs:
- name: Build with CI build script
run: |
export PATH=/opt/procursus/bin:/opt/homebrew/bin:$PATH
export JAVA_HOME=$(/usr/libexec/java_home -v 17)
export JAVA_HOME=$(/usr/libexec/java_home -v ${{ matrix.version }})
export BUILD_IOS=1
bash "1_ci_build_arch_aarch64.sh"
@ -70,45 +82,55 @@ jobs:
- name: Upload JRE build output
uses: actions/upload-artifact@v4
with:
name: "jre17-ios-aarch64"
path: jre17*.tar.xz
name: "jre${{ matrix.version }}-ios-aarch64"
path: jre${{ matrix.version }}*.tar.xz
- name: Upload JRE debuginfo build output
uses: actions/upload-artifact@v4
with:
name: "jre17-ios-debuginfo-aarch64"
name: "jre${{ matrix.version }}-ios-debuginfo-aarch64"
path: dizout
pojav:
needs: build_android
runs-on: ubuntu-22.04
strategy:
matrix:
version: [17, 21]
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get jre17-aarch32
- name: Get jre${{ matrix.version }}-aarch32
uses: actions/download-artifact@v4
with:
name: jre17-aarch32
name: jre${{ matrix.version }}-aarch32
path: pojav
- name: Get jre17-aarch64
- name: Get jre${{ matrix.version }}-aarch64
uses: actions/download-artifact@v4
with:
name: jre17-aarch64
name: jre${{ matrix.version }}-aarch64
path: pojav
- name: Get jre17-x86
- name: Get jre${{ matrix.version }}-x86
uses: actions/download-artifact@v4
with:
name: jre17-x86
name: jre${{ matrix.version }}-x86
path: pojav
- name: Get jre17-x86_64
- name: Get jre${{ matrix.version }}-x86_64
uses: actions/download-artifact@v4
with:
name: jre17-x86_64
name: jre${{ matrix.version }}-x86_64
path: pojav
- name: Repack JRE
run: bash "9_repackjre.sh" $GITHUB_WORKSPACE/pojav $GITHUB_WORKSPACE/pojav/jre17-pojav
run: bash "9_repackjre.sh" $GITHUB_WORKSPACE/pojav $GITHUB_WORKSPACE/pojav/jre${{ matrix.version }}-pojav
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: jre17-pojav
path: pojav/jre17-pojav/*
name: jre${{ matrix.version }}-pojav
path: pojav/jre${{ matrix.version }}-pojav/*

2
.gitignore vendored
View File

@ -6,6 +6,8 @@ dummy_libs
freetype-*-x86
jdk1.8.0_*
openjdk
openjdk-17
openjdk-21
android-ndk-r*
jre.tar.xz
jreout

View File

@ -21,8 +21,11 @@ fi
# Some modifies to NDK to fix
./3_getlibs.sh
./4_buildlibs.sh
# Only build the sources if they are not already present
if [ ! -d "cups-2.2.4" ]; then
./3_getlibs.sh
./4_buildlibs.sh
fi
./5_clonejdk.sh
./6_buildjdk.sh
./7_removejdkdebuginfo.sh

View File

@ -1,4 +1,8 @@
#!/bin/bash
set -e
git clone --depth 1 https://github.com/openjdk/jdk17u openjdk
if [[ $TARGET_VERSION -eq 21 ]]; then
git clone --branch jdk21.0.1 --depth 1 https://github.com/openjdk/jdk21u openjdk-21
else
git clone --depth 1 https://github.com/openjdk/jdk17u openjdk-17
fi

View File

@ -75,14 +75,14 @@ fi
# fix building libjawt
ln -s -f $CUPS_DIR/cups $ANDROID_INCLUDE/
cd openjdk
cd openjdk-${TARGET_VERSION}
# Apply patches
git reset --hard
if [[ "$BUILD_IOS" != "1" ]]; then
find ../patches/jre_17/android -name "*.diff" -print0 | xargs -0 -I {} sh -c 'echo "Applying {}" && git apply {} && || echo "git apply failed (Android patch set)"'
find ../patches/jre_${TARGET_VERSION}/android -name "*.diff" -print0 | xargs -0 -I {} sh -c 'echo "Applying {}" && git apply --reject --whitespace=fix {} || echo "git apply failed (Android patch set)"'
else
find ../patches/jre_17/ios -name "*.diff" -print0 | xargs -0 -I {} sh -c 'echo "Applying {}" && git apply {} && || echo "git apply failed (iOs patch set)"'
find ../patches/jre_${TARGET_VERSION}/ios -name "*.diff" -print0 | xargs -0 -I {} sh -c 'echo "Applying {}" && git apply --reject --whitespace=fix {} && || echo "git apply failed (iOs patch set)"'
# Hack: exclude building macOS stuff
desktop_mac=src/java.desktop/macosx

View File

@ -3,7 +3,7 @@ set -e
. setdevkitpath.sh
imagespath=openjdk/build/${JVM_PLATFORM}-${TARGET_JDK}-${JVM_VARIANTS}-${JDK_DEBUG_LEVEL}/images
imagespath=openjdk-${TARGET_VERSION}/build/${JVM_PLATFORM}-${TARGET_JDK}-${JVM_VARIANTS}-${JDK_DEBUG_LEVEL}/images
rm -rf dizout jreout jdkout dSYM-temp
mkdir -p dizout dSYM-temp/{lib,bin}

View File

@ -36,8 +36,13 @@ cd jreout
# Strip in place all .so files thanks to the ndk
find ./ -name '*.so' -execdir ${TOOLCHAIN}/bin/llvm-strip {} \;
tar cJf ../jre17-${TARGET_SHORT}-`date +%Y%m%d`-${JDK_DEBUG_LEVEL}.tar.xz .
tar cJf ../jre${TARGET_VERSION}-${TARGET_SHORT}-`date +%Y%m%d`-${JDK_DEBUG_LEVEL}.tar.xz .
cd ../jdkout
tar cJf ../jdk17-${TARGET_SHORT}-`date +%Y%m%d`-${JDK_DEBUG_LEVEL}.tar.xz .
tar cJf ../jdk${TARGET_VERSION}-${TARGET_SHORT}-`date +%Y%m%d`-${JDK_DEBUG_LEVEL}.tar.xz .
# Remove jreout and jdkout
cd ..
rm -rf jreout jdkout

View File

@ -24,6 +24,8 @@ RUN apt-get install -y \
libxtst-dev \
libxt-dev \
wget \
gcc \
g++ \
clang \
git \
file \
@ -31,6 +33,7 @@ RUN apt-get install -y \
# JDK 17
RUN apt-get install -y openjdk-17-jdk
RUN apt-get install -y openjdk-21-jdk
WORKDIR /home
@ -44,6 +47,4 @@ RUN \
&& rm android-ndk-$NDK_VERSION-linux-x86_64.zip
COPY . .

View File

@ -6,5 +6,5 @@ set -e
export FREETYPE_DIR=`pwd`/freetype-${BUILD_FREETYPE_VERSION}/build_android-${TARGET_SHORT}
export CUPS_DIR=`pwd`/cups-2.2.4
cd openjdk/build/${JVM_PLATFORM}-${TARGET_JDK}-${JVM_VARIANTS}-release
cd openjdk-${TARGET_VERSION}/build/${JVM_PLATFORM}-${TARGET_JDK}-${JVM_VARIANTS}-release
make JOBS=4 images

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,15 @@
# Use the old NDK r10e to not get internal compile error at (still?)
# https://github.com/PojavLauncherTeam/openjdk-multiarch-jdk8u/blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.c
# Description: Set the environment variables for the build scripts.
export NDK_VERSION=r25c
# Target version is either 17 or 21
if [[ -z "$TARGET_VERSION" ]]
then
export TARGET_VERSION=21
fi
# Set custom java version as the defautl jdk depending on the target version
update-java-alternatives -s java-1.${TARGET_VERSION}*
if [[ -z "$BUILD_FREETYPE_VERSION" ]]
then
export BUILD_FREETYPE_VERSION="2.10.0"