Skip to content

Commit

Permalink
Remove freemarker options from OpenJ9 builds (#3311)
Browse files Browse the repository at this point in the history
Signed-off-by: Stewart X Addison <[email protected]>
Co-authored-by: Martijn Verburg <[email protected]>
  • Loading branch information
sxa and karianna authored May 8, 2023
1 parent b51db49 commit 1faf3ec
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 54 deletions.
1 change: 0 additions & 1 deletion build-farm/platform-specific-configurations/windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ then
if [ "${JAVA_TO_BUILD}" == "${JDK8_VERSION}" ]
then
export BUILD_ARGS="${BUILD_ARGS} --skip-freetype"
export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --with-freemarker-jar=/cygdrive/c/openjdk/freemarker.jar"
# https://github.com/adoptium/temurin-build/issues/243
export INCLUDE="C:\Program Files\Debugging Tools for Windows (x64)\sdk\inc;$INCLUDE"
export PATH="/c/cygwin64/bin:/usr/bin:$PATH"
Expand Down
5 changes: 0 additions & 5 deletions sbin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -427,11 +427,6 @@ buildingTheRestOfTheConfigParameters() {
addConfigureArg "--enable-ccache" ""
fi

# Point-in-time dependency for openj9 only
if [[ "${BUILD_CONFIG[BUILD_VARIANT]}" == "${BUILD_VARIANT_OPENJ9}" ]]; then
addConfigureArg "--with-freemarker-jar=" "${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[WORKING_DIR]}/freemarker-${FREEMARKER_LIB_VERSION}/freemarker.jar"
fi

if [ "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" == "${JDK8_CORE_VERSION}" ]; then
addConfigureArg "--with-x=" "/usr/include/X11"
addConfigureArg "--with-alsa=" "${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[WORKING_DIR]}/installedalsa"
Expand Down
49 changes: 1 addition & 48 deletions sbin/prepareWorkspace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@ 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_FONT_SHARED_OBJECT_FILENAME="libfreetype.so*"
FREEMARKER_LIB_VERSION=${FREEMARKER_LIB_VERSION:-2.3.31}

# Create a new clone or update the existing clone of the OpenJDK source repo
# TODO refactor this for Single Responsibility Principle (SRP)
Expand Down Expand Up @@ -373,41 +370,6 @@ checkFingerprint() {
fi
}

# Freemarker for OpenJ9
checkingAndDownloadingFreemarker() {
echo "Checking for FREEMARKER"

cd "${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[WORKING_DIR]}/" || exit
FOUND_FREEMARKER=$(find "." -type d -name "freemarker-${FREEMARKER_LIB_VERSION}")

FREEMARKER_BUILD_INFO="Unknown"
if [[ -n "$FOUND_FREEMARKER" ]]; then
echo "Skipping FREEMARKER download"
else

# www.mirrorservice.org unavailable - issue #1867
#wget -nc --no-check-certificate "https://www.mirrorservice.org/sites/ftp.apache.org/freemarker/engine/${FREEMARKER_LIB_VERSION}/binaries/apache-freemarker-${FREEMARKER_LIB_VERSION}-bin.tar.gz"

wget "https://www.apache.org/dist/freemarker/engine/${FREEMARKER_LIB_VERSION}/binaries/apache-freemarker-${FREEMARKER_LIB_VERSION}-bin.tar.gz" ||
curl -L -o "apache-freemarker-${FREEMARKER_LIB_VERSION}-bin.tar.gz" "https://www.apache.org/dist/freemarker/engine/${FREEMARKER_LIB_VERSION}/binaries/apache-freemarker-${FREEMARKER_LIB_VERSION}-bin.tar.gz"

# Allow fallback to curl since wget fails cert check on macos - issue #1194
wget "https://www.apache.org/dist/freemarker/engine/${FREEMARKER_LIB_VERSION}/binaries/apache-freemarker-${FREEMARKER_LIB_VERSION}-bin.tar.gz.asc" ||
curl -L -o "apache-freemarker-${FREEMARKER_LIB_VERSION}-bin.tar.gz.asc" "https://www.apache.org/dist/freemarker/engine/${FREEMARKER_LIB_VERSION}/binaries/apache-freemarker-${FREEMARKER_LIB_VERSION}-bin.tar.gz.asc"

FREEMARKER_BUILD_INFO="https://www.apache.org/dist/freemarker/engine/${FREEMARKER_LIB_VERSION}/binaries/apache-freemarker-${FREEMARKER_LIB_VERSION}-bin.tar.gz"

checkFingerprint "apache-freemarker-${FREEMARKER_LIB_VERSION}-bin.tar.gz.asc" "apache-freemarker-${FREEMARKER_LIB_VERSION}-bin.tar.gz" "freemarker" "13AC 2213 964A BE1D 1C14 7C0E 1939 A252 0BAB 1D90" "${FREEMARKER_LIB_CHECKSUM}"

mkdir -p "${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[WORKING_DIR]}/freemarker-${FREEMARKER_LIB_VERSION}/" || exit
tar -xzf "apache-freemarker-${FREEMARKER_LIB_VERSION}-bin.tar.gz" --strip-components=1 -C "${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[WORKING_DIR]}/freemarker-${FREEMARKER_LIB_VERSION}/"
rm "apache-freemarker-${FREEMARKER_LIB_VERSION}-bin.tar.gz"
fi

# Record buildinfo version
echo "${FREEMARKER_BUILD_INFO}" > "${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[TARGET_DIR]}/metadata/dependency_version_freemarker.txt"
}

# Utility function
downloadFile() {
local targetFileName="$1"
Expand Down Expand Up @@ -553,7 +515,7 @@ prepareMozillaCacerts() {
fi
}

# Download all of the dependencies for OpenJDK (Alsa, FreeType, FreeMarker etc.)
# Download all of the dependencies for OpenJDK (Alsa, FreeType etc.)
downloadingRequiredDependencies() {
if [[ "${BUILD_CONFIG[CLEAN_LIBS]}" == "true" ]]; then
rm -rf "${BUILD_CONFIG[WORKSPACE_DIR]}/libs/freetype" || true
Expand All @@ -572,15 +534,6 @@ downloadingRequiredDependencies() {
checkingAndDownloadingAlsa
fi

if [[ "${BUILD_CONFIG[BUILD_VARIANT]}" == "${BUILD_VARIANT_OPENJ9}" ]]; then
if [[ "$OSTYPE" == "cygwin" ]] || [[ "$OSTYPE" == "msys" ]]; then
echo "Windows or Windows-like environment detected, skipping download of dependency Freemarker."
else
echo "Checking and downloading Freemarker dependency"
checkingAndDownloadingFreemarker
fi
fi

if [[ "${BUILD_CONFIG[FREETYPE]}" == "true" ]]; then
case "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" in
jdk8* | jdk9* | jdk10*)
Expand Down

0 comments on commit 1faf3ec

Please sign in to comment.