From 7fd8104024d1fd8d9d191692382898f7ac63a183 Mon Sep 17 00:00:00 2001 From: Peter Steneteg Date: Thu, 3 Sep 2020 20:12:53 +0200 Subject: [PATCH] [freetype] static build fix (#13250) --- ports/freetype/CONTROL | 2 +- ports/freetype/brotli-static.patch | 50 +++++++++++++++++------------- ports/freetype/portfile.cmake | 10 +++--- 3 files changed, 36 insertions(+), 26 deletions(-) diff --git a/ports/freetype/CONTROL b/ports/freetype/CONTROL index 072382ebcf..eb2b102727 100644 --- a/ports/freetype/CONTROL +++ b/ports/freetype/CONTROL @@ -1,6 +1,6 @@ Source: freetype Version: 2.10.2 -Port-Version: 3 +Port-Version: 4 Build-Depends: zlib, brotli Homepage: https://www.freetype.org/ Description: A library to render fonts. diff --git a/ports/freetype/brotli-static.patch b/ports/freetype/brotli-static.patch index 0e15648920..1635311ade 100644 --- a/ports/freetype/brotli-static.patch +++ b/ports/freetype/brotli-static.patch @@ -1,21 +1,29 @@ -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/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,22 @@ 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}) + ++find_library(BROTLICOMMON_LIBRARIES ++ NAMES brotlicommon-static ++ HINTS ${PC_BROTLIDEC_LIBDIR} ++ ${PC_BROTLIDEC_LIBRARY_DIRS}) ++ ++if(BROTLICOMMON_LIBRARIES) ++ set(BROTLIDEC_LIBRARIES ${BROTLIDEC_LIBRARIES} ${BROTLICOMMON_LIBRARIES}) ++endif() + + 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/portfile.cmake b/ports/freetype/portfile.cmake index b0152b31c5..ed8cbcbf3f 100644 --- a/ports/freetype/portfile.cmake +++ b/ports/freetype/portfile.cmake @@ -47,6 +47,7 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # 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/brotlicommon-static.lib" [[\$<\$>:${_IMPORT_PREFIX}/lib/brotlicommon-static.lib>;\$<\$:${_IMPORT_PREFIX}/debug/lib/brotlicommon-static.lib>]] 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}") @@ -72,12 +73,12 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) file(COPY - ${SOURCE_PATH}/docs/LICENSE.TXT ${SOURCE_PATH}/docs/FTL.TXT ${SOURCE_PATH}/docs/GPLv2.TXT - DESTINATION ${CURRENT_PACKAGES_DIR}/share/freetype + DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} ) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/freetype/LICENSE.TXT ${CURRENT_PACKAGES_DIR}/share/freetype/copyright) +file(INSTALL ${SOURCE_PATH}/docs/LICENSE.TXT DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) + vcpkg_copy_pdbs() if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") @@ -89,5 +90,6 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") set(USE_PNG ON) endif() - configure_file(${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake ${CURRENT_PACKAGES_DIR}/share/freetype/vcpkg-cmake-wrapper.cmake @ONLY) + configure_file(${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake + ${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake @ONLY) endif()