From 2028fa4fe7ee6a06721ea3059e1439169a35e1c4 Mon Sep 17 00:00:00 2001 From: mammo0 Date: Tue, 22 Dec 2020 18:38:43 +0100 Subject: [PATCH 01/11] add support for zlib and libpng libraries -> build zlib with 'FREETYPEPY_WITH_ZLIB=1' -> build libpng with 'FREETYPEPY_WITH_LIBPNG=1' --- setup-build-freetype.py | 54 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 48 insertions(+), 6 deletions(-) diff --git a/setup-build-freetype.py b/setup-build-freetype.py index fabdf18..0b1add2 100644 --- a/setup-build-freetype.py +++ b/setup-build-freetype.py @@ -34,6 +34,16 @@ HARFBUZZ_TARBALL = "harfbuzz-2.6.7.tar.xz" HARFBUZZ_URL = HARFBUZZ_HOST + HARFBUZZ_TARBALL HARFBUZZ_SHA256 = "49e481d06cdff97bf68d99fa26bdf785331f411614485d892ea4c78eb479b218" +BUILD_ZLIB = os.environ.get("FREETYPEPY_WITH_ZLIB", "") +ZLIB_HOST = "https://zlib.net/" +ZLIB_TARBALL = "zlib-1.2.11.tar.xz" +ZLIB_URL = ZLIB_HOST + ZLIB_TARBALL +ZLIB_SH256 = "4ff941449631ace0d4d203e3483be9dbc9da454084111f97ea0a2114e19bf066" +BUILD_LIBPNG = os.environ.get("FREETYPEPY_WITH_LIBPNG", "") +LIBPNG_HOST = "https://download.sourceforge.net/libpng/" +LIBPNG_TARBALL = "libpng-1.6.37.tar.xz" +LIBPNG_URL = LIBPNG_HOST + LIBPNG_TARBALL +LIBPNG_SH256 = "505e70834d35383537b6491e7ae8641f1a4bed1876dbfe361201fc80868d88ca" root_dir = "." build_dir = path.join(root_dir, "build") @@ -42,6 +52,8 @@ lib_dir = path.join(prefix_dir, "lib") build_dir_ft = path.join(build_dir, FREETYPE_TARBALL.split(".tar")[0], "build") build_dir_hb = path.join(build_dir, HARFBUZZ_TARBALL.split(".tar")[0], "build") +build_dir_zl = path.join(build_dir, ZLIB_TARBALL.split(".tar")[0], "build") +build_dir_lp = path.join(build_dir, LIBPNG_TARBALL.split(".tar")[0], "build") CMAKE_GLOBAL_SWITCHES = ( "-DCMAKE_COLOR_MAKEFILE=false " @@ -155,17 +167,25 @@ def ensure_downloaded(url, sha256_sum): distutils.dir_util.mkpath(prefix_dir) distutils.dir_util.mkpath(build_dir_ft) distutils.dir_util.mkpath(build_dir_hb) +if BUILD_ZLIB or BUILD_LIBPNG: + distutils.dir_util.mkpath(build_dir_zl) +if BUILD_LIBPNG: + distutils.dir_util.mkpath(build_dir_lp) ensure_downloaded(FREETYPE_URL, FREETYPE_SHA256) ensure_downloaded(HARFBUZZ_URL, HARFBUZZ_SHA256) +if BUILD_ZLIB or BUILD_LIBPNG: + ensure_downloaded(ZLIB_URL, ZLIB_SH256) +if BUILD_LIBPNG: + ensure_downloaded(LIBPNG_URL, LIBPNG_SH256) -print("# First, build FreeType without Harfbuzz support") +print("# First, build FreeType without additional libraries") shell( "cmake -DBUILD_SHARED_LIBS=OFF " "-DCMAKE_DISABLE_FIND_PACKAGE_HarfBuzz=TRUE -DFT_WITH_HARFBUZZ=OFF " - "-DCMAKE_DISABLE_FIND_PACKAGE_PNG=TRUE " + "-DCMAKE_DISABLE_FIND_PACKAGE_PNG=TRUE -DFT_WITH_PNG=OFF " "-DCMAKE_DISABLE_FIND_PACKAGE_BZip2=TRUE " - "-DCMAKE_DISABLE_FIND_PACKAGE_ZLIB=TRUE " + "-DCMAKE_DISABLE_FIND_PACKAGE_ZLIB=TRUE -DFT_WITH_ZLIB=OFF " "-DCMAKE_DISABLE_FIND_PACKAGE_BrotliDec=TRUE " "{} ..".format(CMAKE_GLOBAL_SWITCHES), cwd=build_dir_ft, @@ -183,14 +203,36 @@ def ensure_downloaded(url, sha256_sum): ) shell("cmake --build . --config Release --target install --parallel", cwd=build_dir_hb) -print("\n# Lastly, rebuild FreeType, this time with Harfbuzz support.") +if BUILD_ZLIB or BUILD_LIBPNG: + print("\n# Next, build zlib.") + shell( + "cmake -DBUILD_SHARED_LIBS=OFF " + + # https://stackoverflow.com/questions/3961446 + ("-DCMAKE_POSITION_INDEPENDENT_CODE=ON " if bitness > 32 else "") + + "{} ..".format(CMAKE_GLOBAL_SWITCHES), + cwd=build_dir_zl, + ) + shell("cmake --build . --config Release --target install --parallel", cwd=build_dir_zl) + +if BUILD_LIBPNG: + print("\n# Next, build libpng.") + shell( + "cmake -DBUILD_SHARED_LIBS=OFF " + + # https://stackoverflow.com/questions/3961446 + ("-DCMAKE_POSITION_INDEPENDENT_CODE=ON " if bitness > 32 else "") + + "{} ..".format(CMAKE_GLOBAL_SWITCHES), + cwd=build_dir_lp, + ) + shell("cmake --build . --config Release --target install --parallel", cwd=build_dir_lp) + +print("\n# Lastly, rebuild FreeType, this time with additional libraries support.") harfbuzz_includes = path.join(prefix_dir, "include", "harfbuzz") shell( "cmake -DBUILD_SHARED_LIBS=ON " "-DCMAKE_DISABLE_FIND_PACKAGE_HarfBuzz=FALSE -DFT_WITH_HARFBUZZ=ON " - "-DCMAKE_DISABLE_FIND_PACKAGE_PNG=TRUE " + "-DCMAKE_DISABLE_FIND_PACKAGE_PNG=" + ("FALSE -DFT_WITH_PNG=ON " if BUILD_LIBPNG else "TRUE ") + "-DCMAKE_DISABLE_FIND_PACKAGE_BZip2=TRUE " - "-DCMAKE_DISABLE_FIND_PACKAGE_ZLIB=TRUE " + "-DCMAKE_DISABLE_FIND_PACKAGE_ZLIB=" + ("FALSE -DFT_WITH_ZLIB=ON " if BUILD_ZLIB or BUILD_LIBPNG else "TRUE ") + "-DCMAKE_DISABLE_FIND_PACKAGE_BrotliDec=TRUE " '-DPKG_CONFIG_EXECUTABLE="" ' # Prevent finding system libraries '-DHARFBUZZ_INCLUDE_DIRS="{}" ' From 2898aa3fdf53d8750b72e389fcd5ca78a9060458 Mon Sep 17 00:00:00 2001 From: mammo0 Date: Wed, 6 Apr 2022 13:35:38 +0200 Subject: [PATCH 02/11] updated zlib download URL -> on the official website only the current version can be downloaded -> so this script will break every time a new version of zlib is released -> using mirror on sourceforge --- setup-build-freetype.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup-build-freetype.py b/setup-build-freetype.py index 0b1add2..c7f15d3 100644 --- a/setup-build-freetype.py +++ b/setup-build-freetype.py @@ -35,7 +35,7 @@ HARFBUZZ_URL = HARFBUZZ_HOST + HARFBUZZ_TARBALL HARFBUZZ_SHA256 = "49e481d06cdff97bf68d99fa26bdf785331f411614485d892ea4c78eb479b218" BUILD_ZLIB = os.environ.get("FREETYPEPY_WITH_ZLIB", "") -ZLIB_HOST = "https://zlib.net/" +ZLIB_HOST = "https://download.sourceforge.net/libpng/" ZLIB_TARBALL = "zlib-1.2.11.tar.xz" ZLIB_URL = ZLIB_HOST + ZLIB_TARBALL ZLIB_SH256 = "4ff941449631ace0d4d203e3483be9dbc9da454084111f97ea0a2114e19bf066" From e3a026334a7f136fa224e7e2a56a8f97290ea7bc Mon Sep 17 00:00:00 2001 From: mammo0 Date: Wed, 6 Apr 2022 13:36:30 +0200 Subject: [PATCH 03/11] added missing include directories for zlib and libpng --- setup-build-freetype.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/setup-build-freetype.py b/setup-build-freetype.py index c7f15d3..1520270 100644 --- a/setup-build-freetype.py +++ b/setup-build-freetype.py @@ -227,6 +227,8 @@ def ensure_downloaded(url, sha256_sum): print("\n# Lastly, rebuild FreeType, this time with additional libraries support.") harfbuzz_includes = path.join(prefix_dir, "include", "harfbuzz") +libpng_includes = path.join(prefix_dir, "include", "libpng16") +zlib_includes = path.join(prefix_dir, "include") shell( "cmake -DBUILD_SHARED_LIBS=ON " "-DCMAKE_DISABLE_FIND_PACKAGE_HarfBuzz=FALSE -DFT_WITH_HARFBUZZ=ON " @@ -236,8 +238,10 @@ def ensure_downloaded(url, sha256_sum): "-DCMAKE_DISABLE_FIND_PACKAGE_BrotliDec=TRUE " '-DPKG_CONFIG_EXECUTABLE="" ' # Prevent finding system libraries '-DHARFBUZZ_INCLUDE_DIRS="{}" ' + '-DPNG_INCLUDE_DIRS="{}" ' + '-DZLIB_INCLUDE_DIRS="{}" ' "-DSKIP_INSTALL_HEADERS=ON " - "{} ..".format(harfbuzz_includes, CMAKE_GLOBAL_SWITCHES), + "{} ..".format(harfbuzz_includes, libpng_includes, zlib_includes, CMAKE_GLOBAL_SWITCHES), cwd=build_dir_ft, ) shell("cmake --build . --config Release --target install --parallel", cwd=build_dir_ft) From e0f8e6681f2a21c7eecb65153a9bca74d63622e2 Mon Sep 17 00:00:00 2001 From: mammo0 Date: Sat, 9 Apr 2022 14:14:24 +0200 Subject: [PATCH 04/11] only build static libpng (like harfbuzz) --- setup-build-freetype.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup-build-freetype.py b/setup-build-freetype.py index 1520270..ceb3acf 100644 --- a/setup-build-freetype.py +++ b/setup-build-freetype.py @@ -217,7 +217,7 @@ def ensure_downloaded(url, sha256_sum): if BUILD_LIBPNG: print("\n# Next, build libpng.") shell( - "cmake -DBUILD_SHARED_LIBS=OFF " + + "cmake -DPNG_SHARED=OFF " + # https://stackoverflow.com/questions/3961446 ("-DCMAKE_POSITION_INDEPENDENT_CODE=ON " if bitness > 32 else "") + "{} ..".format(CMAKE_GLOBAL_SWITCHES), From 9056f72b02acad395a484ed41f99c348938894ba Mon Sep 17 00:00:00 2001 From: mammo0 Date: Sat, 9 Apr 2022 14:14:57 +0200 Subject: [PATCH 05/11] only build static zlib (like harfbuzz and libpng) --- setup-build-freetype.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/setup-build-freetype.py b/setup-build-freetype.py index ceb3acf..2ad9451 100644 --- a/setup-build-freetype.py +++ b/setup-build-freetype.py @@ -22,6 +22,7 @@ from os import path from urllib.request import urlopen import platform +import fileinput # Needed for the GitHub Actions macOS CI runner, which appears to come without CAs. import certifi @@ -205,8 +206,16 @@ def ensure_downloaded(url, sha256_sum): if BUILD_ZLIB or BUILD_LIBPNG: print("\n# Next, build zlib.") + # workaround to only build the static library of zlib + # see https://github.com/madler/zlib/issues/359 + with fileinput.input(path.join(path.dirname(build_dir_zl), "CMakeLists.txt"), inplace=True) as f: + for line in f: + if "install(TARGETS zlib zlibstatic" in line: + line = line.replace(" install(TARGETS zlib zlibstatic", " install(TARGETS zlibstatic") + print(line, end='') + shell( - "cmake -DBUILD_SHARED_LIBS=OFF " + + "cmake " + # https://stackoverflow.com/questions/3961446 ("-DCMAKE_POSITION_INDEPENDENT_CODE=ON " if bitness > 32 else "") + "{} ..".format(CMAKE_GLOBAL_SWITCHES), From 0c1219d683ef8cae6ffe2d683fa6735af969a6f2 Mon Sep 17 00:00:00 2001 From: mammo0 Date: Sat, 9 Apr 2022 14:15:39 +0200 Subject: [PATCH 06/11] fixed name of cmake 'DHARFBUZZ_INCLUDE_DIRS' variable --- setup-build-freetype.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup-build-freetype.py b/setup-build-freetype.py index 2ad9451..92d3138 100644 --- a/setup-build-freetype.py +++ b/setup-build-freetype.py @@ -246,7 +246,7 @@ def ensure_downloaded(url, sha256_sum): "-DCMAKE_DISABLE_FIND_PACKAGE_ZLIB=" + ("FALSE -DFT_WITH_ZLIB=ON " if BUILD_ZLIB or BUILD_LIBPNG else "TRUE ") + "-DCMAKE_DISABLE_FIND_PACKAGE_BrotliDec=TRUE " '-DPKG_CONFIG_EXECUTABLE="" ' # Prevent finding system libraries - '-DHARFBUZZ_INCLUDE_DIRS="{}" ' + '-DHarfBuzz_INCLUDE_DIRS="{}" ' '-DPNG_INCLUDE_DIRS="{}" ' '-DZLIB_INCLUDE_DIRS="{}" ' "-DSKIP_INSTALL_HEADERS=ON " From 1ccdc8c281a614ecc3dc35c408634eeb5043f67f Mon Sep 17 00:00:00 2001 From: mammo0 Date: Sat, 9 Apr 2022 14:16:02 +0200 Subject: [PATCH 07/11] prevent re-export of symbols from harfbuzz, libpng and zlib --- setup-build-freetype.py | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/setup-build-freetype.py b/setup-build-freetype.py index 92d3138..11d1699 100644 --- a/setup-build-freetype.py +++ b/setup-build-freetype.py @@ -61,6 +61,7 @@ '-DCMAKE_PREFIX_PATH="{}" ' '-DCMAKE_INSTALL_PREFIX="{}" ' ).format(prefix_dir, prefix_dir) +CMAKE_PREVENT_REEXPORT = "" # Try to use Ninja to build things if it's available. Much faster. # On Windows, I first need to figure out how to make it aware of VC, bitness, @@ -81,6 +82,12 @@ print("# Making a 32 bit build.") bitness = 32 + CMAKE_PREVENT_REEXPORT += "-Wl,--exclude-libs,libharfbuzz " + if BUILD_ZLIB or BUILD_LIBPNG: + CMAKE_PREVENT_REEXPORT += "-Wl,--exclude-libs,libz " + if BUILD_LIBPNG: + CMAKE_PREVENT_REEXPORT += "-Wl,--exclude-libs,libpng " + if sys.platform == "darwin": print("# Making a 64 bit build.") CMAKE_GLOBAL_SWITCHES += ( @@ -91,6 +98,14 @@ ) bitness = 64 + # the library path is needed for the '-hidden-lx' option to work + CMAKE_PREVENT_REEXPORT += "-Wl,-L{} ".format(lib_dir) + CMAKE_PREVENT_REEXPORT += "-Wl,-hidden-lharfbuzz " + if BUILD_ZLIB or BUILD_LIBPNG: + CMAKE_PREVENT_REEXPORT += "-Wl,-hidden-lz " + if BUILD_LIBPNG: + CMAKE_PREVENT_REEXPORT += "-Wl,-hidden-lpng " + if "linux" in sys.platform: c_flags = cxx_flags = "-O2" ld_flags = "" @@ -124,6 +139,12 @@ '-DCMAKE_LD_FLAGS="{}" '.format(ld_flags) ) + CMAKE_PREVENT_REEXPORT += "-Wl,--exclude-libs,libharfbuzz " + if BUILD_ZLIB or BUILD_LIBPNG: + CMAKE_PREVENT_REEXPORT += "-Wl,--exclude-libs,libz " + if BUILD_LIBPNG: + CMAKE_PREVENT_REEXPORT += "-Wl,--exclude-libs,libpng " + def shell(cmd, cwd=None): """Run a shell command specified by cmd string.""" @@ -249,8 +270,10 @@ def ensure_downloaded(url, sha256_sum): '-DHarfBuzz_INCLUDE_DIRS="{}" ' '-DPNG_INCLUDE_DIRS="{}" ' '-DZLIB_INCLUDE_DIRS="{}" ' + # prevent re-export of symbols from harfbuzz, libpng and zlib + '-DCMAKE_SHARED_LINKER_FLAGS="{}" ' "-DSKIP_INSTALL_HEADERS=ON " - "{} ..".format(harfbuzz_includes, libpng_includes, zlib_includes, CMAKE_GLOBAL_SWITCHES), + "{} ..".format(harfbuzz_includes, libpng_includes, zlib_includes, CMAKE_PREVENT_REEXPORT, CMAKE_GLOBAL_SWITCHES), cwd=build_dir_ft, ) shell("cmake --build . --config Release --target install --parallel", cwd=build_dir_ft) From bd59b8d87dc0fc58cdf9064599e0a529ee3cd0a6 Mon Sep 17 00:00:00 2001 From: mammo0 Date: Wed, 8 Nov 2023 15:28:19 +0100 Subject: [PATCH 08/11] updated libpng version to 1.6.40 --- setup-build-freetype.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup-build-freetype.py b/setup-build-freetype.py index 73ee2e0..14c5b6b 100644 --- a/setup-build-freetype.py +++ b/setup-build-freetype.py @@ -42,9 +42,9 @@ ZLIB_SH256 = "4ff941449631ace0d4d203e3483be9dbc9da454084111f97ea0a2114e19bf066" LIBPNG_HOST = "https://download.sourceforge.net/libpng/" -LIBPNG_TARBALL = "libpng-1.6.37.tar.xz" +LIBPNG_TARBALL = "libpng-1.6.40.tar.xz" LIBPNG_URL = LIBPNG_HOST + LIBPNG_TARBALL -LIBPNG_SH256 = "505e70834d35383537b6491e7ae8641f1a4bed1876dbfe361201fc80868d88ca" +LIBPNG_SH256 = "535b479b2467ff231a3ec6d92a525906fb8ef27978be4f66dbe05d3f3a01b3a1" BUILD_ZLIB = os.environ.get("FREETYPEPY_WITH_ZLIB", "") BUILD_LIBPNG = os.environ.get("FREETYPEPY_WITH_LIBPNG", "") From ab91497e0f8d2f34a617195c8126dfc8a0abdfa1 Mon Sep 17 00:00:00 2001 From: mammo0 Date: Wed, 8 Nov 2023 15:29:46 +0100 Subject: [PATCH 09/11] fixed freetype cmake variable names --- setup-build-freetype.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/setup-build-freetype.py b/setup-build-freetype.py index 14c5b6b..6b5b2fc 100644 --- a/setup-build-freetype.py +++ b/setup-build-freetype.py @@ -207,11 +207,11 @@ def ensure_downloaded(url, sha256_sum): print("# First, build FreeType without additional libraries") shell( "cmake -DBUILD_SHARED_LIBS=OFF " - "-DCMAKE_DISABLE_FIND_PACKAGE_HarfBuzz=TRUE -DFT_WITH_HARFBUZZ=OFF " - "-DCMAKE_DISABLE_FIND_PACKAGE_PNG=TRUE -DFT_WITH_PNG=OFF " - "-DCMAKE_DISABLE_FIND_PACKAGE_BZip2=TRUE " - "-DCMAKE_DISABLE_FIND_PACKAGE_ZLIB=TRUE -DFT_WITH_ZLIB=OFF " - "-DCMAKE_DISABLE_FIND_PACKAGE_BrotliDec=TRUE " + "-DFT_DISABLE_HARFBUZZ=TRUE " + "-DFT_DISABLE_PNG=TRUE " + "-DFT_DISABLE_BZIP2=TRUE " + "-DFT_DISABLE_ZLIB=TRUE " + "-DFT_DISABLE_BROTLI=TRUE " "{} ..".format(CMAKE_GLOBAL_SWITCHES), cwd=build_dir_ft, ) @@ -264,11 +264,11 @@ def ensure_downloaded(url, sha256_sum): zlib_includes = path.join(prefix_dir, "include") shell( "cmake -DBUILD_SHARED_LIBS=ON " - "-DCMAKE_DISABLE_FIND_PACKAGE_HarfBuzz=FALSE -DFT_WITH_HARFBUZZ=ON " - "-DCMAKE_DISABLE_FIND_PACKAGE_PNG=" + ("FALSE -DFT_WITH_PNG=ON " if BUILD_LIBPNG else "TRUE ") + - "-DCMAKE_DISABLE_FIND_PACKAGE_BZip2=TRUE " - "-DCMAKE_DISABLE_FIND_PACKAGE_ZLIB=" + ("FALSE -DFT_WITH_ZLIB=ON " if BUILD_ZLIB or BUILD_LIBPNG else "TRUE ") + - "-DCMAKE_DISABLE_FIND_PACKAGE_BrotliDec=TRUE " + "-DFT_REQUIRE_HARFBUZZ=TRUE " + "-DFT_REQUIRE_PNG=" + ("TRUE " if BUILD_LIBPNG else "FALSE ") + + "-DFT_DISABLE_BZIP2=TRUE " + "-DFT_REQUIRE_ZLIB=" + ("TRUE " if BUILD_ZLIB or BUILD_LIBPNG else "FALSE ") + + "-DFT_DISABLE_BROTLI=TRUE " '-DPKG_CONFIG_EXECUTABLE="" ' # Prevent finding system libraries '-DHarfBuzz_INCLUDE_DIRS="{}" ' '-DPNG_INCLUDE_DIRS="{}" ' From e3566dd89cbb15eb220f6343d449ebc9622995c6 Mon Sep 17 00:00:00 2001 From: mammo0 Date: Sun, 19 Nov 2023 17:40:27 +0100 Subject: [PATCH 10/11] clean freetype cmake build dir before final build --- setup-build-freetype.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/setup-build-freetype.py b/setup-build-freetype.py index 6b5b2fc..ba64e03 100644 --- a/setup-build-freetype.py +++ b/setup-build-freetype.py @@ -259,6 +259,9 @@ def ensure_downloaded(url, sha256_sum): shell("cmake --build . --config Release --target install --parallel", cwd=build_dir_lp) print("\n# Lastly, rebuild FreeType, this time with additional libraries support.") +# clean cmake build dir for a clean build +distutils.dir_util.remove_tree(build_dir_ft) +distutils.dir_util.mkpath(build_dir_ft) harfbuzz_includes = path.join(prefix_dir, "include", "harfbuzz") libpng_includes = path.join(prefix_dir, "include", "libpng16") zlib_includes = path.join(prefix_dir, "include") From 9a4ef31ff563f5c08df87ad0ff6f9d1163345502 Mon Sep 17 00:00:00 2001 From: mammo0 Date: Sun, 19 Nov 2023 17:58:34 +0100 Subject: [PATCH 11/11] do try to find any system libraries --- setup-build-freetype.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/setup-build-freetype.py b/setup-build-freetype.py index ba64e03..df9f36b 100644 --- a/setup-build-freetype.py +++ b/setup-build-freetype.py @@ -267,10 +267,10 @@ def ensure_downloaded(url, sha256_sum): zlib_includes = path.join(prefix_dir, "include") shell( "cmake -DBUILD_SHARED_LIBS=ON " - "-DFT_REQUIRE_HARFBUZZ=TRUE " - "-DFT_REQUIRE_PNG=" + ("TRUE " if BUILD_LIBPNG else "FALSE ") + - "-DFT_DISABLE_BZIP2=TRUE " - "-DFT_REQUIRE_ZLIB=" + ("TRUE " if BUILD_ZLIB or BUILD_LIBPNG else "FALSE ") + + "-DFT_REQUIRE_HARFBUZZ=TRUE " + + ("-DFT_REQUIRE_PNG=TRUE " if BUILD_LIBPNG else "-DFT_DISABLE_PNG=TRUE ") + + "-DFT_DISABLE_BZIP2=TRUE " + + ("-DFT_REQUIRE_ZLIB=TRUE " if BUILD_ZLIB or BUILD_LIBPNG else "-DFT_DISABLE_ZLIB=TRUE ") + "-DFT_DISABLE_BROTLI=TRUE " '-DPKG_CONFIG_EXECUTABLE="" ' # Prevent finding system libraries '-DHarfBuzz_INCLUDE_DIRS="{}" '