Skip to content

Commit

Permalink
Moved the logic to check for the library and release it, to a more ap…
Browse files Browse the repository at this point in the history
…propriate place in the script
  • Loading branch information
neomatrix369 committed Feb 1, 2018
1 parent 4e0a529 commit 5e6b8f9
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions sbin/common-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}"
Expand Down

0 comments on commit 5e6b8f9

Please sign in to comment.