mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-26 01:30:55 +08:00
[fontconfig] Add features, fix emscripten (#42699)
This commit is contained in:
parent
c26eabb239
commit
00bd5c4aa5
13
ports/fontconfig/emscripten.diff
Normal file
13
ports/fontconfig/emscripten.diff
Normal 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]
|
@ -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")
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2886,7 +2886,7 @@
|
||||
},
|
||||
"fontconfig": {
|
||||
"baseline": "2.15.0",
|
||||
"port-version": 1
|
||||
"port-version": 2
|
||||
},
|
||||
"foonathan-lexy": {
|
||||
"baseline": "2022.12.1",
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "4e1bd69ece93d01f14f3f78da93cfeca0f7e8b5f",
|
||||
"version": "2.15.0",
|
||||
"port-version": 2
|
||||
},
|
||||
{
|
||||
"git-tree": "443f2cc8005cd715e8786521c1c2cd990a1320a8",
|
||||
"version": "2.15.0",
|
||||
|
Loading…
x
Reference in New Issue
Block a user