Skip to content

Commit ae8fa5a

Browse files
dg0ytSchaichAlonso
andauthored
[fontconfig] Update to 2.17.1 (#48484)
Co-authored-by: Schaich, Alonso <[email protected]>
1 parent 675847c commit ae8fa5a

File tree

9 files changed

+178
-147
lines changed

9 files changed

+178
-147
lines changed

ports/fontconfig/dllexport.diff

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
diff --git a/fontconfig/fontconfig.h.in b/fontconfig/fontconfig.h.in
2+
index e8944f9..a76230b 100644
3+
--- a/fontconfig/fontconfig.h.in
4+
+++ b/fontconfig/fontconfig.h.in
5+
@@ -39,7 +39,7 @@
6+
#endif
7+
8+
#ifndef FcPublic
9+
-# define FcPublic
10+
+# define FcPublic @DEFAULT_FCPUBLIC@
11+
#endif
12+
13+
typedef unsigned char FcChar8;
14+
diff --git a/fontconfig/meson.build b/fontconfig/meson.build
15+
index 1ad1e58..1d9ac14 100644
16+
--- a/fontconfig/meson.build
17+
+++ b/fontconfig/meson.build
18+
@@ -1,5 +1,14 @@
19+
fontconfig_h_conf = configuration_data()
20+
fontconfig_h_conf.set('CACHE_VERSION', cacheversion)
21+
+default_FcPublic = ''
22+
+if get_option('default_library') != 'static'
23+
+ if host_machine.system() == 'windows'
24+
+ default_FcPublic = '__declspec(dllimport)'
25+
+ else
26+
+ default_FcPublic = '__attribute__((visibility(\"default\")))'
27+
+ endif
28+
+endif
29+
+fontconfig_h_conf.set('DEFAULT_FCPUBLIC', default_FcPublic)
30+
fontconfig_h = configure_file(output: 'fontconfig.h',
31+
input: 'fontconfig.h.in',
32+
configuration: fontconfig_h_conf)
33+
diff --git a/src/meson.build b/src/meson.build
34+
index bf5a781..c892a34 100644
35+
--- a/src/meson.build
36+
+++ b/src/meson.build
37+
@@ -1,7 +1,7 @@
38+
39+
win_export_args = []
40+
# Define FcPublic appropriately for exports on windows
41+
-if host_machine.system() == 'windows'
42+
+if host_machine.system() == 'windows' and get_option('default_library') != 'static'
43+
win_export_args += '-DFcPublic=__declspec(dllexport)'
44+
win_export_args += '-DDLL_EXPORT'
45+
endif

ports/fontconfig/emscripten.diff

Lines changed: 0 additions & 13 deletions
This file was deleted.

ports/fontconfig/libgetopt.patch

Lines changed: 30 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,119 +1,96 @@
1-
diff --git a/fc-cache/meson.build b/fc-cache/meson.build
2-
index 5e40fac..3c3e46b 100644
31
--- a/fc-cache/meson.build
42
+++ b/fc-cache/meson.build
5-
@@ -1,6 +1,7 @@
3+
@@ -1,6 +1,6 @@
64
fccache = executable('fc-cache', ['fc-cache.c', fcstdint_h, alias_headers, ft_alias_headers],
75
include_directories: [incbase, incsrc],
6+
- dependencies: [libintl_dep],
7+
+ dependencies: [getopt_dep, libintl_dep],
88
link_with: [libfontconfig],
9-
+ dependencies: [getopt_dep],
109
c_args: c_args,
1110
install: true,
12-
)
13-
diff --git a/fc-cat/meson.build b/fc-cat/meson.build
14-
index f26e4b8..476c0f9 100644
1511
--- a/fc-cat/meson.build
1612
+++ b/fc-cat/meson.build
17-
@@ -1,6 +1,7 @@
13+
@@ -1,6 +1,6 @@
1814
fccat = executable('fc-cat', ['fc-cat.c', fcstdint_h, alias_headers, ft_alias_headers],
1915
include_directories: [incbase, incsrc],
16+
- dependencies: [libintl_dep],
17+
+ dependencies: [getopt_dep, libintl_dep],
2018
link_with: [libfontconfig],
21-
+ dependencies: [getopt_dep],
2219
c_args: c_args,
2320
install: true,
24-
)
25-
diff --git a/fc-conflist/meson.build b/fc-conflist/meson.build
26-
index f543cf9..f06640b 100644
2721
--- a/fc-conflist/meson.build
2822
+++ b/fc-conflist/meson.build
29-
@@ -1,6 +1,7 @@
23+
@@ -1,6 +1,6 @@
3024
fcconflist = executable('fc-conflist', ['fc-conflist.c', fcstdint_h, alias_headers, ft_alias_headers],
3125
include_directories: [incbase, incsrc],
26+
- dependencies: [libintl_dep],
27+
+ dependencies: [getopt_dep, libintl_dep],
3228
link_with: [libfontconfig],
33-
+ dependencies: [getopt_dep],
3429
c_args: c_args,
3530
install: true,
36-
)
37-
diff --git a/fc-list/meson.build b/fc-list/meson.build
38-
index 2f679d5..4b0fb62 100644
3931
--- a/fc-list/meson.build
4032
+++ b/fc-list/meson.build
41-
@@ -1,6 +1,7 @@
33+
@@ -1,6 +1,6 @@
4234
fclist = executable('fc-list', ['fc-list.c', fcstdint_h, alias_headers, ft_alias_headers],
4335
include_directories: [incbase, incsrc],
36+
- dependencies: [libintl_dep],
37+
+ dependencies: [getopt_dep, libintl_dep],
4438
link_with: [libfontconfig],
45-
+ dependencies: [getopt_dep],
4639
c_args: c_args,
4740
install: true,
48-
)
49-
diff --git a/fc-match/meson.build b/fc-match/meson.build
50-
index aca8bc8..cab4f09 100644
5141
--- a/fc-match/meson.build
5242
+++ b/fc-match/meson.build
53-
@@ -1,6 +1,7 @@
43+
@@ -1,6 +1,6 @@
5444
fcmatch = executable('fc-match', ['fc-match.c', fcstdint_h, alias_headers, ft_alias_headers],
5545
include_directories: [incbase, incsrc],
46+
- dependencies: [libintl_dep],
47+
+ dependencies: [getopt_dep, libintl_dep],
5648
link_with: [libfontconfig],
57-
+ dependencies: [getopt_dep],
5849
c_args: c_args,
5950
install: true,
60-
)
61-
diff --git a/fc-pattern/meson.build b/fc-pattern/meson.build
62-
index 07de245..b957c67 100644
6351
--- a/fc-pattern/meson.build
6452
+++ b/fc-pattern/meson.build
65-
@@ -1,6 +1,7 @@
53+
@@ -1,6 +1,6 @@
6654
fcpattern = executable('fc-pattern', ['fc-pattern.c', fcstdint_h, alias_headers, ft_alias_headers],
6755
include_directories: [incbase, incsrc],
56+
- dependencies: [libintl_dep],
57+
+ dependencies: [getopt_dep, libintl_dep],
6858
link_with: [libfontconfig],
69-
+ dependencies: [getopt_dep],
7059
c_args: c_args,
7160
install: true,
72-
)
73-
diff --git a/fc-query/meson.build b/fc-query/meson.build
74-
index d0f2dd4..940b021 100644
7561
--- a/fc-query/meson.build
7662
+++ b/fc-query/meson.build
77-
@@ -1,7 +1,7 @@
63+
@@ -1,6 +1,6 @@
7864
fcquery = executable('fc-query', ['fc-query.c', fcstdint_h, alias_headers, ft_alias_headers],
7965
include_directories: [incbase, incsrc],
66+
- dependencies: [freetype_dep, libintl_dep],
67+
+ dependencies: [freetype_dep, getopt_dep, libintl_dep],
8068
link_with: [libfontconfig],
81-
- dependencies: [freetype_dep],
82-
+ dependencies: [freetype_dep, getopt_dep],
8369
c_args: c_args,
8470
install: true,
85-
)
86-
diff --git a/fc-scan/meson.build b/fc-scan/meson.build
87-
index 4de2134..c5b2b67 100644
8871
--- a/fc-scan/meson.build
8972
+++ b/fc-scan/meson.build
90-
@@ -1,7 +1,7 @@
73+
@@ -1,6 +1,6 @@
9174
fcscan = executable('fc-scan', ['fc-scan.c', fcstdint_h, alias_headers, ft_alias_headers],
9275
include_directories: [incbase, incsrc],
76+
- dependencies: [freetype_dep, libintl_dep],
77+
+ dependencies: [freetype_dep, getopt_dep, libintl_dep],
9378
link_with: [libfontconfig],
94-
- dependencies: [freetype_dep],
95-
+ dependencies: [freetype_dep, getopt_dep],
9679
c_args: c_args,
9780
install: true,
98-
)
99-
diff --git a/fc-validate/meson.build b/fc-validate/meson.build
100-
index e2b956e..8902d59 100644
10181
--- a/fc-validate/meson.build
10282
+++ b/fc-validate/meson.build
103-
@@ -1,7 +1,7 @@
83+
@@ -1,6 +1,6 @@
10484
fcvalidate = executable('fc-validate', ['fc-validate.c', fcstdint_h, alias_headers, ft_alias_headers],
10585
include_directories: [incbase, incsrc],
86+
- dependencies: [freetype_dep, libintl_dep],
87+
+ dependencies: [freetype_dep, getopt_dep, libintl_dep],
10688
link_with: [libfontconfig],
107-
- dependencies: [freetype_dep],
108-
+ dependencies: [freetype_dep, getopt_dep],
10989
c_args: c_args,
11090
install: true,
111-
)
112-
diff --git a/meson.build b/meson.build
113-
index f616600..6d82a16 100644
11491
--- a/meson.build
11592
+++ b/meson.build
116-
@@ -202,6 +202,14 @@ if cc.links(files('meson-cc-tests/solaris-atomic-operations.c'), name: 'Solaris
93+
@@ -319,6 +319,14 @@ if cc.links(files('meson-cc-tests/solaris-atomic-operations.c'), name: 'Solaris
11794
conf.set('HAVE_SOLARIS_ATOMIC_OPS', 1)
11895
endif
11996

@@ -126,5 +103,5 @@ index f616600..6d82a16 100644
126103
+endif
127104
+
128105

129-
# Check iconv support
130-
iconv_dep = []
106+
prefix = get_option('prefix')
107+

ports/fontconfig/libintl.diff

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
diff --git a/meson.build b/meson.build
2+
index e742ea6..1d795d1 100644
3+
--- a/meson.build
4+
+++ b/meson.build
5+
@@ -200,10 +200,16 @@ gettext_args = [ '--msgid-bugs-address=@0@'.format(conf.get('PACKAGE_BUGREPORT')
6+
7+
# Check for libintl.h
8+
opt_nls = get_option('nls')
9+
+libintl_dep = dependency('', required: false)
10+
+if opt_nls.allowed()
11+
libintl_dep = dependency('intl', required: opt_nls, fallback: ['libintl', 'libintl_dep'])
12+
+endif
13+
if libintl_dep.found()
14+
conf.set('ENABLE_NLS', opt_nls.allowed().to_int())
15+
deps += [libintl_dep]
16+
+ if host_machine.system() == 'darwin'
17+
+ deps += [dependency('CoreFoundation', method: 'extraframework')]
18+
+ endif
19+
else
20+
opt_nls = opt_nls.require(false)
21+
endif

ports/fontconfig/portfile.cmake

Lines changed: 18 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,22 @@ vcpkg_from_gitlab(
33
OUT_SOURCE_PATH SOURCE_PATH
44
REPO fontconfig/fontconfig
55
REF ${VERSION}
6-
SHA512 daa6d1e6058e12c694d9e1512e09be957ff7f3fa375246b9d13eb0a8cf2f21e1512a5cabe93f270e96790e2c20420bf7422d213e43ab9749da3255286ea65a7c
6+
SHA512 8e05cad63cd0c5ca15d1359e19a605912198fcc0ec6ecc11d5a0ef596d72e795cd8128e4d350716e63cbc01612c3807b1455b8153901333790316170c9ef8e75
77
HEAD_REF master
88
PATCHES
9-
emscripten.diff
9+
dllexport.diff
1010
no-etc-symlinks.patch
1111
libgetopt.patch
12+
libintl.diff
1213
fix-wasm-shared-memory-atomics.patch
1314
)
1415

1516
set(options "")
17+
if("iconv" IN_LIST FEATURES)
18+
list(APPEND options "-Diconv=enabled")
19+
else()
20+
list(APPEND options "-Diconv=disabled")
21+
endif()
1622
if("nls" IN_LIST FEATURES)
1723
list(APPEND options "-Dnls=enabled")
1824
else()
@@ -30,7 +36,7 @@ vcpkg_configure_meson(
3036
${options}
3137
-Ddoc=disabled
3238
-Dcache-build=disabled
33-
-Diconv=enabled
39+
-Dxml-backend=expat
3440
-Dtests=disabled
3541
ADDITIONAL_BINARIES
3642
"gperf = ['${CURRENT_HOST_INSTALLED_DIR}/tools/gperf/gperf${VCPKG_HOST_EXECUTABLE_SUFFIX}']"
@@ -43,13 +49,11 @@ set(replacement "")
4349
if(VCPKG_TARGET_IS_WINDOWS)
4450
set(replacement "**invalid-fontconfig-dir-do-not-use**")
4551
endif()
46-
set(configfile "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/config.h")
52+
set(configfile "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/meson-config.h")
4753
vcpkg_replace_string("${configfile}" "${CURRENT_PACKAGES_DIR}" "${replacement}")
48-
vcpkg_replace_string("${configfile}" "#define FC_TEMPLATEDIR \"/share/fontconfig/conf.avail\"" "#define FC_TEMPLATEDIR \"/usr/share/fontconfig/conf.avail\"" IGNORE_UNCHANGED)
4954
if(NOT VCPKG_BUILD_TYPE)
50-
set(configfile "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/config.h")
51-
vcpkg_replace_string("${configfile}" "${CURRENT_PACKAGES_DIR}/debug" "${replacement}")
52-
vcpkg_replace_string("${configfile}" "#define FC_TEMPLATEDIR \"/share/fontconfig/conf.avail\"" "#define FC_TEMPLATEDIR \"/usr/share/fontconfig/conf.avail\"" IGNORE_UNCHANGED)
55+
set(configfile "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/meson-config.h")
56+
vcpkg_replace_string("${configfile}" "${CURRENT_PACKAGES_DIR}" "${replacement}")
5357
endif()
5458

5559
vcpkg_install_meson(ADD_BIN_TO_PATH)
@@ -65,12 +69,10 @@ endif()
6569
vcpkg_fixup_pkgconfig()
6670

6771
# Fix paths in debug pc file.
68-
set(_file "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/fontconfig.pc")
69-
if(EXISTS "${_file}")
70-
file(READ "${_file}" _contents)
71-
string(REPLACE "/etc" "/../etc" _contents "${_contents}")
72-
string(REPLACE "/var" "/../var" _contents "${_contents}")
73-
file(WRITE "${_file}" "${_contents}")
72+
if(NOT VCPKG_BUILD_TYPE)
73+
set(fontconfig_pc_debug "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/fontconfig.pc")
74+
vcpkg_replace_string("${fontconfig_pc_debug}" "/etc" "/../etc" REGEX)
75+
vcpkg_replace_string("${fontconfig_pc_debug}" "/var" "/../var" REGEX)
7476
endif()
7577

7678
# Make path to cache in fonts.conf relative
@@ -81,21 +83,8 @@ endif()
8183

8284
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/var"
8385
"${CURRENT_PACKAGES_DIR}/debug/share"
84-
"${CURRENT_PACKAGES_DIR}/debug/etc")
85-
86-
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
87-
if(VCPKG_TARGET_IS_WINDOWS)
88-
set(DEFINE_FC_PUBLIC "#define FcPublic __declspec(dllimport)")
89-
else()
90-
set(DEFINE_FC_PUBLIC "#define FcPublic __attribute__((visibility(\"default\")))")
91-
endif()
92-
foreach(HEADER IN ITEMS fcfreetype.h fontconfig.h)
93-
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/fontconfig/${HEADER}"
94-
"#define FcPublic"
95-
"${DEFINE_FC_PUBLIC}"
96-
)
97-
endforeach()
98-
endif()
86+
"${CURRENT_PACKAGES_DIR}/debug/etc"
87+
"${CURRENT_PACKAGES_DIR}/var")
9988

10089
if("tools" IN_LIST FEATURES)
10190
vcpkg_copy_tools(

0 commit comments

Comments
 (0)