-
Notifications
You must be signed in to change notification settings - Fork 608
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: Raise freetype minimum to 2.10.0 and allow auto-build (#4283)
freetype 2.10.0 dates from 2019, so we're still supporting 5 years back. Previously, we enforced no minimum, so we're not sure how far back it would really work, but the earliest version we tested in CI was 2.8, which dated from 2018. Add a build_Freetype.bash for easy setup for CI (and other users). Add build_freetype.cmake to allow automatic local builds if it can't be found at build time. CI many cases need to build freetype, because the old CentOS 7 era freetype is now too old. Remove some reference output that was only needed for older freetype. --------- Signed-off-by: Larry Gritz <[email protected]>
- Loading branch information
Showing
27 changed files
with
117 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Utility script to download and build Freetype | ||
# | ||
# Copyright Contributors to the OpenImageIO project. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# https://github.com/AcademySoftwareFoundation/OpenImageIO | ||
|
||
# Exit the whole script if any command fails. | ||
set -ex | ||
|
||
# Repo and branch/tag/commit of Freetype to download if we don't have it yet | ||
FREETYPE_REPO=${FREETYPE_REPO:=https://github.com/freetype/freetype.git} | ||
FREETYPE_VERSION=${FREETYPE_VERSION:=VER-2-13-2} | ||
|
||
# Where to put Freetype repo source (default to the ext area) | ||
LOCAL_DEPS_DIR=${LOCAL_DEPS_DIR:=${PWD}/ext} | ||
FREETYPE_SRC_DIR=${FREETYPE_SRC_DIR:=${LOCAL_DEPS_DIR}/Freetype} | ||
FREETYPE_BUILD_DIR=${FREETYPE_BUILD_DIR:=${FREETYPE_SRC_DIR}/build} | ||
FREETYPE_INSTALL_DIR=${FREETYPE_INSTALL_DIR:=${LOCAL_DEPS_DIR}/dist} | ||
FREETYPE_BUILD_TYPE=${FREETYPE_BUILD_TYPE:=Release} | ||
|
||
pwd | ||
echo "Freetype install dir will be: ${FREETYPE_INSTALL_DIR}" | ||
|
||
mkdir -p ./ext | ||
pushd ./ext | ||
|
||
# Clone Freetype project from GitHub and build | ||
if [[ ! -e ${FREETYPE_SRC_DIR} ]] ; then | ||
echo "git clone ${FREETYPE_REPO} ${FREETYPE_SRC_DIR}" | ||
git clone ${FREETYPE_REPO} ${FREETYPE_SRC_DIR} | ||
fi | ||
cd ${FREETYPE_SRC_DIR} | ||
|
||
echo "git checkout ${FREETYPE_VERSION} --force" | ||
git checkout ${FREETYPE_VERSION} --force | ||
|
||
if [[ -z $DEP_DOWNLOAD_ONLY ]]; then | ||
time cmake -S . -B ${FREETYPE_BUILD_DIR} \ | ||
-DCMAKE_BUILD_TYPE=${FREETYPE_BUILD_TYPE} \ | ||
-DBUILD_SHARED_LIBS=${FREETYPE_BUILD_SHARED_LIBS:-ON} \ | ||
-DCMAKE_INSTALL_PREFIX=${FREETYPE_INSTALL_DIR} \ | ||
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \ | ||
${FREETYPE_CONFIG_OPTS} | ||
time cmake --build ${FREETYPE_BUILD_DIR} --config ${FREETYPE_BUILD_TYPE} --target install | ||
fi | ||
|
||
# ls -R ${FREETYPE_INSTALL_DIR} | ||
popd | ||
|
||
|
||
# Set up paths. These will only affect the caller if this script is | ||
# run with 'source' rather than in a separate shell. | ||
export Freetype_ROOT=$FREETYPE_INSTALL_DIR | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Copyright Contributors to the OpenImageIO project. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# https://github.com/AcademySoftwareFoundation/OpenImageIO | ||
|
||
###################################################################### | ||
# Freetype by hand! | ||
###################################################################### | ||
|
||
set_cache (Freetype_BUILD_VERSION 2.13.2 "Freetype version for local builds") | ||
set (Freetype_GIT_REPOSITORY "https://github.com/freetype/freetype") | ||
set (Freetype_GIT_TAG "VER-2-13-2") | ||
set_cache (Freetype_BUILD_SHARED_LIBS OFF | ||
DOC "Should a local Freetype build, if necessary, build shared libraries" ADVANCED) | ||
# We would prefer to build a static Freetype, but haven't figured out how to make | ||
# it all work with the static dependencies, it just makes things complicated | ||
# downstream. | ||
|
||
string (MAKE_C_IDENTIFIER ${Freetype_BUILD_VERSION} Freetype_VERSION_IDENT) | ||
|
||
build_dependency_with_cmake(Freetype | ||
VERSION ${Freetype_BUILD_VERSION} | ||
GIT_REPOSITORY ${Freetype_GIT_REPOSITORY} | ||
GIT_TAG ${Freetype_GIT_TAG} | ||
CMAKE_ARGS | ||
-D BUILD_SHARED_LIBS=${Freetype_BUILD_SHARED_LIBS} | ||
-D CMAKE_POSITION_INDEPENDENT_CODE=ON | ||
-D CMAKE_INSTALL_LIBDIR=lib | ||
) | ||
|
||
# Set some things up that we'll need for a subsequent find_package to work | ||
|
||
set (Freetype_ROOT ${Freetype_LOCAL_INSTALL_DIR}) | ||
|
||
# Signal to caller that we need to find again at the installed location | ||
set (Freetype_REFIND TRUE) | ||
set (Freetype_REFIND_ARGS CONFIG) | ||
|
||
if (Freetype_BUILD_SHARED_LIBS) | ||
install_local_dependency_libs (Freetype Freetype) | ||
endif () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.