From 61c055a6fcfee2a7e764997bb2478adf49db6edf Mon Sep 17 00:00:00 2001 From: Alexander Neumann <30894796+Neumann-A@users.noreply.github.com> Date: Thu, 6 Aug 2020 22:07:46 +0200 Subject: [PATCH] [brotli] add pkgconfig / [freetype] depend on brotli (#12405) * [brotli] add pkgconfig * [freetype] add pkgconfig and add dependency on brotli * [qt5-base] add new freetype dependency to brotli and zstd * [freetype] fix cmake paths * [freetype] removed renaming of include dir and unnecessary cmake fixes * [freetype-gl] fix glew include dir * [podofo] fix freetype search. * fixing wrong freetype stuff due to vcpkg owned wrong CMakeLists.txt ..... * fixing more freetype hidden issues. * [sfml] fix missing include * fix typo * [freetype] uncomment previous renaming of include folders * fix brotli linkage in static builds * remove added alias to avoid problems. * [freetype] add brotli to the wrapper * [lzokay] format manifest Co-authored-by: Nicole Mazzuca --- ports/brotli/CONTROL | 3 +- ports/brotli/pkgconfig.patch | 73 +++++++++++++++++++ ports/brotli/portfile.cmake | 3 + ports/cairo/CMakeLists.txt | 2 +- ports/cairo/CONTROL | 3 +- ports/cairomm/CMakeLists.txt | 3 +- ports/cairomm/CONTROL | 3 +- ports/freetype-gl/CONTROL | 3 +- ports/freetype-gl/glew.patch | 13 ++++ ports/freetype-gl/portfile.cmake | 1 + .../0002-Add-CONFIG_INSTALL_PATH-option.patch | 22 ------ ports/freetype/CONTROL | 4 +- ports/freetype/brotli-static.patch | 21 ++++++ ports/freetype/pkgconfig.patch | 20 +++++ ports/freetype/portfile.cmake | 48 ++++++------ ports/freetype/vcpkg-cmake-wrapper.cmake | 11 +++ ports/libass/CMakeLists.txt | 8 +- ports/libass/CONTROL | 2 +- ports/libraqm/CMakeLists.txt | 2 +- ports/libraqm/CONTROL | 3 +- ports/pango/CMakeLists.txt | 8 +- ports/pango/CONTROL | 3 +- ports/podofo/CONTROL | 3 +- ports/podofo/freetype.patch | 18 +++++ ports/podofo/portfile.cmake | 1 + ports/qt5-base/portfile.cmake | 11 ++- ports/sfml/CONTROL | 3 +- ports/sfml/portfile.cmake | 1 + ports/sfml/stb_include.patch | 14 ++++ 29 files changed, 244 insertions(+), 66 deletions(-) create mode 100644 ports/brotli/pkgconfig.patch create mode 100644 ports/freetype-gl/glew.patch delete mode 100644 ports/freetype/0002-Add-CONFIG_INSTALL_PATH-option.patch create mode 100644 ports/freetype/brotli-static.patch create mode 100644 ports/freetype/pkgconfig.patch create mode 100644 ports/podofo/freetype.patch create mode 100644 ports/sfml/stb_include.patch diff --git a/ports/brotli/CONTROL b/ports/brotli/CONTROL index ff152f83bd8274..7db9ffb6c56736 100644 --- a/ports/brotli/CONTROL +++ b/ports/brotli/CONTROL @@ -1,4 +1,5 @@ Source: brotli -Version: 1.0.7-1 +Version: 1.0.7 +Port-Version: 3 Homepage: https://github.com/google/brotli Description: a generic-purpose lossless compression algorithm that compresses data using a combination of a modern variant of the LZ77 algorithm, Huffman coding and 2nd order context modeling. diff --git a/ports/brotli/pkgconfig.patch b/ports/brotli/pkgconfig.patch new file mode 100644 index 00000000000000..8ceafe1b10125a --- /dev/null +++ b/ports/brotli/pkgconfig.patch @@ -0,0 +1,73 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2c4b757f9..eed560c1d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -351,7 +351,7 @@ function(generate_pkg_config_path outvar path) + set("${outvar}" "${${outvar}}" PARENT_SCOPE) + endfunction(generate_pkg_config_path) + +-function(transform_pc_file INPUT_FILE OUTPUT_FILE VERSION) ++function(transform_pc_file INPUT_FILE OUTPUT_FILE VERSION SHARED_TARGET STATIC_TARGET) + file(READ ${INPUT_FILE} TEXT) + + set(PREFIX "${CMAKE_INSTALL_PREFIX}") +@@ -366,14 +366,21 @@ function(transform_pc_file INPUT_FILE OUTPUT_FILE VERSION) + + string(REGEX REPLACE "@PACKAGE_VERSION@" "${VERSION}" TEXT ${TEXT}) + ++ if(BUILD_SHARED_LIBS) ++ set(LIB_NAME "${SHARED_TARGET}") ++ else() ++ set(LIB_NAME "${STATIC_TARGET}") ++ endif() ++ string(REGEX REPLACE "@lib_name@" "${LIB_NAME}" TEXT ${TEXT}) ++ + file(WRITE ${OUTPUT_FILE} ${TEXT}) + endfunction() + +-transform_pc_file("scripts/libbrotlicommon.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/libbrotlicommon.pc" "${BROTLI_VERSION}") ++transform_pc_file("scripts/libbrotlicommon.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/libbrotlicommon.pc" "${BROTLI_VERSION}" brotlicommon brotlicommon-static) + +-transform_pc_file("scripts/libbrotlidec.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/libbrotlidec.pc" "${BROTLI_VERSION}") ++transform_pc_file("scripts/libbrotlidec.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/libbrotlidec.pc" "${BROTLI_VERSION}" brotlidec brotlidec-static) + +-transform_pc_file("scripts/libbrotlienc.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/libbrotlienc.pc" "${BROTLI_VERSION}") ++transform_pc_file("scripts/libbrotlienc.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/libbrotlienc.pc" "${BROTLI_VERSION}" brotlienc brotlienc-static) + + if(NOT BROTLI_BUNDLED_MODE) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libbrotlicommon.pc" +diff --git a/scripts/libbrotlicommon.pc.in b/scripts/libbrotlicommon.pc.in +index 2a8cf7a35..464a21292 100644 +--- a/scripts/libbrotlicommon.pc.in ++++ b/scripts/libbrotlicommon.pc.in +@@ -7,5 +7,5 @@ Name: libbrotlicommon + URL: https://github.com/google/brotli + Description: Brotli common dictionary library + Version: @PACKAGE_VERSION@ +-Libs: -L${libdir} -lbrotlicommon ++Libs: -L${libdir} -l@lib_name@ + Cflags: -I${includedir} +diff --git a/scripts/libbrotlidec.pc.in b/scripts/libbrotlidec.pc.in +index 6f8ef2e41..f87d3f65f 100644 +--- a/scripts/libbrotlidec.pc.in ++++ b/scripts/libbrotlidec.pc.in +@@ -7,6 +7,6 @@ Name: libbrotlidec + URL: https://github.com/google/brotli + Description: Brotli decoder library + Version: @PACKAGE_VERSION@ +-Libs: -L${libdir} -lbrotlidec ++Libs: -L${libdir} -l@lib_name@ + Requires.private: libbrotlicommon >= 1.0.2 + Cflags: -I${includedir} +diff --git a/scripts/libbrotlienc.pc.in b/scripts/libbrotlienc.pc.in +index 2098afe2c..7b6371bcb 100644 +--- a/scripts/libbrotlienc.pc.in ++++ b/scripts/libbrotlienc.pc.in +@@ -7,6 +7,6 @@ Name: libbrotlienc + URL: https://github.com/google/brotli + Description: Brotli encoder library + Version: @PACKAGE_VERSION@ +-Libs: -L${libdir} -lbrotlienc ++Libs: -L${libdir} -l@lib_name@ + Requires.private: libbrotlicommon >= 1.0.2 + Cflags: -I${includedir} diff --git a/ports/brotli/portfile.cmake b/ports/brotli/portfile.cmake index 6fa75937c1fce4..81960a9ee83ce7 100644 --- a/ports/brotli/portfile.cmake +++ b/ports/brotli/portfile.cmake @@ -7,6 +7,7 @@ vcpkg_from_github( PATCHES install.patch fix-arm-uwp.patch + pkgconfig.patch ) vcpkg_configure_cmake( @@ -21,6 +22,8 @@ vcpkg_copy_pdbs() vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/brotli) vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-brotli TARGET_PATH share/unofficial-brotli) +vcpkg_fixup_pkgconfig() + file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/unofficial-brotli) file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/cairo/CMakeLists.txt b/ports/cairo/CMakeLists.txt index 6470d8d09d5ab8..e333f304d23ce6 100644 --- a/ports/cairo/CMakeLists.txt +++ b/ports/cairo/CMakeLists.txt @@ -210,7 +210,7 @@ add_library(cairo ${SOURCES}) if (WITH_X11) target_compile_definitions(cairo PUBLIC -DCAIRO_HAS_XLIB_SURFACE=1) endif() - +target_include_directories(cairo PUBLIC ${FREETYPE_INCLUDE_DIRS}) target_link_libraries(cairo PRIVATE ZLIB::ZLIB PNG::PNG Freetype::Freetype unofficial::pixman::pixman-1 unofficial::fontconfig::fontconfig) if(WIN32) diff --git a/ports/cairo/CONTROL b/ports/cairo/CONTROL index 0eda86fac3f26b..6c26c77a250d5f 100644 --- a/ports/cairo/CONTROL +++ b/ports/cairo/CONTROL @@ -1,5 +1,6 @@ Source: cairo -Version: 1.16.0-6 +Version: 1.16.0 +Port-Version: 7 Homepage: https://cairographics.org Description: Cairo is a 2D graphics library with support for multiple output devices. Currently supported output targets include the X Window System (via both Xlib and XCB), Quartz, Win32, image buffers, PostScript, PDF, and SVG file output. Experimental backends include OpenGL, BeOS, OS/2, and DirectFB. Build-Depends: zlib, libpng, pixman, freetype, fontconfig diff --git a/ports/cairomm/CMakeLists.txt b/ports/cairomm/CMakeLists.txt index 1274a643167533..1cc02978601678 100644 --- a/ports/cairomm/CMakeLists.txt +++ b/ports/cairomm/CMakeLists.txt @@ -15,6 +15,7 @@ string(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" CAIROMM_MICRO_VERSION ${ message(STATUS "Ciaromm version: ${CAIROMM_MAJOR_VERSION}.${CAIROMM_MINOR_VERSION}.${CAIROMM_MICRO_VERSION}") find_package(Cairo REQUIRED) +find_package(Freetype REQUIRED) find_package(SigC++ REQUIRED) #configure @@ -87,7 +88,7 @@ set(cairomm_rc ${CMAKE_BINARY_DIR}/cairomm.rc) add_library(cairomm-1.0 ${cairomm_cc} ${cairomm_rc}) -target_link_libraries(cairomm-1.0 ${CAIRO_LIBRARY} ${SIGC++_LIBRARY} ) +target_link_libraries(cairomm-1.0 ${CAIRO_LIBRARY} ${SIGC++_LIBRARY} Freetype::Freetype) target_include_directories(cairomm-1.0 PRIVATE ${CAIRO_INCLUDE_DIR} ${SIGC++_INCLUDE_DIR} diff --git a/ports/cairomm/CONTROL b/ports/cairomm/CONTROL index e9d9d9b5fd1a7c..7a89c9ec1de468 100644 --- a/ports/cairomm/CONTROL +++ b/ports/cairomm/CONTROL @@ -1,5 +1,6 @@ Source: cairomm -Version: 1.15.3-4 +Version: 1.15.3 +Port-Version: 5 Homepage: https://www.cairographics.org Description: A C++ wrapper for the cairo graphics library Build-Depends: cairo, libsigcpp diff --git a/ports/freetype-gl/CONTROL b/ports/freetype-gl/CONTROL index 5419d6596b336c..a4081715e36f10 100644 --- a/ports/freetype-gl/CONTROL +++ b/ports/freetype-gl/CONTROL @@ -1,5 +1,6 @@ Source: freetype-gl -Version: 2019-03-29-3 +Version: 2019-03-29 +Port-Version: 4 Homepage: https://github.com/rougier/freetype-gl Description: OpenGL text using one vertex buffer, one texture and FreeType Build-Depends: glew, freetype diff --git a/ports/freetype-gl/glew.patch b/ports/freetype-gl/glew.patch new file mode 100644 index 00000000000000..01b7f616d9c940 --- /dev/null +++ b/ports/freetype-gl/glew.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1c2e89fba..9e2d112c4 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -92,7 +92,7 @@ include_directories( + ${OPENGL_INCLUDE_DIRS} + ${FREETYPE_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} +- ${GLEW_INCLUDE_PATH} ++ ${GLEW_INCLUDE_DIRS} + ) + + if(MSVC) diff --git a/ports/freetype-gl/portfile.cmake b/ports/freetype-gl/portfile.cmake index 5d931ced5d3b63..9dfd38719ae7b6 100644 --- a/ports/freetype-gl/portfile.cmake +++ b/ports/freetype-gl/portfile.cmake @@ -6,6 +6,7 @@ vcpkg_from_github( REF a91a3dda326ceaf66b7279bf64ba07014d3f81b8 SHA512 8e04573dfb400e14e2c1d3a2cd851a66f8218ccfdaa4f701ed9369d7f040d7028582e72af9b236af42d9d3c6c128014670e8ae0261c6f4770affd1aea1454b1e HEAD_REF master + PATCHES glew.patch ) # make sure that no "internal" libraries are used by removing them 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/brotli-static.patch b/ports/freetype/brotli-static.patch new file mode 100644 index 00000000000000..0e15648920ab7f --- /dev/null +++ b/ports/freetype/brotli-static.patch @@ -0,0 +1,21 @@ +diff --git a/builds/cmake/FindBrotliDec.cmake b/builds/cmake/FindBrotliDec.cmake +index 7c484c7df..0bd49b825 100644 +--- a/builds/cmake/FindBrotliDec.cmake ++++ b/builds/cmake/FindBrotliDec.cmake +@@ -34,14 +34,14 @@ find_path(BROTLIDEC_INCLUDE_DIRS + PATH_SUFFIXES brotli) + + find_library(BROTLIDEC_LIBRARIES +- NAMES brotlidec ++ NAMES brotlidec brotlidec-static + HINTS ${PC_BROTLIDEC_LIBDIR} + ${PC_BROTLIDEC_LIBRARY_DIRS}) + + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args( +- brotlidec ++ BrotliDec + REQUIRED_VARS BROTLIDEC_INCLUDE_DIRS BROTLIDEC_LIBRARIES + FOUND_VAR BROTLIDEC_FOUND + VERSION_VAR BROTLIDEC_VERSION) 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..f62f34728ffc9a 100644 --- a/ports/freetype/portfile.cmake +++ b/ports/freetype/portfile.cmake @@ -11,8 +11,9 @@ 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 + brotli-static.patch ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS @@ -28,41 +29,46 @@ 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} ) vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/freetype) +# Rename for easy usage (VS integration; CMake and autotools will not care) 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) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/freetype2) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - file(READ ${CURRENT_PACKAGES_DIR}/debug/share/freetype/freetype-config-debug.cmake DEBUG_MODULE) - string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" DEBUG_MODULE "${DEBUG_MODULE}") - string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${_IMPORT_PREFIX}" DEBUG_MODULE "${DEBUG_MODULE}") - file(WRITE ${CURRENT_PACKAGES_DIR}/share/freetype/freetype-config-debug.cmake "${DEBUG_MODULE}") -endif() +# Fix the include dir [freetype2 -> freetype] +file(READ ${CURRENT_PACKAGES_DIR}/share/freetype/freetype-config.cmake CONFIG_MODULE) +string(REPLACE "\${_IMPORT_PREFIX}/include/freetype2" "\${_IMPORT_PREFIX}/include" CONFIG_MODULE "${CONFIG_MODULE}") +string(REPLACE "\${_IMPORT_PREFIX}/lib/brotlidec-static.lib" [[\$<\$>:${_IMPORT_PREFIX}/lib/brotlidec-static.lib>;\$<\$:${_IMPORT_PREFIX}/debug/lib/brotlidec-static.lib>]] CONFIG_MODULE "${CONFIG_MODULE}") +string(REPLACE "\${_IMPORT_PREFIX}/lib/brotlidec.lib" [[\$<\$>:${_IMPORT_PREFIX}/lib/brotlidec.lib>;\$<\$:${_IMPORT_PREFIX}/debug/lib/brotlidec.lib>]] CONFIG_MODULE "${CONFIG_MODULE}") +string(REPLACE "\${_IMPORT_PREFIX}/lib/brotlidec.lib" [[\$<\$>:${_IMPORT_PREFIX}/lib/brotlidec.lib>;\$<\$:${_IMPORT_PREFIX}/debug/lib/brotlidec.lib>]] CONFIG_MODULE "${CONFIG_MODULE}") +file(WRITE ${CURRENT_PACKAGES_DIR}/share/freetype/freetype-config.cmake "${CONFIG_MODULE}") -if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") - file(READ ${CURRENT_PACKAGES_DIR}/share/freetype/freetype-config-release.cmake RELEASE_MODULE) - string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${_IMPORT_PREFIX}" RELEASE_MODULE "${RELEASE_MODULE}") - file(WRITE ${CURRENT_PACKAGES_DIR}/share/freetype/freetype-config-release.cmake "${RELEASE_MODULE}") +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") + file(READ "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/freetype2.pc" _contents) + if(FREETYPE_DEBUG) + string(REPLACE "-lfreetype" "-lfreetyped" _contents "${_contents}") + endif() + string(REPLACE "-I\${includedir}/freetype2" "-I\${includedir}" _contents "${_contents}") + file(WRITE "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/freetype2.pc" "${_contents}") endif() - -# Fix the include dir [freetype2 -> freetype] -if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - file(READ ${CURRENT_PACKAGES_DIR}/debug/share/freetype/freetype-config.cmake CONFIG_MODULE) -else() #if(VCPKG_BUILD_TYPE STREQUAL "release") - file(READ ${CURRENT_PACKAGES_DIR}/share/freetype/freetype-config.cmake CONFIG_MODULE) +if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/freetype2.pc") + file(READ "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/freetype2.pc" _contents) + string(REPLACE "-I\${includedir}/freetype2" "-I\${includedir}" _contents "${_contents}") + file(WRITE "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/freetype2.pc" "${_contents}") 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}") +vcpkg_fixup_pkgconfig() +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) file(COPY diff --git a/ports/freetype/vcpkg-cmake-wrapper.cmake b/ports/freetype/vcpkg-cmake-wrapper.cmake index 01da0b1dc271fb..355ddbcf575eeb 100644 --- a/ports/freetype/vcpkg-cmake-wrapper.cmake +++ b/ports/freetype/vcpkg-cmake-wrapper.cmake @@ -10,6 +10,14 @@ if(@USE_PNG@) find_package(PNG) endif() +find_library(BROTLIDEC_LIBRARY_RELEASE NAMES brotlidec brotlidec-static PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" PATH_SUFFIXES lib NO_DEFAULT_PATH) +find_library(BROTLIDEC_LIBRARY_DEBUG NAMES brotlidec brotlidec-static brotlidecd brotlidec-staticd PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" PATH_SUFFIXES lib NO_DEFAULT_PATH) +find_library(BROTLICOMMON_LIBRARY_RELEASE NAMES brotlicommon brotlicommon-static PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" PATH_SUFFIXES lib NO_DEFAULT_PATH) +find_library(BROTLICOMMON_LIBRARY_DEBUG NAMES brotlicommon brotlicommon-static brotlicommond brotlicommon-staticd PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" PATH_SUFFIXES lib NO_DEFAULT_PATH) +include(SelectLibraryConfigurations) +select_library_configurations(BROTLIDEC) +select_library_configurations(BROTLICOMMON) + if(TARGET Freetype::Freetype) set_property(TARGET Freetype::Freetype APPEND PROPERTY INTERFACE_LINK_LIBRARIES ZLIB::ZLIB) @@ -20,6 +28,7 @@ if(TARGET Freetype::Freetype) if(@USE_PNG@) set_property(TARGET Freetype::Freetype APPEND PROPERTY INTERFACE_LINK_LIBRARIES PNG::PNG) endif() + target_link_libraries(Freetype::Freetype INTERFACE ${BROTLIDEC_LIBRARIES} ${BROTLICOMMON_LIBRARIES}) endif() if(FREETYPE_LIBRARIES) @@ -32,4 +41,6 @@ if(FREETYPE_LIBRARIES) if(@USE_PNG@) list(APPEND FREETYPE_LIBRARIES ${PNG_LIBRARIES}) endif() + + list(APPEND FREETYPE_LIBRARIES ${BROTLIDEC_LIBRARIES} ${BROTLICOMMON_LIBRARIES}) endif() diff --git a/ports/libass/CMakeLists.txt b/ports/libass/CMakeLists.txt index 7345e515fc949b..2db910d272aa62 100644 --- a/ports/libass/CMakeLists.txt +++ b/ports/libass/CMakeLists.txt @@ -42,6 +42,9 @@ find_path(HARFBUZZ_INCLUDE_DIR NAMES hb.h PATH_SUFFIXES harfbuzz) +find_path(DIRENT_INCLUDE_DIR + NAMES dirent.h) + find_library(FRIBIDI_LIBRARY NAMES fribidi) find_library(HARFBUZZ_LIBRARY NAMES harfbuzz) @@ -50,7 +53,10 @@ add_library(ass ${SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/libass.def) target_include_directories(ass PRIVATE ${FRIBIDI_INCLUDE_DIR} ${HARFBUZZ_INCLUDE_DIR}) - +if(DIRENT_INCLUDE_DIR) + target_include_directories(ass PRIVATE + ${DIRENT_INCLUDE_DIR}) +endif() target_link_libraries(ass PRIVATE Freetype::Freetype ${FRIBIDI_LIBRARY} diff --git a/ports/libass/CONTROL b/ports/libass/CONTROL index 3c11a9e9ca0b5d..3e886403a234a6 100644 --- a/ports/libass/CONTROL +++ b/ports/libass/CONTROL @@ -1,5 +1,5 @@ Source: libass Version: 0.14.0 -Port-Version: 1 +Port-Version: 2 Build-Depends: freetype, fribidi, harfbuzz, dirent (windows) Description: libass is a portable subtitle renderer for the ASS/SSA (Advanced Substation Alpha/Substation Alpha) subtitle format. diff --git a/ports/libraqm/CMakeLists.txt b/ports/libraqm/CMakeLists.txt index 22f4e59d9d98d0..9ad1db64a6bc86 100644 --- a/ports/libraqm/CMakeLists.txt +++ b/ports/libraqm/CMakeLists.txt @@ -11,7 +11,7 @@ find_package(harfbuzz CONFIG REQUIRED) find_path(HARFBUZZ_INCLUDE_DIRS NAMES hb.h PATH_SUFFIXES harfbuzz) -find_path(FREETYPE_ADDITIONAL_INCLUDE_DIRS NAMES ft2build.h) +find_path(FREETYPE_ADDITIONAL_INCLUDE_DIRS NAMES ft2build.h PATH_SUFFIXES freetype2) configure_file(src/raqm-version.h.in src/raqm-version.h) diff --git a/ports/libraqm/CONTROL b/ports/libraqm/CONTROL index d768af76f72dda..460e66c1676a97 100644 --- a/ports/libraqm/CONTROL +++ b/ports/libraqm/CONTROL @@ -1,4 +1,5 @@ Source: libraqm -Version: 0.7.0-1 +Version: 0.7.0 +Port-Version: 2 Description: A library for complex text layout Build-Depends: freetype, harfbuzz, fribidi \ No newline at end of file diff --git a/ports/pango/CMakeLists.txt b/ports/pango/CMakeLists.txt index 5fdd730ba79ee4..127b92319c7dce 100644 --- a/ports/pango/CMakeLists.txt +++ b/ports/pango/CMakeLists.txt @@ -49,11 +49,7 @@ find_path(FONTCONFIG_INCLUDE_DIR fontconfig/fontconfig.h) find_library(FONTCONFIG_LIBRARY fontconfig) # find freetype -find_path(FREETYPE_INCLUDE_DIR ft2build.h) -if(CMAKE_BUILD_TYPE STREQUAL Debug) - set(FT_SUFFIX d) -endif() -find_library(FREETYPE_LIBRARY freetype${FT_SUFFIX}) +find_package(Freetype REQUIRED) # find harfbuzz find_path(HARFBUZZ_INCLUDE_DIR harfbuzz/hb.h) @@ -65,7 +61,7 @@ if (APPLE) endif() set(FONT_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIR} ${FONTCONFIG_INCLUDE_DIR} ${HARFBUZZ_INCLUDE_DIR}/harfbuzz) -set(FONT_LIBRARIES ${FREETYPE_LIBRARY} ${FONTCONFIG_LIBRARY} ${HARFBUZZ_LIBRARY}) +set(FONT_LIBRARIES Freetype::Freetype ${FONTCONFIG_LIBRARY} ${HARFBUZZ_LIBRARY}) macro(pango_add_module MODULE_NAME) add_library(${MODULE_NAME} ${ARGN}) diff --git a/ports/pango/CONTROL b/ports/pango/CONTROL index 2e1d6679e44832..cea8f146423d8e 100644 --- a/ports/pango/CONTROL +++ b/ports/pango/CONTROL @@ -1,5 +1,6 @@ Source: pango -Version: 1.40.11-7 +Version: 1.40.11 +Port-Version: 8 Homepage: https://ftp.gnome.org/pub/GNOME/sources/pango/ Description: Text and font handling library. Build-Depends: glib, gettext, cairo[gobject], fontconfig, freetype, harfbuzz[glib] (!(windows&static)&!osx) diff --git a/ports/podofo/CONTROL b/ports/podofo/CONTROL index a6965d832de761..933f7363fc410d 100644 --- a/ports/podofo/CONTROL +++ b/ports/podofo/CONTROL @@ -1,5 +1,6 @@ Source: podofo -Version: 0.9.6-11 +Version: 0.9.6 +Port-Version: 12 Homepage: https://sourceforge.net/projects/podofo/ Description: PoDoFo is a library to work with the PDF file format Build-Depends: zlib, libpng, libjpeg-turbo, tiff, openssl, freetype diff --git a/ports/podofo/freetype.patch b/ports/podofo/freetype.patch new file mode 100644 index 00000000000000..f241690f719136 --- /dev/null +++ b/ports/podofo/freetype.patch @@ -0,0 +1,18 @@ +diff --git a/cmake/modules/FindFREETYPE.cmake b/cmake/modules/FindFREETYPE.cmake +index 41114798f..0911dc092 100644 +--- a/cmake/modules/FindFREETYPE.cmake ++++ b/cmake/modules/FindFREETYPE.cmake +@@ -15,9 +15,13 @@ SET(FREETYPE_FIND_QUIETLY 1) + # first we try to find ft2build.h in the new location as + # of freetype 2.5.1 + FIND_PATH(FREETYPE_INCLUDE_DIR_FT2BUILD ft2build.h ++ PATHS + /usr/include/freetype2 + /usr/local/include/freetype2 + /usr/X11/include/freetype2 ++ PATH_SUFFIXES ++ freetype2 ++ include/freetype2 + NO_CMAKE_SYSTEM_PATH + ) + diff --git a/ports/podofo/portfile.cmake b/ports/podofo/portfile.cmake index d9b34614a8c2e6..36bd2c48e4cd50 100644 --- a/ports/podofo/portfile.cmake +++ b/ports/podofo/portfile.cmake @@ -13,6 +13,7 @@ vcpkg_from_sourceforge( PATCHES 0001-unique_ptr.patch 0002-HAVE_UNISTD_H.patch + freetype.patch ${ADDITIONAL_PATCH} ) diff --git a/ports/qt5-base/portfile.cmake b/ports/qt5-base/portfile.cmake index 9d0f0bad480585..1044df3174644f 100644 --- a/ports/qt5-base/portfile.cmake +++ b/ports/qt5-base/portfile.cmake @@ -130,6 +130,13 @@ find_library(HARFBUZZ_DEBUG NAMES harfbuzz PATHS "${CURRENT_INSTALLED_DIR}/debug find_library(SQLITE_RELEASE NAMES sqlite3 PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) # Depends on openssl and zlib(linux) find_library(SQLITE_DEBUG NAMES sqlite3 sqlite3d PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) +find_library(BROTLI_COMMON_RELEASE NAMES brotlicommon brotlicommon-static PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) +find_library(BROTLI_COMMON_DEBUG NAMES brotlicommon brotlicommon-static brotlicommond brotlicommon-staticd PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) +find_library(BROTLI_DEC_RELEASE NAMES brotlidec brotlidec-static PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) +find_library(BROTLI_DEC_DEBUG NAMES brotlidec brotlidec-static brotlidecd brotlidec-staticd PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) +find_library(BROTLI_ENC_RELEASE NAMES brotlienc brotlienc-static PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) +find_library(BROTLI_ENC_DEBUG NAMES brotlienc brotlienc-static brotliencd brotlienc-staticd PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) + find_library(ICUUC_RELEASE NAMES icuuc libicuuc PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) find_library(ICUUC_DEBUG NAMES icuucd libicuucd icuuc libicuuc PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) find_library(ICUTU_RELEASE NAMES icutu libicutu PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) @@ -166,8 +173,8 @@ find_library(SSL_DEBUG ssl ssleay32 ssld ssleay32d PATHS "${CURRENT_INSTALLED_DI find_library(EAY_RELEASE libeay32 crypto libcrypto PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) find_library(EAY_DEBUG libeay32 crypto libcrypto libeay32d cryptod libcryptod PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) -set(FREETYPE_RELEASE_ALL "${FREETYPE_RELEASE} ${BZ2_RELEASE} ${LIBPNG_RELEASE} ${ZLIB_RELEASE}") -set(FREETYPE_DEBUG_ALL "${FREETYPE_DEBUG} ${BZ2_DEBUG} ${LIBPNG_DEBUG} ${ZLIB_DEBUG}") +set(FREETYPE_RELEASE_ALL "${FREETYPE_RELEASE} ${BZ2_RELEASE} ${LIBPNG_RELEASE} ${ZLIB_RELEASE} ${BROTLI_ENC_RELEASE} ${BROTLI_DEC_RELEASE} ${BROTLI_COMMON_RELEASE}") +set(FREETYPE_DEBUG_ALL "${FREETYPE_DEBUG} ${BZ2_DEBUG} ${LIBPNG_DEBUG} ${ZLIB_DEBUG} ${BROTLI_ENC_DEBUG} ${BROTLI_DEC_DEBUG} ${BROTLI_COMMON_RELEASE}") # If HarfBuzz is built with GLib enabled, it must be statically link set(GLIB_LIB_VERSION 2.0) diff --git a/ports/sfml/CONTROL b/ports/sfml/CONTROL index 6f46156a93519e..836280f8bb795c 100644 --- a/ports/sfml/CONTROL +++ b/ports/sfml/CONTROL @@ -1,5 +1,6 @@ Source: sfml -Version: 2.5.1-7 +Version: 2.5.1 +Port-Version: 8 Homepage: https://github.com/sfml/sfml Description: Simple and fast multimedia library Build-Depends: freetype, libflac, libogg, libvorbis, openal-soft, stb diff --git a/ports/sfml/portfile.cmake b/ports/sfml/portfile.cmake index efbcdd135912d0..82f6e11d15b524 100644 --- a/ports/sfml/portfile.cmake +++ b/ports/sfml/portfile.cmake @@ -5,6 +5,7 @@ vcpkg_from_github(OUT_SOURCE_PATH SOURCE_PATH SHA512 7aed2fc29d1da98e6c4d598d5c86cf536cb4eb5c2079cdc23bb8e502288833c052579dadbe0ce13ad6461792d959bf6d9660229f54c54cf90a541c88c6b03d59 PATCHES use-system-freetype.patch + stb_include.patch ) file(REMOVE_RECURSE ${SOURCE_PATH}/extlibs) diff --git a/ports/sfml/stb_include.patch b/ports/sfml/stb_include.patch new file mode 100644 index 00000000000000..3519b1c1e61233 --- /dev/null +++ b/ports/sfml/stb_include.patch @@ -0,0 +1,14 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e821a49bc..c68264ef2 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -188,6 +188,9 @@ if(SFML_USE_SYSTEM_DEPS) + endforeach() + + list(REMOVE_DUPLICATES CMAKE_IGNORE_PATH) ++ ++ find_path(STB_INCLUDE_DIR stb.h) ++ include_directories(${STB_INCLUDE_DIR}) + endif() + + # Visual C++: remove warnings regarding SL security and algorithms on pointers