[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 SHA512 daa6d1e6058e12c694d9e1512e09be957ff7f3fa375246b9d13eb0a8cf2f21e1512a5cabe93f270e96790e2c20420bf7422d213e43ab9749da3255286ea65a7c
HEAD_REF master HEAD_REF master
PATCHES PATCHES
emscripten.diff
no-etc-symlinks.patch no-etc-symlinks.patch
libgetopt.patch libgetopt.patch
fix-wasm-shared-memory-atomics.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( vcpkg_configure_meson(
SOURCE_PATH "${SOURCE_PATH}" SOURCE_PATH "${SOURCE_PATH}"
OPTIONS OPTIONS
${options}
-Ddoc=disabled -Ddoc=disabled
-Dcache-build=disabled -Dcache-build=disabled
-Diconv=enabled -Diconv=enabled
-Dtests=disabled -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 # https://www.freedesktop.org/software/fontconfig/fontconfig-user.html
@ -42,7 +56,7 @@ vcpkg_install_meson(ADD_BIN_TO_PATH)
vcpkg_copy_pdbs() vcpkg_copy_pdbs()
#Fix missing libintl static dependency #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) if(NOT VCPKG_BUILD_TYPE)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/fontconfig.pc" "-liconv" "-liconv -lintl" IGNORE_UNCHANGED) vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/fontconfig.pc" "-liconv" "-liconv -lintl" IGNORE_UNCHANGED)
endif() endif()
@ -83,11 +97,13 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
endforeach() endforeach()
endif() endif()
vcpkg_copy_tools( if("tools" IN_LIST FEATURES)
TOOL_NAMES fc-match fc-cat fc-list fc-pattern fc-query fc-scan fc-cache fc-validate fc-conflist vcpkg_copy_tools(
AUTO_CLEAN 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) 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 "${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: fontconfig is compatible with built-in CMake targets:
find_package(Fontconfig REQUIRED) # since CMake 3.14 find_package(Fontconfig REQUIRED) # since CMake 3.14
target_link_libraries(main PRIVATE Fontconfig::Fontconfig) 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", "name": "fontconfig",
"version": "2.15.0", "version": "2.15.0",
"port-version": 1, "port-version": 2,
"description": "Library for configuring and customizing font access.", "description": "Library for configuring and customizing font access.",
"homepage": "https://www.freedesktop.org/wiki/Software/fontconfig", "homepage": "https://www.freedesktop.org/wiki/Software/fontconfig",
"license": "MIT", "license": "MIT",
"supports": "!uwp",
"dependencies": [ "dependencies": [
"dirent", "dirent",
"expat", "expat",
"freetype", {
"getopt", "name": "freetype",
"gettext", "default-features": false
},
{ {
"name": "gperf", "name": "gperf",
"host": true "host": true
@ -21,12 +23,38 @@
}, },
{ {
"name": "libuuid", "name": "libuuid",
"platform": "!windows & !osx & !mingw" "platform": "!osx & !windows"
},
{
"name": "pthread",
"platform": "!emscripten & !windows"
}, },
"pthread",
{ {
"name": "vcpkg-tool-meson", "name": "vcpkg-tool-meson",
"host": true "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": { "fontconfig": {
"baseline": "2.15.0", "baseline": "2.15.0",
"port-version": 1 "port-version": 2
}, },
"foonathan-lexy": { "foonathan-lexy": {
"baseline": "2022.12.1", "baseline": "2022.12.1",

View File

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