[fontconfig] Add features, fix emscripten (#42699)

This commit is contained in:
Kai Pastor 2024-12-16 17:08:15 +01:00 committed by GitHub
parent c26eabb239
commit 00bd5c4aa5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 84 additions and 17 deletions

View File

@ -0,0 +1,13 @@
diff --git a/meson.build b/meson.build
index 08d9532..37cc195 100644
--- a/meson.build
+++ b/meson.build
@@ -289,7 +289,7 @@ if fc_cachedir in ['yes', 'no', 'default']
endif
endif
-if host_machine.system() != 'windows'
+if host_machine.system() != 'windows' and host_machine.system() != 'emscripten'
thread_dep = dependency('threads')
conf.set('HAVE_PTHREAD', 1)
deps += [thread_dep]

View File

@ -6,20 +6,34 @@ vcpkg_from_gitlab(
SHA512 daa6d1e6058e12c694d9e1512e09be957ff7f3fa375246b9d13eb0a8cf2f21e1512a5cabe93f270e96790e2c20420bf7422d213e43ab9749da3255286ea65a7c
HEAD_REF master
PATCHES
emscripten.diff
no-etc-symlinks.patch
libgetopt.patch
fix-wasm-shared-memory-atomics.patch
)
vcpkg_add_to_path(PREPEND "${CURRENT_HOST_INSTALLED_DIR}/tools/gperf")
set(options "")
if("nls" IN_LIST FEATURES)
list(APPEND options "-Dnls=enabled")
else()
list(APPEND options "-Dnls=disabled")
endif()
if("tools" IN_LIST FEATURES)
list(APPEND options "-Dtools=enabled")
else()
list(APPEND options "-Dtools=disabled")
endif()
vcpkg_configure_meson(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
${options}
-Ddoc=disabled
-Dcache-build=disabled
-Diconv=enabled
-Dtests=disabled
ADDITIONAL_BINARIES
"gperf = ['${CURRENT_HOST_INSTALLED_DIR}/tools/gperf/gperf${VCPKG_HOST_EXECUTABLE_SUFFIX}']"
)
# https://www.freedesktop.org/software/fontconfig/fontconfig-user.html
@ -42,7 +56,7 @@ vcpkg_install_meson(ADD_BIN_TO_PATH)
vcpkg_copy_pdbs()
#Fix missing libintl static dependency
if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
if("nls" IN_LIST FEATURES AND VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
if(NOT VCPKG_BUILD_TYPE)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/fontconfig.pc" "-liconv" "-liconv -lintl" IGNORE_UNCHANGED)
endif()
@ -83,11 +97,13 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
endforeach()
endif()
vcpkg_copy_tools(
TOOL_NAMES fc-match fc-cat fc-list fc-pattern fc-query fc-scan fc-cache fc-validate fc-conflist
AUTO_CLEAN
)
if("tools" IN_LIST FEATURES)
vcpkg_copy_tools(
TOOL_NAMES fc-match fc-cat fc-list fc-pattern fc-query fc-scan fc-cache fc-validate fc-conflist
AUTO_CLEAN
)
endif()
configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake.in" "${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake" @ONLY)
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")

View File

@ -1,4 +1,9 @@
fontconfig is compatible with built-in CMake targets:
find_package(Fontconfig REQUIRED) # since CMake 3.14
target_link_libraries(main PRIVATE Fontconfig::Fontconfig)
find_package(Fontconfig REQUIRED) # since CMake 3.14
target_link_libraries(main PRIVATE Fontconfig::Fontconfig)
fontconfig provides pkg-config modules:
# Font configuration and customization library
fontconfig

View File

@ -1,16 +1,18 @@
{
"name": "fontconfig",
"version": "2.15.0",
"port-version": 1,
"port-version": 2,
"description": "Library for configuring and customizing font access.",
"homepage": "https://www.freedesktop.org/wiki/Software/fontconfig",
"license": "MIT",
"supports": "!uwp",
"dependencies": [
"dirent",
"expat",
"freetype",
"getopt",
"gettext",
{
"name": "freetype",
"default-features": false
},
{
"name": "gperf",
"host": true
@ -21,12 +23,38 @@
},
{
"name": "libuuid",
"platform": "!windows & !osx & !mingw"
"platform": "!osx & !windows"
},
{
"name": "pthread",
"platform": "!emscripten & !windows"
},
"pthread",
{
"name": "vcpkg-tool-meson",
"host": true
}
]
],
"features": {
"nls": {
"description": "Native languages support",
"dependencies": [
{
"name": "gettext",
"host": true,
"default-features": false,
"features": [
"tools"
]
},
"gettext-libintl"
]
},
"tools": {
"description": "Build tools",
"supports": "!emscripten",
"dependencies": [
"getopt"
]
}
}
}

View File

@ -2886,7 +2886,7 @@
},
"fontconfig": {
"baseline": "2.15.0",
"port-version": 1
"port-version": 2
},
"foonathan-lexy": {
"baseline": "2022.12.1",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "4e1bd69ece93d01f14f3f78da93cfeca0f7e8b5f",
"version": "2.15.0",
"port-version": 2
},
{
"git-tree": "443f2cc8005cd715e8786521c1c2cd990a1320a8",
"version": "2.15.0",