[harfbuzz,pango,pangomm] Pass C++ linkage, unlock cross builds (#44050)

This commit is contained in:
Kai Pastor 2025-03-06 19:28:22 +01:00 committed by GitHub
parent 344897aae5
commit 3332ad6b50
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 70 additions and 22 deletions

View File

@ -69,6 +69,18 @@ else()
set(GIR_TOOL_DIR ${CURRENT_HOST_INSTALLED_DIR})
endif()
set(cxx_link_libraries "")
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
block(PROPAGATE cxx_link_libraries)
vcpkg_list(APPEND VCPKG_CMAKE_CONFIGURE_OPTIONS "-DVCPKG_DEFAULT_VARS_TO_CHECK=CMAKE_C_IMPLICIT_LINK_LIBRARIES;CMAKE_CXX_IMPLICIT_LINK_LIBRARIES")
vcpkg_cmake_get_vars(cmake_vars_file)
include("${cmake_vars_file}")
list(REMOVE_ITEM VCPKG_DETECTED_CMAKE_CXX_IMPLICIT_LINK_LIBRARIES ${VCPKG_DETECTED_CMAKE_C_IMPLICIT_LINK_LIBRARIES})
list(TRANSFORM VCPKG_DETECTED_CMAKE_CXX_IMPLICIT_LINK_LIBRARIES PREPEND "-l")
string(JOIN " " cxx_link_libraries ${VCPKG_DETECTED_CMAKE_CXX_IMPLICIT_LINK_LIBRARIES})
endblock()
endif()
vcpkg_configure_meson(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
@ -92,19 +104,34 @@ vcpkg_install_meson(ADD_BIN_TO_PATH)
vcpkg_copy_pdbs()
vcpkg_fixup_pkgconfig()
if(cxx_link_libraries)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/harfbuzz.pc"
"(Libs:[^\r\n]*)"
"\\1 ${cxx_link_libraries}"
REGEX
)
if(NOT VCPKG_BUILD_TYPE)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/harfbuzz.pc"
"(Libs:[^\r\n]*)"
"\\1 ${cxx_link_libraries}"
REGEX
)
endif()
endif()
if(VCPKG_TARGET_IS_WINDOWS)
file(GLOB PC_FILES
"${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/*.pc"
"${CURRENT_PACKAGES_DIR}/lib/pkgconfig/*.pc")
foreach(PC_FILE IN LISTS PC_FILES)
file(READ "${PC_FILE}" PC_FILE_CONTENT)
string(REGEX REPLACE
"\\$\\{prefix\}\\/lib\\/([a-zA-Z0-9\-]*)\\.lib"
"-l\\1" PC_FILE_CONTENT
"${PC_FILE_CONTENT}")
file(WRITE "${PC_FILE}" ${PC_FILE_CONTENT})
endforeach()
file(GLOB pc_files
"${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/*.pc"
"${CURRENT_PACKAGES_DIR}/lib/pkgconfig/*.pc"
)
foreach(pc_file IN LISTS pc_files)
vcpkg_replace_string("${pc_file}"
"\\$\\{prefix\}\\/lib\\/([a-zA-Z0-9\-]*)\\.lib"
"-l\\1"
REGEX
IGNORE_UNCHANGED
)
endforeach()
endif()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib/cmake")

View File

@ -1,4 +1,15 @@
The harfbuzz package provides CMake targets:
harfbuzz provides CMake targets:
find_package(harfbuzz CONFIG REQUIRED)
target_link_libraries(main PRIVATE harfbuzz::harfbuzz harfbuzz::harfbuzz-subset)
find_package(harfbuzz CONFIG REQUIRED)
# HarfBuzz font subsetter
target_link_libraries(main PRIVATE harfbuzz::harfbuzz-subset)
# HarfBuzz text shaping library
target_link_libraries(main PRIVATE harfbuzz::harfbuzz)
harfbuzz provides pkg-config modules:
# HarfBuzz font subsetter
harfbuzz-subset
# HarfBuzz text shaping library
harfbuzz

View File

@ -1,7 +1,7 @@
{
"name": "harfbuzz",
"version": "10.2.0",
"port-version": 2,
"port-version": 3,
"description": "HarfBuzz OpenType text shaping engine",
"homepage": "https://github.com/harfbuzz/harfbuzz",
"license": "MIT-Modern-Variant",

View File

@ -1,10 +1,11 @@
{
"name": "pangomm",
"version": "2.56.1",
"port-version": 1,
"description": "pangomm is the official C++ interface for the Pango font layout library. See, for instance, the Pango::Layout class.",
"homepage": "https://gitlab.gnome.org/GNOME/pangomm",
"license": "LGPL-2.1-or-later",
"supports": "!(arm | xbox)",
"supports": "!xbox",
"dependencies": [
"cairo",
"cairomm",

View File

@ -855,9 +855,6 @@ orc:arm64-android=fail
orc:x64-android=fail
paho-mqtt:arm64-uwp=fail
paho-mqtt:x64-uwp=fail
pango:arm-neon-android=fail
pango:arm64-android=fail
pango:x64-android=fail
pcl:x64-android=fail
pdal:arm-neon-android=fail
pdal:arm64-android=fail
@ -868,8 +865,10 @@ platform-folders:x64-uwp=fail
plib:arm-neon-android=fail
plib:arm64-android=fail
plib:x64-android=fail
plplot:arm64-android=fail
plplot:arm64-windows-static-md=fail
plplot:arm64-windows=fail
plplot:x64-android=fail
pmdk:x64-android=fail
pmdk:x64-osx=fail
pmdk:x64-windows-static=fail

View File

@ -3506,7 +3506,7 @@
},
"harfbuzz": {
"baseline": "10.2.0",
"port-version": 2
"port-version": 3
},
"hash-library": {
"baseline": "8",
@ -6950,7 +6950,7 @@
},
"pangomm": {
"baseline": "2.56.1",
"port-version": 0
"port-version": 1
},
"parallel-hashmap": {
"baseline": "2.0.0",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "0301a6b19f106c2ce2c86b59437a146d7d2752bc",
"version": "10.2.0",
"port-version": 3
},
{
"git-tree": "e877500fd52227ef36b3137d281f6fb313770b3d",
"version": "10.2.0",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "e0f966aee7c1c84ddea9108c7a58ec821d3d8457",
"version": "2.56.1",
"port-version": 1
},
{
"git-tree": "32d7b5a60ba2a7df9c252ee9d848bf9cdc6dc48b",
"version": "2.56.1",