diff --git a/ports/freetype/0002-Add-CONFIG_INSTALL_PATH-option.patch b/ports/freetype/0002-Add-CONFIG_INSTALL_PATH-option.patch deleted file mode 100644 index 1120cd096319cb..00000000000000 --- a/ports/freetype/0002-Add-CONFIG_INSTALL_PATH-option.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index c00902521..b24508654 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -176,6 +176,8 @@ option(FT_WITH_PNG "Support PNG compressed OpenType embedded bitmaps." OFF) - option(FT_WITH_HARFBUZZ "Improve auto-hinting of OpenType fonts." OFF) - option(FT_WITH_BROTLI "Support compressed WOFF2 fonts." OFF) - -+# vcpkg config install path -+option(CONFIG_INSTALL_PATH "location to install cmake config files" lib/cmake/freetype) - - # Disallow in-source builds - if ("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}") -@@ -559,7 +561,7 @@ if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL) - COMPONENT libraries) - install( - EXPORT freetype-targets -- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/freetype -+ DESTINATION ${CONFIG_INSTALL_PATH} - FILE freetype-config.cmake - COMPONENT headers) - endif () diff --git a/ports/freetype/CONTROL b/ports/freetype/CONTROL index 7ba2032bf3107f..dcec495d7b07c6 100644 --- a/ports/freetype/CONTROL +++ b/ports/freetype/CONTROL @@ -1,7 +1,7 @@ Source: freetype Version: 2.10.2 -Port-Version: 1 -Build-Depends: zlib +Port-Version: 2 +Build-Depends: zlib, brotli Homepage: https://www.freetype.org/ Description: A library to render fonts. Default-Features: bzip2, png diff --git a/ports/freetype/pkgconfig.patch b/ports/freetype/pkgconfig.patch new file mode 100644 index 00000000000000..615434a34bbc6e --- /dev/null +++ b/ports/freetype/pkgconfig.patch @@ -0,0 +1,20 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 65839ac58..54f2ce8ec 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -517,7 +517,6 @@ endif () + + if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL) + # Generate the pkg-config file +- if (UNIX) + file(READ "${PROJECT_SOURCE_DIR}/builds/unix/freetype2.in" FREETYPE2_PC_IN) + + string(REPLACE ";" ", " PKG_CONFIG_REQUIRED_PRIVATE "${PKG_CONFIG_REQUIRED_PRIVATE}") +@@ -551,7 +550,6 @@ if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL) + FILES ${PROJECT_BINARY_DIR}/freetype2.pc + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig + COMPONENT pkgconfig) +- endif () + + install( + TARGETS freetype diff --git a/ports/freetype/portfile.cmake b/ports/freetype/portfile.cmake index eddc993da16511..46d23a2be404cf 100644 --- a/ports/freetype/portfile.cmake +++ b/ports/freetype/portfile.cmake @@ -11,8 +11,8 @@ vcpkg_extract_source_archive_ex( REF ${FT_VERSION} PATCHES 0001-Fix-install-command.patch - 0002-Add-CONFIG_INSTALL_PATH-option.patch 0003-Fix-UWP.patch + pkgconfig.patch ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS @@ -28,13 +28,22 @@ vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS - -DCONFIG_INSTALL_PATH=share/freetype -DFT_WITH_ZLIB=ON # Force system zlib. - ${FEATURE_OPTIONS} + -DFT_WITH_BROTLI=ON -DCMAKE_DISABLE_FIND_PACKAGE_HarfBuzz=ON + ${FEATURE_OPTIONS} + ${OPTIONS} ) vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake) +find_library(FREETYPE_DEBUG NAMES freetyped PATHS "${CURRENT_PACKAGES_DIR}/debug/lib/" NO_DEFAULT_PATH) +if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/freetype2.pc" AND FREETYPE_DEBUG) + file(READ "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/freetype2.pc" _contents) + string(REPLACE "-lfreetype" "-lfreetyped" _contents "${_contents}") + file(WRITE "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/freetype2.pc" "${_contents}") +endif() +vcpkg_fixup_pkgconfig() file(RENAME ${CURRENT_PACKAGES_DIR}/include/freetype2/freetype ${CURRENT_PACKAGES_DIR}/include/freetype) file(RENAME ${CURRENT_PACKAGES_DIR}/include/freetype2/ft2build.h ${CURRENT_PACKAGES_DIR}/include/ft2build.h) @@ -63,6 +72,7 @@ endif() string(REPLACE "\${_IMPORT_PREFIX}/include/freetype2" "\${_IMPORT_PREFIX}/include;\${_IMPORT_PREFIX}/include/freetype" CONFIG_MODULE "${CONFIG_MODULE}") file(WRITE ${CURRENT_PACKAGES_DIR}/share/freetype/freetype-config.cmake "${CONFIG_MODULE}") +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) file(COPY