From 5e6b8f90ee5dc04afce58720ad712565d836bbf8 Mon Sep 17 00:00:00 2001 From: neomatrix369 Date: Thu, 1 Feb 2018 22:16:59 +0000 Subject: [PATCH] Moved the logic to check for the library and release it, to a more appropriate place in the script --- sbin/common-functions.sh | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/sbin/common-functions.sh b/sbin/common-functions.sh index 54d630945a..7644bd1f59 100644 --- a/sbin/common-functions.sh +++ b/sbin/common-functions.sh @@ -88,14 +88,6 @@ checkingAndDownloadingFreeType() tar xf freetype-"$FREETYPE_FONT_VERSION".tar.gz rm freetype-"$FREETYPE_FONT_VERSION".tar.gz MAKE=make - - if [[ ${OS_KERNEL_NAME} == "darwin" ]] ; then - TARGET_DYNAMIC_LIB="${WORKING_DIR}"/"${OPENJDK_REPO_NAME}"/installedfreetype/lib/libfreetype.6.dylib - echo "Releasing the runpath dependency of the dynamic library ${TARGET_DYNAMIC_LIB}" - set -x - install_name_tool -id @rpath/libfreetype.6.dylib "${TARGET_DYNAMIC_LIB}" - set +x - fi fi cd freetype-"$FREETYPE_FONT_VERSION" || exit @@ -109,6 +101,26 @@ checkingAndDownloadingFreeType() else # shellcheck disable=SC2154 echo "${good}Successfully configured OpenJDK with the FreeType library (libfreetype)!" + + if [[ ${OS_KERNEL_NAME} == "darwin" ]] ; then + TARGET_DYNAMIC_LIB_DIR="${WORKING_DIR}"/"${OPENJDK_REPO_NAME}"/installedfreetype/lib/ + TARGET_DYNAMIC_LIB="${TARGET_DYNAMIC_LIB_DIR}"/libfreetype.6.dylib + echo "" + echo "Listing the contents of ${TARGET_DYNAMIC_LIB_DIR} to see if the dynamic library 'libfreetype.6.dylib' has been created..." + ls ${TARGET_DYNAMIC_LIB_DIR} + + echo "" + echo "Releasing the runpath dependency of the dynamic library ${TARGET_DYNAMIC_LIB}" + set -x + install_name_tool -id @rpath/libfreetype.6.dylib "${TARGET_DYNAMIC_LIB}" + set +x + + if [[ $? == 0 ]]; then + echo "Failed to release the runpath dependency of the dynamic library ${TARGET_DYNAMIC_LIB}" + else + echo "Successfully released the runpath dependency of the dynamic library ${TARGET_DYNAMIC_LIB}" + fi + fi fi # shellcheck disable=SC2154 echo "${normal}"