From 3885622b224bdc31b13aed3ab07f50e08cb112b8 Mon Sep 17 00:00:00 2001 From: George Adams Date: Tue, 20 Dec 2022 12:18:05 +0000 Subject: [PATCH 1/7] switch freetype to clone source from GitHub --- sbin/prepareWorkspace.sh | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/sbin/prepareWorkspace.sh b/sbin/prepareWorkspace.sh index fa8e3e633..f7b6ffd5e 100644 --- a/sbin/prepareWorkspace.sh +++ b/sbin/prepareWorkspace.sh @@ -441,7 +441,7 @@ downloadFile() { fi } -# Get Freetype +# Clone Freetype from GitHub checkingAndDownloadingFreeType() { cd "${BUILD_CONFIG[WORKSPACE_DIR]}/libs/" || exit echo "Checking for freetype at ${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[WORKING_DIR]}" @@ -452,16 +452,14 @@ checkingAndDownloadingFreeType() { if [[ -n "$FOUND_FREETYPE" ]]; then echo "Skipping FreeType download" else - downloadFile "freetype.tar.gz" "https://ci.adoptopenjdk.net/userContent/freetype/freetype-${BUILD_CONFIG[FREETYPE_FONT_VERSION]}.tar.gz" - downloadFile "freetype.tar.gz.sig" "https://ci.adoptopenjdk.net/userContent/freetype/freetype-${BUILD_CONFIG[FREETYPE_FONT_VERSION]}.tar.gz.sig" - checkFingerprint "freetype.tar.gz.sig" "freetype.tar.gz" "freetype" "58E0 C111 E39F 5408 C5D3 EC76 C1A6 0EAC E707 FDA5" "${FREETYPE_LIB_CHECKSUM}" - - FREETYPE_BUILD_INFO="https://ci.adoptopenjdk.net/userContent/freetype/freetype-${BUILD_CONFIG[FREETYPE_FONT_VERSION]}.tar.gz" - - rm -rf "./freetype" || true - mkdir -p "freetype" || true - tar xpzf freetype.tar.gz --strip-components=1 -C "freetype" - rm freetype.tar.gz + # Replace . with - in version number e.g 2.8.1 -> 2-8-1 + FREETYPE_BRANCH="VER-${BUILD_CONFIG[FREETYPE_FONT_VERSION]//./-}" + git clone https://github.com/freetype/freetype.git -b $FREETYPE_BRANCH freetype || exit + + # Fetch the sha for the commit we just cloned + cd freetype || exit + FREETYPE_SHA=$(git rev-parse HEAD) + FREETYPE_BUILD_INFO="https://github.com/freetype/freetype/commit/${FREETYPE_SHA}" if [[ "$OSTYPE" == "cygwin" ]] || [[ "$OSTYPE" == "msys" ]]; then # Record buildinfo version From 61339abd381b2b5a5d2cfb57ceeeb580134e614f Mon Sep 17 00:00:00 2001 From: George Adams Date: Tue, 20 Dec 2022 12:28:16 +0000 Subject: [PATCH 2/7] remove duplicate cd --- sbin/prepareWorkspace.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sbin/prepareWorkspace.sh b/sbin/prepareWorkspace.sh index f7b6ffd5e..a97d1a21f 100644 --- a/sbin/prepareWorkspace.sh +++ b/sbin/prepareWorkspace.sh @@ -458,7 +458,7 @@ checkingAndDownloadingFreeType() { # Fetch the sha for the commit we just cloned cd freetype || exit - FREETYPE_SHA=$(git rev-parse HEAD) + FREETYPE_SHA=$(git rev-parse HEAD) || exit FREETYPE_BUILD_INFO="https://github.com/freetype/freetype/commit/${FREETYPE_SHA}" if [[ "$OSTYPE" == "cygwin" ]] || [[ "$OSTYPE" == "msys" ]]; then @@ -467,8 +467,6 @@ checkingAndDownloadingFreeType() { return fi - cd freetype || exit - local pngArg="" if ./configure --help | grep "with-png"; then pngArg="--with-png=no" From 6b636ed77b010464f553ba9030e220cc4b400d03 Mon Sep 17 00:00:00 2001 From: George Adams Date: Tue, 20 Dec 2022 12:49:07 +0000 Subject: [PATCH 3/7] add autogen step for freetype: --- sbin/prepareWorkspace.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/prepareWorkspace.sh b/sbin/prepareWorkspace.sh index a97d1a21f..445649f20 100644 --- a/sbin/prepareWorkspace.sh +++ b/sbin/prepareWorkspace.sh @@ -454,7 +454,7 @@ checkingAndDownloadingFreeType() { else # Replace . with - in version number e.g 2.8.1 -> 2-8-1 FREETYPE_BRANCH="VER-${BUILD_CONFIG[FREETYPE_FONT_VERSION]//./-}" - git clone https://github.com/freetype/freetype.git -b $FREETYPE_BRANCH freetype || exit + git clone https://github.com/freetype/freetype.git -b "${FREETYPE_BRANCH}" freetype || exit # Fetch the sha for the commit we just cloned cd freetype || exit @@ -479,7 +479,7 @@ checkingAndDownloadingFreeType() { # We get the files we need at $WORKING_DIR/installedfreetype # shellcheck disable=SC2046 - if ! (eval "${freetypeEnv}" && bash ./configure --prefix="${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[WORKING_DIR]}"/installedfreetype "${pngArg}" "${BUILD_CONFIG[FREETYPE_FONT_BUILD_TYPE_PARAM]}" && ${BUILD_CONFIG[MAKE_COMMAND_NAME]} all && ${BUILD_CONFIG[MAKE_COMMAND_NAME]} install); then + if ! (eval "${freetypeEnv}" && bash ./autogen.sh && bash ./configure --prefix="${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[WORKING_DIR]}"/installedfreetype "${pngArg}" "${BUILD_CONFIG[FREETYPE_FONT_BUILD_TYPE_PARAM]}" && ${BUILD_CONFIG[MAKE_COMMAND_NAME]} all && ${BUILD_CONFIG[MAKE_COMMAND_NAME]} install); then # shellcheck disable=SC2154 echo "Failed to configure and build libfreetype, exiting" exit From 6e8b599704ac1d685fbf70b0f1f0aa826e4d0c00 Mon Sep 17 00:00:00 2001 From: George Adams Date: Tue, 20 Dec 2022 12:51:55 +0000 Subject: [PATCH 4/7] install automake --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dcac3acc0..eae06f961 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -122,7 +122,7 @@ jobs: - name: Install Dependencies run: | - brew install bash binutils freetype gnu-sed nasm + brew install automake bash binutils freetype gnu-sed nasm - uses: actions/setup-java@1df8dbefe2a8cbc99770194893dd902763bee34b # v3.9.0 id: setup-java From ef5f816085e4411e66cf2f873e2208cfab327ff3 Mon Sep 17 00:00:00 2001 From: George Adams Date: Tue, 20 Dec 2022 18:05:31 +0000 Subject: [PATCH 5/7] remove existing dir if it exists --- sbin/prepareWorkspace.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sbin/prepareWorkspace.sh b/sbin/prepareWorkspace.sh index 445649f20..67b0f7a25 100644 --- a/sbin/prepareWorkspace.sh +++ b/sbin/prepareWorkspace.sh @@ -452,6 +452,9 @@ checkingAndDownloadingFreeType() { if [[ -n "$FOUND_FREETYPE" ]]; then echo "Skipping FreeType download" else + # Delete existing freetype folder if it exists + rm -rf "./freetype" || true + # Replace . with - in version number e.g 2.8.1 -> 2-8-1 FREETYPE_BRANCH="VER-${BUILD_CONFIG[FREETYPE_FONT_VERSION]//./-}" git clone https://github.com/freetype/freetype.git -b "${FREETYPE_BRANCH}" freetype || exit From 39835852815d8cd89e22edb235474aba0be7e595 Mon Sep 17 00:00:00 2001 From: George Adams Date: Thu, 22 Dec 2022 10:50:45 +0000 Subject: [PATCH 6/7] remove FREETYPE_LIB_CHECKSUM --- sbin/prepareWorkspace.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/sbin/prepareWorkspace.sh b/sbin/prepareWorkspace.sh index 67b0f7a25..1783b7454 100644 --- a/sbin/prepareWorkspace.sh +++ b/sbin/prepareWorkspace.sh @@ -35,7 +35,6 @@ source "$SCRIPT_DIR/common/constants.sh" ALSA_LIB_VERSION=${ALSA_LIB_VERSION:-1.1.6} ALSA_LIB_CHECKSUM=${ALSA_LIB_CHECKSUM:-5f2cd274b272cae0d0d111e8a9e363f08783329157e8dd68b3de0c096de6d724} FREEMARKER_LIB_CHECKSUM=${FREEMARKER_LIB_CHECKSUM:-8723ec9ffe006e8d376b6c7dbe7950db34ad1fa163aef4026e6477151a1a0deb} -FREETYPE_LIB_CHECKSUM=${FREETYPE_LIB_CHECKSUM:-ec391504e55498adceb30baceebd147a6e963f636eb617424bcfc47a169898ce} FREETYPE_FONT_SHARED_OBJECT_FILENAME="libfreetype.so*" FREEMARKER_LIB_VERSION=${FREEMARKER_LIB_VERSION:-2.3.31} From 736757a6b357a51a40ace6c985aedce8f5999fae Mon Sep 17 00:00:00 2001 From: George Adams Date: Sat, 24 Dec 2022 10:16:12 +0000 Subject: [PATCH 7/7] pin freetype version using shasum --- .../platform-specific-configurations/windows.sh | 2 +- sbin/common/config_init.sh | 2 +- sbin/prepareWorkspace.sh | 17 ++++++++++++++--- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/build-farm/platform-specific-configurations/windows.sh b/build-farm/platform-specific-configurations/windows.sh index 6feed27e3..8354c3f49 100755 --- a/build-farm/platform-specific-configurations/windows.sh +++ b/build-farm/platform-specific-configurations/windows.sh @@ -206,7 +206,7 @@ then export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --disable-ccache" if [ "${JAVA_TO_BUILD}" == "${JDK8_VERSION}" ] then - export BUILD_ARGS="${BUILD_ARGS} --freetype-version 2.8.1" + export BUILD_ARGS="${BUILD_ARGS} --freetype-version 39ce3ac499d4cd7371031a062f410953c8ecce29" # 2.8.1 export PATH="/cygdrive/c/openjdk/make-3.82/:$PATH" elif [ "$JAVA_FEATURE_VERSION" -ge 11 ] then diff --git a/sbin/common/config_init.sh b/sbin/common/config_init.sh index 83e4db5a3..eb8a86f05 100755 --- a/sbin/common/config_init.sh +++ b/sbin/common/config_init.sh @@ -458,7 +458,7 @@ function configDefaults() { BUILD_CONFIG[COPY_MACOSX_FREE_FONT_LIB_FOR_JRE_FLAG]="false" BUILD_CONFIG[FREETYPE]=true BUILD_CONFIG[FREETYPE_DIRECTORY]="" - BUILD_CONFIG[FREETYPE_FONT_VERSION]="2.9.1" + BUILD_CONFIG[FREETYPE_FONT_VERSION]="86bc8a95056c97a810986434a3f268cbe67f2902" # 2.9.1 BUILD_CONFIG[FREETYPE_FONT_BUILD_TYPE_PARAM]="" case "${BUILD_CONFIG[OS_KERNEL_NAME]}" in diff --git a/sbin/prepareWorkspace.sh b/sbin/prepareWorkspace.sh index 1783b7454..533bd2a0e 100644 --- a/sbin/prepareWorkspace.sh +++ b/sbin/prepareWorkspace.sh @@ -454,9 +454,20 @@ checkingAndDownloadingFreeType() { # Delete existing freetype folder if it exists rm -rf "./freetype" || true - # Replace . with - in version number e.g 2.8.1 -> 2-8-1 - FREETYPE_BRANCH="VER-${BUILD_CONFIG[FREETYPE_FONT_VERSION]//./-}" - git clone https://github.com/freetype/freetype.git -b "${FREETYPE_BRANCH}" freetype || exit + case ${BUILD_CONFIG[FREETYPE_FONT_VERSION]} in + *.*) + # Replace . with - in version number e.g 2.8.1 -> 2-8-1 + FREETYPE_BRANCH="VER-${BUILD_CONFIG[FREETYPE_FONT_VERSION]//./-}" + git clone https://github.com/freetype/freetype.git -b "${FREETYPE_BRANCH}" freetype || exit + ;; + *) + # Use specific git hash + git clone https://github.com/freetype/freetype.git freetype || exit + cd freetype || exit + git checkout "${BUILD_CONFIG[FREETYPE_FONT_VERSION]}" || exit + cd .. || exit + ;; + esac # Fetch the sha for the commit we just cloned cd freetype || exit