Skip to content

Commit

Permalink
Default Temurin jdk-21+ to use bundled FreeType (#3557)
Browse files Browse the repository at this point in the history
* Default Temurin jdk-21+ to use bundled FreeType

Signed-off-by: Andrew Leonard <anleonar@redhat.com>

* Default Temurin jdk-21+ to use bundled FreeType

Signed-off-by: Andrew Leonard <anleonar@redhat.com>

* Default Temurin jdk-21+ to use bundled FreeType

Signed-off-by: Andrew Leonard <anleonar@redhat.com>

* Default Temurin jdk-21+ to use bundled FreeType

Signed-off-by: Andrew Leonard <anleonar@redhat.com>

* Default Temurin jdk-21+ to use bundled FreeType

Signed-off-by: Andrew Leonard <anleonar@redhat.com>

* Default Temurin jdk-21+ to use bundled FreeType

Signed-off-by: Andrew Leonard <anleonar@redhat.com>

* Default Temurin jdk-21+ to use bundled FreeType

Signed-off-by: Andrew Leonard <anleonar@redhat.com>

* Default Temurin jdk-21+ to use bundled FreeType

Signed-off-by: Andrew Leonard <anleonar@redhat.com>

* Default Temurin jdk-21+ to use bundled FreeType

Signed-off-by: Andrew Leonard <anleonar@redhat.com>

* Default jdk-21+ to use bundled FreeType

Signed-off-by: Andrew Leonard <anleonar@redhat.com>

---------

Signed-off-by: Andrew Leonard <anleonar@redhat.com>
  • Loading branch information
andrew-m-leonard authored Dec 5, 2023
1 parent 25f518f commit 3a3f4ac
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ jobs:
- name: Build macOS
run: |
export JAVA_HOME=$JAVA_HOME_11_X64
# Skip freetype build on jdk11+
# jdk11u+ uses two part exploded & assemble build
if [ ${{ matrix.version.name }} != "jdk8u" ]; then
export BUILD_ARGS="--skip-freetype --make-exploded-image --create-sbom"
export BUILD_ARGS="--make-exploded-image --create-sbom"
./build-farm/make-adopt-build-farm.sh
export BUILD_ARGS="--assemble-exploded-image --create-sbom"
./build-farm/make-adopt-build-farm.sh
Expand Down
9 changes: 7 additions & 2 deletions build-farm/platform-specific-configurations/aix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,17 @@ then
export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --with-extra-ldflags=-lpthread --with-extra-cflags=-lpthread --with-extra-cxxflags=-lpthread"
fi

export BUILD_ARGS="${BUILD_ARGS} --skip-freetype"
if [[ "$JAVA_FEATURE_VERSION" -ge 21 ]]; then
# jdk-21+ uses "bundled" FreeType
export BUILD_ARGS="${BUILD_ARGS} --freetype-dir bundled"
else
export BUILD_ARGS="${BUILD_ARGS} --skip-freetype"
fi

if [ "${VARIANT}" == "${BUILD_VARIANT_OPENJ9}" ]; then
export LDR_CNTRL=MAXDATA=0x80000000
fi
echo LDR_CNTRL=$LDR_CNTRL
echo LDR_CNTRL="$LDR_CNTRL"

BOOT_JDK_VARIABLE="JDK${JDK_BOOT_VERSION}_BOOT_DIR"
if [ ! -d "$(eval echo "\$$BOOT_JDK_VARIABLE")" ]; then
Expand Down
9 changes: 7 additions & 2 deletions build-farm/platform-specific-configurations/alpine-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,13 @@ fi
# ccache seems flaky on alpine
export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --disable-ccache"

# We don't bundle freetype on alpine anymore, and expect the user to have it.
export BUILD_ARGS="${BUILD_ARGS} --skip-freetype"
if [[ "$JAVA_FEATURE_VERSION" -ge 21 ]]; then
# jdk-21+ uses "bundled" FreeType
export BUILD_ARGS="${BUILD_ARGS} --freetype-dir bundled"
else
# We don't bundle freetype on alpine anymore, and expect the user to have it.
export BUILD_ARGS="${BUILD_ARGS} --skip-freetype"
fi

BOOT_JDK_VARIABLE="JDK${JDK_BOOT_VERSION}_BOOT_DIR"
if [ ! -d "$(eval echo "\$$BOOT_JDK_VARIABLE")" ]; then
Expand Down
10 changes: 8 additions & 2 deletions build-farm/platform-specific-configurations/linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,14 @@
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# shellcheck source=sbin/common/constants.sh
source "$SCRIPT_DIR/../../sbin/common/constants.sh"
# Bundling our own freetype can cause problems, so we skip that on linux.
export BUILD_ARGS="${BUILD_ARGS} --skip-freetype"

if [[ "$JAVA_FEATURE_VERSION" -ge 21 ]]; then
# jdk-21+ uses "bundled" FreeType
export BUILD_ARGS="${BUILD_ARGS} --freetype-dir bundled"
else
# Bundling our own freetype can cause problems, so we skip that on linux.
export BUILD_ARGS="${BUILD_ARGS} --skip-freetype"
fi

NATIVE_API_ARCH=$(uname -m)
if [ "${NATIVE_API_ARCH}" = "x86_64" ]; then NATIVE_API_ARCH=x64; fi
Expand Down
5 changes: 5 additions & 0 deletions build-farm/platform-specific-configurations/mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ else
fi
fi

if [[ "$JAVA_FEATURE_VERSION" -ge 21 ]]; then
# jdk-21+ uses "bundled" FreeType
export BUILD_ARGS="${BUILD_ARGS} --freetype-dir bundled"
fi

# The configure option '--with-macosx-codesign-identity' is supported in JDK8 OpenJ9 and JDK11 and JDK14+
if [[ ( "$JAVA_FEATURE_VERSION" -eq 11 ) || ( "$JAVA_FEATURE_VERSION" -ge 14 ) ]]
then
Expand Down
5 changes: 5 additions & 0 deletions build-farm/platform-specific-configurations/windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,11 @@ then
fi
fi

if [[ "$JAVA_FEATURE_VERSION" -ge 21 ]]; then
# jdk-21+ uses "bundled" FreeType
export BUILD_ARGS="${BUILD_ARGS} --freetype-dir bundled"
fi

if [ "${ARCHITECTURE}" == "aarch64" ]; then
export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --disable-ccache --openjdk-target=aarch64-unknown-cygwin"
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@ public void freetypeOnlyBundledOnCertainPlatforms() throws IOException {
.filter(name -> freetypePattern.matcher(name).matches())
.collect(Collectors.toSet());

if (jdkPlatform.runsOn(OperatingSystem.MACOS)) {
if (jdkVersion.isNewerOrEqual(21)) {
// jdk-21+ uses "bundled" FreeType
assertTrue(freetypeFiles.size() > 0,
"Expected libfreetype.dylib to be bundled but it is not.");
} else if (jdkPlatform.runsOn(OperatingSystem.MACOS)) {
assertTrue(freetypeFiles.size() > 0,
"Expected libfreetype.dylib to be bundled but it is not.");
} else if (jdkPlatform.runsOn(OperatingSystem.WINDOWS)) {
Expand Down

0 comments on commit 3a3f4ac

Please sign in to comment.