From ac5ed0a7c70e2490108c129d53273f2f2ae3f603 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Mon, 27 Oct 2025 11:15:10 +0100 Subject: [PATCH 01/13] Initial minimalistic adaptation of 8 to build with in-tree freetype --- sbin/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/build.sh b/sbin/build.sh index 3d658d5a5..cf541a09a 100755 --- a/sbin/build.sh +++ b/sbin/build.sh @@ -554,12 +554,12 @@ configureFreetypeLocation() { local freetypeDir="${BUILD_CONFIG[FREETYPE_DIRECTORY]}" if [[ "$OSTYPE" == "cygwin" ]] || [[ "$OSTYPE" == "msys" ]]; then case "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" in - jdk8* | jdk9* | jdk10*) addConfigureArg "--with-freetype-src=" "${BUILD_CONFIG[WORKSPACE_DIR]}/libs/freetype" ;; + jdk9* | jdk10*) addConfigureArg "--with-freetype-src=" "${BUILD_CONFIG[WORKSPACE_DIR]}/libs/freetype" ;; *) freetypeDir=${BUILD_CONFIG[FREETYPE_DIRECTORY]:-bundled} ;; esac else case "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" in - jdk8* | jdk9* | jdk10*) freetypeDir=${BUILD_CONFIG[FREETYPE_DIRECTORY]:-"${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[WORKING_DIR]}/installedfreetype"} ;; + jdk9* | jdk10*) freetypeDir=${BUILD_CONFIG[FREETYPE_DIRECTORY]:-"${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[WORKING_DIR]}/installedfreetype"} ;; *) freetypeDir=${BUILD_CONFIG[FREETYPE_DIRECTORY]:-bundled} ;; esac fi From aecbf095634bb4a7ee93529ac7d7b7b5a2adce9a Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Wed, 5 Nov 2025 11:51:03 +0100 Subject: [PATCH 02/13] Determining free type absed on jdk's 8 tag the if is to long, will refactor --- sbin/build.sh | 63 +++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 58 insertions(+), 5 deletions(-) diff --git a/sbin/build.sh b/sbin/build.sh index cf541a09a..ba1709f3f 100755 --- a/sbin/build.sh +++ b/sbin/build.sh @@ -548,22 +548,75 @@ configureAlsaLocation() { fi } +setFreeTypePerJdk8Tag() { + if [ -n "${BUILD_CONFIG[TAG]}" ]; then + local majorBuildVersion=$(echo "${BUILD_CONFIG[TAG]}" | sed "s/jdk8u//" | sed "s/-.*//") + if [ 0${majorBuildVersion} -lt 482 ] ; then + if [ "${1}" == "srcs" ] ; then + setFreeTypeFromSrcs + elif [ "${1}" == "installed" ] ; then + setFreeTypeFromInstalled + else + echo "invalid parameter $1" + exit 1 + fi + elif [ 0${majorBuildVersion} -gt 482 ] ; then + setDefaultFreeType + else + # the change was introduces in 482, lets determine the build promotion, and decide + local minorBuildNumber=$(echo "${BUILD_CONFIG[TAG]}" | sed "s/.*-//" | sed "s/[^0-9]//g") + # if the number is empty, is probably ga, so ok to use newest + if [ "x${minorBuildNumber}" = "x" ] || [ 0${minorBuildNumber} -ge 01 ] ; then #FIXME, replace by real b's number once merged + setDefaultFreeType + else + if [ "${1}" == "srcs" ] ; then + setFreeTypeFromSrcs + elif [ "${1}" == "installed" ] ; then + setFreeTypeFromInstalled + else + echo "invalid parameter $1" + exit 1 + fi + fi + fi + else + # no tag, treating as newest, so bundled + setDefaultFreeType + fi +} + +setDefaultFreeType() { + echo "Freetype set from bundled in jdk" + freetypeDir=${BUILD_CONFIG[FREETYPE_DIRECTORY]:-bundled} +} + +setFreeTypeFromSrcs() { + echo "Freetype set from local sources" + addConfigureArg "--with-freetype-src=" "${BUILD_CONFIG[WORKSPACE_DIR]}/libs/freetype" +} + +setFreeTypeFromInstalled() { + echo "Freetype set from installed binary" + freetypeDir=${BUILD_CONFIG[FREETYPE_DIRECTORY]:-"${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[WORKING_DIR]}/installedfreetype"} +} + configureFreetypeLocation() { if [[ ! "${CONFIGURE_ARGS}" =~ "--with-freetype" ]]; then if [[ "${BUILD_CONFIG[FREETYPE]}" == "true" ]]; then local freetypeDir="${BUILD_CONFIG[FREETYPE_DIRECTORY]}" if [[ "$OSTYPE" == "cygwin" ]] || [[ "$OSTYPE" == "msys" ]]; then case "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" in - jdk9* | jdk10*) addConfigureArg "--with-freetype-src=" "${BUILD_CONFIG[WORKSPACE_DIR]}/libs/freetype" ;; - *) freetypeDir=${BUILD_CONFIG[FREETYPE_DIRECTORY]:-bundled} ;; + jdk9* | jdk10*) setFreeTypeFromSrcs;; + jdk8*) setFreeTypePerJdk8Tag srcs;; + *) setDefaultFreeType ;; esac else case "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" in - jdk9* | jdk10*) freetypeDir=${BUILD_CONFIG[FREETYPE_DIRECTORY]:-"${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[WORKING_DIR]}/installedfreetype"} ;; - *) freetypeDir=${BUILD_CONFIG[FREETYPE_DIRECTORY]:-bundled} ;; + jdk9* | jdk10*) setFreeTypeFromInstalled;; + jdk8*) setFreeTypePerJdk8Tag installed;; + *) setDefaultFreeType ;; esac fi - if [[ -n "$freetypeDir" ]]; then echo "setting freetype dir to ${freetypeDir}" addConfigureArg "--with-freetype=" "${freetypeDir}" From ee63d3974862230a17794bd8f149c508d2d67893 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Wed, 5 Nov 2025 12:03:33 +0100 Subject: [PATCH 03/13] Simplified the condition --- sbin/build.sh | 46 ++++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/sbin/build.sh b/sbin/build.sh index ba1709f3f..9d8466373 100755 --- a/sbin/build.sh +++ b/sbin/build.sh @@ -548,39 +548,41 @@ configureAlsaLocation() { fi } -setFreeTypePerJdk8Tag() { +getFreeTypePerJdk8Tag() { if [ -n "${BUILD_CONFIG[TAG]}" ]; then local majorBuildVersion=$(echo "${BUILD_CONFIG[TAG]}" | sed "s/jdk8u//" | sed "s/-.*//") - if [ 0${majorBuildVersion} -lt 482 ] ; then - if [ "${1}" == "srcs" ] ; then - setFreeTypeFromSrcs - elif [ "${1}" == "installed" ] ; then - setFreeTypeFromInstalled - else - echo "invalid parameter $1" - exit 1 - fi + if [ 0${majorBuildVersion} -lt 482 ] ; then + echo "old" elif [ 0${majorBuildVersion} -gt 482 ] ; then - setDefaultFreeType + echo "new" else # the change was introduces in 482, lets determine the build promotion, and decide local minorBuildNumber=$(echo "${BUILD_CONFIG[TAG]}" | sed "s/.*-//" | sed "s/[^0-9]//g") # if the number is empty, is probably ga, so ok to use newest - if [ "x${minorBuildNumber}" = "x" ] || [ 0${minorBuildNumber} -ge 01 ] ; then #FIXME, replace by real b's number once merged - setDefaultFreeType + if [ -z "${minorBuildNumber}" ] || [ 0${minorBuildNumber} -ge 01 ] ; then #FIXME, replace by real b's number once merged + echo "new" else - if [ "${1}" == "srcs" ] ; then - setFreeTypeFromSrcs - elif [ "${1}" == "installed" ] ; then - setFreeTypeFromInstalled - else - echo "invalid parameter $1" - exit 1 - fi + echo "old" fi fi else - # no tag, treating as newest, so bundled + # no tag, treating as newest + echo "new" + fi +} + +setFreeTypePerJdk8Tag() { + local jdk8Type="$(getFreeTypePerJdk8Tag)" + if [ "${jdk8Type}" = "old" ] ; then + if [ "${1}" = "srcs" ] ; then + setFreeTypeFromSrcs + elif [ "${1}" = "installed" ] ; then + setFreeTypeFromInstalled + else + echo "invalid parameter $1" + exit 1 + fi + else setDefaultFreeType fi } From a3adb91b195deb0039c8f1555ac0400132af9465 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Thu, 13 Nov 2025 11:57:56 +0100 Subject: [PATCH 04/13] The in-tree freetype will appear in 482-b02 --- sbin/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/build.sh b/sbin/build.sh index 9d8466373..7c12b8bb7 100755 --- a/sbin/build.sh +++ b/sbin/build.sh @@ -559,7 +559,7 @@ getFreeTypePerJdk8Tag() { # the change was introduces in 482, lets determine the build promotion, and decide local minorBuildNumber=$(echo "${BUILD_CONFIG[TAG]}" | sed "s/.*-//" | sed "s/[^0-9]//g") # if the number is empty, is probably ga, so ok to use newest - if [ -z "${minorBuildNumber}" ] || [ 0${minorBuildNumber} -ge 01 ] ; then #FIXME, replace by real b's number once merged + if [ -z "${minorBuildNumber}" ] || [ 0${minorBuildNumber} -ge 02 ] ; then echo "new" else echo "old" From c6c180f6a015113395a03ee2a2878ccb20b484ef Mon Sep 17 00:00:00 2001 From: judovana Date: Mon, 17 Nov 2025 10:45:48 +0100 Subject: [PATCH 05/13] Update sbin/build.sh Co-authored-by: Martijn Verburg --- sbin/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/build.sh b/sbin/build.sh index 7c12b8bb7..528f7b5d9 100755 --- a/sbin/build.sh +++ b/sbin/build.sh @@ -556,7 +556,7 @@ getFreeTypePerJdk8Tag() { elif [ 0${majorBuildVersion} -gt 482 ] ; then echo "new" else - # the change was introduces in 482, lets determine the build promotion, and decide + # The change was introduced in 482, lets determine the build number, and decide local minorBuildNumber=$(echo "${BUILD_CONFIG[TAG]}" | sed "s/.*-//" | sed "s/[^0-9]//g") # if the number is empty, is probably ga, so ok to use newest if [ -z "${minorBuildNumber}" ] || [ 0${minorBuildNumber} -ge 02 ] ; then From 71b30ac059cf9bc08ebcc8bff1784464b5f3cfda Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Tue, 25 Nov 2025 13:03:43 +0100 Subject: [PATCH 06/13] No longer building freetype if it exists in sources --- sbin/build.sh | 57 +++++----------------------------------- sbin/prepareWorkspace.sh | 28 +++++++++++++++----- 2 files changed, 29 insertions(+), 56 deletions(-) diff --git a/sbin/build.sh b/sbin/build.sh index 528f7b5d9..19e0c57e2 100755 --- a/sbin/build.sh +++ b/sbin/build.sh @@ -548,45 +548,6 @@ configureAlsaLocation() { fi } -getFreeTypePerJdk8Tag() { - if [ -n "${BUILD_CONFIG[TAG]}" ]; then - local majorBuildVersion=$(echo "${BUILD_CONFIG[TAG]}" | sed "s/jdk8u//" | sed "s/-.*//") - if [ 0${majorBuildVersion} -lt 482 ] ; then - echo "old" - elif [ 0${majorBuildVersion} -gt 482 ] ; then - echo "new" - else - # The change was introduced in 482, lets determine the build number, and decide - local minorBuildNumber=$(echo "${BUILD_CONFIG[TAG]}" | sed "s/.*-//" | sed "s/[^0-9]//g") - # if the number is empty, is probably ga, so ok to use newest - if [ -z "${minorBuildNumber}" ] || [ 0${minorBuildNumber} -ge 02 ] ; then - echo "new" - else - echo "old" - fi - fi - else - # no tag, treating as newest - echo "new" - fi -} - -setFreeTypePerJdk8Tag() { - local jdk8Type="$(getFreeTypePerJdk8Tag)" - if [ "${jdk8Type}" = "old" ] ; then - if [ "${1}" = "srcs" ] ; then - setFreeTypeFromSrcs - elif [ "${1}" = "installed" ] ; then - setFreeTypeFromInstalled - else - echo "invalid parameter $1" - exit 1 - fi - else - setDefaultFreeType - fi -} - setDefaultFreeType() { echo "Freetype set from bundled in jdk" freetypeDir=${BUILD_CONFIG[FREETYPE_DIRECTORY]:-bundled} @@ -606,18 +567,14 @@ configureFreetypeLocation() { if [[ ! "${CONFIGURE_ARGS}" =~ "--with-freetype" ]]; then if [[ "${BUILD_CONFIG[FREETYPE]}" == "true" ]]; then local freetypeDir="${BUILD_CONFIG[FREETYPE_DIRECTORY]}" - if [[ "$OSTYPE" == "cygwin" ]] || [[ "$OSTYPE" == "msys" ]]; then - case "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" in - jdk9* | jdk10*) setFreeTypeFromSrcs;; - jdk8*) setFreeTypePerJdk8Tag srcs;; - *) setDefaultFreeType ;; - esac + if isFreeTypeInSources "." ; then + setDefaultFreeType else - case "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" in - jdk9* | jdk10*) setFreeTypeFromInstalled;; - jdk8*) setFreeTypePerJdk8Tag installed;; - *) setDefaultFreeType ;; - esac + if [[ "$OSTYPE" == "cygwin" ]] || [[ "$OSTYPE" == "msys" ]]; then + setFreeTypeFromSrcs + else + setFreeTypeFromInstalled + fi fi if [[ -n "$freetypeDir" ]]; then echo "setting freetype dir to ${freetypeDir}" diff --git a/sbin/prepareWorkspace.sh b/sbin/prepareWorkspace.sh index 0ec31be03..64ee5daa3 100644 --- a/sbin/prepareWorkspace.sh +++ b/sbin/prepareWorkspace.sh @@ -40,6 +40,23 @@ FREETYPE_FONT_SHARED_OBJECT_FILENAME="libfreetype.so*" # sha256 of https://github.com/adoptium/devkit-binaries/releases/tag/vs2022_redist_14.40.33807_10.0.26100.1742 WINDOWS_REDIST_CHECKSUM="ac6060f5f8a952f59faef20e53d124c2c267264109f3f6fabeb2b7aefb3e3c62" +isFreeTypeInSources() { + local libfreetypeid="libfreetype/src" + local location="$1/build/src" + if [ ! -e "$location" ] ; then + echo "No jdk found to determine $libfreetypeid presence" + exit 1 + fi + find "$location" | grep -q "$libfreetypeid" + local found=$? + if [ $found -eq 0 ] ; then + echo "$libfreetypeid found in $(pwd): $location" + else + echo "$libfreetypeid not found in $(pwd): $location" + fi + return $found +} + copyFromDir() { echo "Copying OpenJDK source from ${BUILD_CONFIG[OPENJDK_LOCAL_SOURCE_ARCHIVE_ABSPATH]} to $(pwd)/${BUILD_CONFIG[OPENJDK_SOURCE_DIR]} to be built" # We really do not want to use .git for dirs, as we expect user have them set up, ignoring them @@ -850,8 +867,7 @@ downloadingRequiredDependencies() { fi if [[ "${BUILD_CONFIG[FREETYPE]}" == "true" ]]; then - case "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" in - jdk8* | jdk9* | jdk10*) + if ! isFreeTypeInSources ".." ; then if [ -z "${BUILD_CONFIG[FREETYPE_DIRECTORY]}" ]; then echo "Checking and download FreeType Font dependency" checkingAndDownloadingFreeType @@ -860,9 +876,9 @@ downloadingRequiredDependencies() { echo "---> Skipping the process of checking and downloading the FreeType Font dependency, a pre-built version provided at ${BUILD_CONFIG[FREETYPE_DIRECTORY]} <---" echo "" fi - ;; - *) echo "Using bundled Freetype" ;; - esac + else + echo "Using bundled Freetype" + fi else echo "Skipping Freetype" fi @@ -947,10 +963,10 @@ createSourceTagFile(){ function configureWorkspace() { if [[ "${BUILD_CONFIG[ASSEMBLE_EXPLODED_IMAGE]}" != "true" ]]; then createWorkspace + checkoutAndCloneOpenJDKGitRepo downloadingRequiredDependencies downloadDevkit relocateToTmpIfNeeded - checkoutAndCloneOpenJDKGitRepo applyPatches if [ "${BUILD_CONFIG[CUSTOM_CACERTS]}" = "true" ] ; then prepareMozillaCacerts From 8fa10431e83b15e5a3b97d8535ef5e7c7498fbba Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Tue, 25 Nov 2025 13:03:45 +0100 Subject: [PATCH 07/13] Get rid of relative path --- sbin/build.sh | 2 +- sbin/prepareWorkspace.sh | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sbin/build.sh b/sbin/build.sh index 19e0c57e2..61f90cd7b 100755 --- a/sbin/build.sh +++ b/sbin/build.sh @@ -567,7 +567,7 @@ configureFreetypeLocation() { if [[ ! "${CONFIGURE_ARGS}" =~ "--with-freetype" ]]; then if [[ "${BUILD_CONFIG[FREETYPE]}" == "true" ]]; then local freetypeDir="${BUILD_CONFIG[FREETYPE_DIRECTORY]}" - if isFreeTypeInSources "." ; then + if isFreeTypeInSources ; then setDefaultFreeType else if [[ "$OSTYPE" == "cygwin" ]] || [[ "$OSTYPE" == "msys" ]]; then diff --git a/sbin/prepareWorkspace.sh b/sbin/prepareWorkspace.sh index 64ee5daa3..c836eed9f 100644 --- a/sbin/prepareWorkspace.sh +++ b/sbin/prepareWorkspace.sh @@ -42,17 +42,17 @@ WINDOWS_REDIST_CHECKSUM="ac6060f5f8a952f59faef20e53d124c2c267264109f3f6fabeb2b7a isFreeTypeInSources() { local libfreetypeid="libfreetype/src" - local location="$1/build/src" + local location="${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[WORKING_DIR]}/${BUILD_CONFIG[OPENJDK_SOURCE_DIR]}" if [ ! -e "$location" ] ; then - echo "No jdk found to determine $libfreetypeid presence" + echo "No jdk sources exists to to determine $libfreetypeid presence" exit 1 fi find "$location" | grep -q "$libfreetypeid" local found=$? if [ $found -eq 0 ] ; then - echo "$libfreetypeid found in $(pwd): $location" + echo "$libfreetypeid found in $location" else - echo "$libfreetypeid not found in $(pwd): $location" + echo "$libfreetypeid not found in $location" fi return $found } @@ -867,7 +867,7 @@ downloadingRequiredDependencies() { fi if [[ "${BUILD_CONFIG[FREETYPE]}" == "true" ]]; then - if ! isFreeTypeInSources ".." ; then + if ! isFreeTypeInSources ; then if [ -z "${BUILD_CONFIG[FREETYPE_DIRECTORY]}" ]; then echo "Checking and download FreeType Font dependency" checkingAndDownloadingFreeType From 4dee09505328b20f69b8489ae54d79f92b9af2b0 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Tue, 25 Nov 2025 13:03:47 +0100 Subject: [PATCH 08/13] Aligned modified block to two spaces --- sbin/prepareWorkspace.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/sbin/prepareWorkspace.sh b/sbin/prepareWorkspace.sh index c836eed9f..e067cdc95 100644 --- a/sbin/prepareWorkspace.sh +++ b/sbin/prepareWorkspace.sh @@ -867,18 +867,18 @@ downloadingRequiredDependencies() { fi if [[ "${BUILD_CONFIG[FREETYPE]}" == "true" ]]; then - if ! isFreeTypeInSources ; then - if [ -z "${BUILD_CONFIG[FREETYPE_DIRECTORY]}" ]; then - echo "Checking and download FreeType Font dependency" - checkingAndDownloadingFreeType - else - echo "" - echo "---> Skipping the process of checking and downloading the FreeType Font dependency, a pre-built version provided at ${BUILD_CONFIG[FREETYPE_DIRECTORY]} <---" - echo "" - fi - else - echo "Using bundled Freetype" - fi + if ! isFreeTypeInSources ; then + if [ -z "${BUILD_CONFIG[FREETYPE_DIRECTORY]}" ]; then + echo "Checking and download FreeType Font dependency" + checkingAndDownloadingFreeType + else + echo "" + echo "---> Skipping the process of checking and downloading the FreeType Font dependency, a pre-built version provided at ${BUILD_CONFIG[FREETYPE_DIRECTORY]} <---" + echo "" + fi + else + echo "Using bundled Freetype" + fi else echo "Skipping Freetype" fi From 24726ac988a12e77c06316555e3da8cd84cbefdc Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Thu, 27 Nov 2025 17:56:07 +0100 Subject: [PATCH 09/13] Enforced the freetype switches checks --- sbin/prepareWorkspace.sh | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/sbin/prepareWorkspace.sh b/sbin/prepareWorkspace.sh index e067cdc95..52c2f4a5e 100644 --- a/sbin/prepareWorkspace.sh +++ b/sbin/prepareWorkspace.sh @@ -40,6 +40,29 @@ FREETYPE_FONT_SHARED_OBJECT_FILENAME="libfreetype.so*" # sha256 of https://github.com/adoptium/devkit-binaries/releases/tag/vs2022_redist_14.40.33807_10.0.26100.1742 WINDOWS_REDIST_CHECKSUM="ac6060f5f8a952f59faef20e53d124c2c267264109f3f6fabeb2b7aefb3e3c62" + +checkBundledFreetypeJdkConfig() { + if [ "${BUILD_CONFIG[FREETYPE_DIRECTORY]}" = "bundled" ] ; then + if [ "${BUILD_CONFIG[FREETYPE]}" = "false" ] ; then + echo "--freetype-dir bundled is in contradiction with -skip-freetype" + exit 1 + fi + echo "--freetype-dir is set to bundled that is weird, but accepted. It should be default." + elif [ "${BUILD_CONFIG[FREETYPE_DIRECTORY]}" = "system" ] ; then + echo "--freetype-dir is set to system that is weird, but accepted. Try to use --skip-freetype" + elif [ -n "${BUILD_CONFIG[FREETYPE_DIRECTORY]}" ] ; then + echo "--freetype-dir is not accepted for JDK with bundled freetype." + exit 1 + fi +} + +checkNoBundledFreetypeJdkConfig() { + if [ "${BUILD_CONFIG[FREETYPE]}" = "false" ] && [ -n "${BUILD_CONFIG[FREETYPE_DIRECTORY]}" ] ; then + echo "--freetype-dir is declared together with --skip-freetype, that is invalid, and would build against system freetype" + exit 1 + fi +} + isFreeTypeInSources() { local libfreetypeid="libfreetype/src" local location="${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[WORKING_DIR]}/${BUILD_CONFIG[OPENJDK_SOURCE_DIR]}" @@ -47,12 +70,14 @@ isFreeTypeInSources() { echo "No jdk sources exists to to determine $libfreetypeid presence" exit 1 fi - find "$location" | grep -q "$libfreetypeid" - local found=$? + local found=0 + find "$location" | grep -q "$libfreetypeid" || found=$? if [ $found -eq 0 ] ; then echo "$libfreetypeid found in $location" + checkBundledFreetypeJdkConfig else echo "$libfreetypeid not found in $location" + checkNoBundledFreetypeJdkConfig fi return $found } @@ -841,6 +866,8 @@ downloadBootJdkIfNeeded () { # Download all of the dependencies for OpenJDK (Alsa, FreeType, boot-jdk etc.) downloadingRequiredDependencies() { + local freeTypeInSources=0 + isFreeTypeInSources || freeTypeInSources="$?" if [[ "${BUILD_CONFIG[CLEAN_LIBS]}" == "true" ]]; then rm -rf "${BUILD_CONFIG[WORKSPACE_DIR]}/libs/freetype" || true rm -rf "${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[WORKING_DIR]}/installedalsa" || true @@ -867,7 +894,7 @@ downloadingRequiredDependencies() { fi if [[ "${BUILD_CONFIG[FREETYPE]}" == "true" ]]; then - if ! isFreeTypeInSources ; then + if [ "0${freeTypeInSources}" -ne 0 ] ; then if [ -z "${BUILD_CONFIG[FREETYPE_DIRECTORY]}" ]; then echo "Checking and download FreeType Font dependency" checkingAndDownloadingFreeType From 4118151f01df2648da2dd681856d8aa8067d7a4b Mon Sep 17 00:00:00 2001 From: judovana Date: Tue, 2 Dec 2025 09:37:40 +0100 Subject: [PATCH 10/13] Update sbin/prepareWorkspace.sh Co-authored-by: Martijn Verburg --- sbin/prepareWorkspace.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/prepareWorkspace.sh b/sbin/prepareWorkspace.sh index 52c2f4a5e..788390aa4 100644 --- a/sbin/prepareWorkspace.sh +++ b/sbin/prepareWorkspace.sh @@ -896,7 +896,7 @@ downloadingRequiredDependencies() { if [[ "${BUILD_CONFIG[FREETYPE]}" == "true" ]]; then if [ "0${freeTypeInSources}" -ne 0 ] ; then if [ -z "${BUILD_CONFIG[FREETYPE_DIRECTORY]}" ]; then - echo "Checking and download FreeType Font dependency" + echo "Checking and downloading FreeType Font dependency" checkingAndDownloadingFreeType else echo "" From 1e5b35f8fc89a74481c0edd2f1224507aaa05778 Mon Sep 17 00:00:00 2001 From: judovana Date: Tue, 2 Dec 2025 09:37:59 +0100 Subject: [PATCH 11/13] Update sbin/prepareWorkspace.sh Co-authored-by: Martijn Verburg --- sbin/prepareWorkspace.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/prepareWorkspace.sh b/sbin/prepareWorkspace.sh index 788390aa4..8a8b7c019 100644 --- a/sbin/prepareWorkspace.sh +++ b/sbin/prepareWorkspace.sh @@ -900,7 +900,7 @@ downloadingRequiredDependencies() { checkingAndDownloadingFreeType else echo "" - echo "---> Skipping the process of checking and downloading the FreeType Font dependency, a pre-built version provided at ${BUILD_CONFIG[FREETYPE_DIRECTORY]} <---" + echo "---> Skipping the process of checking and downloading the FreeType Font dependency, a pre-built version is provided at ${BUILD_CONFIG[FREETYPE_DIRECTORY]} <---" echo "" fi else From edc13fdbb558cd2210e027e71b251aea2d3fbc23 Mon Sep 17 00:00:00 2001 From: judovana Date: Tue, 2 Dec 2025 09:40:34 +0100 Subject: [PATCH 12/13] Update sbin/prepareWorkspace.sh Co-authored-by: Martijn Verburg --- sbin/prepareWorkspace.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/prepareWorkspace.sh b/sbin/prepareWorkspace.sh index 8a8b7c019..85212aa00 100644 --- a/sbin/prepareWorkspace.sh +++ b/sbin/prepareWorkspace.sh @@ -49,7 +49,7 @@ checkBundledFreetypeJdkConfig() { fi echo "--freetype-dir is set to bundled that is weird, but accepted. It should be default." elif [ "${BUILD_CONFIG[FREETYPE_DIRECTORY]}" = "system" ] ; then - echo "--freetype-dir is set to system that is weird, but accepted. Try to use --skip-freetype" + echo "--freetype-dir is set to system which is unusual, but accepted. Try to use --skip-freetype" elif [ -n "${BUILD_CONFIG[FREETYPE_DIRECTORY]}" ] ; then echo "--freetype-dir is not accepted for JDK with bundled freetype." exit 1 From 5e63e97c6f8c40fbf5c5c5943c83eec07942907d Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Tue, 2 Dec 2025 10:34:27 +0100 Subject: [PATCH 13/13] Small rephrasing ow errors --- sbin/prepareWorkspace.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sbin/prepareWorkspace.sh b/sbin/prepareWorkspace.sh index 85212aa00..728499eaa 100644 --- a/sbin/prepareWorkspace.sh +++ b/sbin/prepareWorkspace.sh @@ -44,12 +44,12 @@ WINDOWS_REDIST_CHECKSUM="ac6060f5f8a952f59faef20e53d124c2c267264109f3f6fabeb2b7a checkBundledFreetypeJdkConfig() { if [ "${BUILD_CONFIG[FREETYPE_DIRECTORY]}" = "bundled" ] ; then if [ "${BUILD_CONFIG[FREETYPE]}" = "false" ] ; then - echo "--freetype-dir bundled is in contradiction with -skip-freetype" + echo "--freetype-dir 'bundled' is in contradiction with -skip-freetype" exit 1 fi - echo "--freetype-dir is set to bundled that is weird, but accepted. It should be default." + echo "--freetype-dir is set to 'bundled' which is unusual, but accepted. It should be default." elif [ "${BUILD_CONFIG[FREETYPE_DIRECTORY]}" = "system" ] ; then - echo "--freetype-dir is set to system which is unusual, but accepted. Try to use --skip-freetype" + echo "--freetype-dir is set to 'system' which is unusual, but accepted. Use --skip-freetype instead." elif [ -n "${BUILD_CONFIG[FREETYPE_DIRECTORY]}" ] ; then echo "--freetype-dir is not accepted for JDK with bundled freetype." exit 1 @@ -58,7 +58,7 @@ checkBundledFreetypeJdkConfig() { checkNoBundledFreetypeJdkConfig() { if [ "${BUILD_CONFIG[FREETYPE]}" = "false" ] && [ -n "${BUILD_CONFIG[FREETYPE_DIRECTORY]}" ] ; then - echo "--freetype-dir is declared together with --skip-freetype, that is invalid, and would build against system freetype" + echo "--freetype-dir is declared together with --skip-freetype, that is invalid, as JDK would build against system freetype anyway." exit 1 fi }