From 0fb1414b2804410d5c7be6868198c838e707233f Mon Sep 17 00:00:00 2001
From: Upgrade Helper <auh@yoctoproject.org>
Date: Thu, 11 Jun 2026 12:01:02 +0000
Subject: [PATCH] fontconfig: upgrade 2.17.1 -> 2.18.1

---
 ...ded-missing-target-rule-dependencies.patch | 31 ---------
 .../fontconfig/fontconfig/musl-fix.patch      | 66 -------------------
 .../fontconfig/revert-static-pkgconfig.patch  |  8 +++
 ...tconfig_2.17.1.bb => fontconfig_2.18.1.bb} |  4 +-
 4 files changed, 9 insertions(+), 100 deletions(-)
 delete mode 100644 meta/recipes-graphics/fontconfig/fontconfig/0001-build-Added-missing-target-rule-dependencies.patch
 delete mode 100644 meta/recipes-graphics/fontconfig/fontconfig/musl-fix.patch
 rename meta/recipes-graphics/fontconfig/{fontconfig_2.17.1.bb => fontconfig_2.18.1.bb} (92%)

diff --git a/meta/recipes-graphics/fontconfig/fontconfig/0001-build-Added-missing-target-rule-dependencies.patch b/meta/recipes-graphics/fontconfig/fontconfig/0001-build-Added-missing-target-rule-dependencies.patch
deleted file mode 100644
index 40b25cc926..0000000000
--- a/meta/recipes-graphics/fontconfig/fontconfig/0001-build-Added-missing-target-rule-dependencies.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 0bba79bfd3d8a216794d15af97ce4abefd4b8748 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Florian=20=22sp1rit=22=E2=80=8B?= <sp1rit@disroot.org>
-Date: Sat, 9 Aug 2025 20:22:43 +0200
-Subject: [PATCH] build: Added missing target rule-dependencies
-
-02b835b62 did not appropriately ensure, that the patternlib_internal
-target waits until the {ft_,}alias_headers have finished generating the
-headers that it depends on.
-
-Upstream-Status: Backport [0bba79bfd3d8a216794d15af97ce4abefd4b8748]
-Signed-off-by: Ross Burton <ross.burton@arm.com>
----
- src/meson.build | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/meson.build b/src/meson.build
-index c4d65d6c..10866aa8 100644
---- a/src/meson.build
-+++ b/src/meson.build
-@@ -9,7 +9,7 @@ endif
- # Factor our pattern manipulation code into its own library
- # to break the depedency cycle:
- # FontConfig pattern handling - Fontations code - FontConfig.
--pattern_sources = [ 'fcpat.c', fcstdint_h, fclang_h ]
-+pattern_sources = [ 'fcpat.c', fcstdint_h, fclang_h, alias_headers, ft_alias_headers ]
- pattern_lib = static_library('patternlib_internal',
-                                     pattern_sources,
-                                     include_directories: incbase,
--- 
-2.43.0
-
diff --git a/meta/recipes-graphics/fontconfig/fontconfig/musl-fix.patch b/meta/recipes-graphics/fontconfig/fontconfig/musl-fix.patch
deleted file mode 100644
index c4508bd15a..0000000000
--- a/meta/recipes-graphics/fontconfig/fontconfig/musl-fix.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-From 75cc3e6ef0e451f42d3464ed4d639304ad9a4f58 Mon Sep 17 00:00:00 2001
-From: Akira TAGOH <akira@tagoh.org>
-Date: Thu, 3 Jul 2025 03:31:49 +0900
-Subject: [PATCH] test: Fix a build issue with musl libc
-
-Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/484
-
-Changelog: fixed
-Upstream-Status: Backport [https://gitlab.freedesktop.org/fontconfig/fontconfig/-/commit/75cc3e6ef0e451f42d3464ed4d639304ad9a4f58]
-Signed-off-by: Alexander Kanavin <alex@linutronix.de>
----
- test/test-mt-fccfg.c | 22 ++++++++++++++++++++--
- 1 file changed, 20 insertions(+), 2 deletions(-)
-
-diff --git a/test/test-mt-fccfg.c b/test/test-mt-fccfg.c
-index 24ad7583..3b7d843d 100644
---- a/test/test-mt-fccfg.c
-+++ b/test/test-mt-fccfg.c
-@@ -1,9 +1,12 @@
- /* Copyright (C) 2025 fontconfig Authors */
- /* SPDX-License-Identifier: HPND */
-+#ifdef HAVE_CONFIG_H
-+#  include "config.h"
-+#endif
-+
- #include <fontconfig/fontconfig.h>
- 
- #include <stdio.h>
--#define __USE_XOPEN
- #include <pthread.h>
- #include <stdlib.h>
- 
-@@ -13,6 +16,21 @@ struct thr_arg_s {
-     int thr_num;
- };
- 
-+#ifdef _WIN32
-+int
-+setenv (const char *name, const char *value, int o)
-+{
-+    size_t len = strlen (name) + strlen (value) + 1;
-+    char  *s = malloc (len + 1);
-+    int    ret;
-+
-+    snprintf (s, len, "%s=%s", name, value);
-+    ret = _putenv (s);
-+    free (s);
-+    return ret;
-+}
-+#endif
-+
- static void *
- run_test_in_thread (void *arg)
- {
-@@ -61,7 +79,7 @@ test (void)
-     if (c1 == c2)
- 	return 1;
-     /* To make visible if we have any references */
--    putenv ("FC_DEBUG=16");
-+    setenv ("FC_DEBUG", "16", 1);
-     FcFini();
- 
-     return 0;
--- 
-GitLab
-
diff --git a/meta/recipes-graphics/fontconfig/fontconfig/revert-static-pkgconfig.patch b/meta/recipes-graphics/fontconfig/fontconfig/revert-static-pkgconfig.patch
index 30d6423037..4c505b3e7f 100644
--- a/meta/recipes-graphics/fontconfig/fontconfig/revert-static-pkgconfig.patch
+++ b/meta/recipes-graphics/fontconfig/fontconfig/revert-static-pkgconfig.patch
@@ -1,3 +1,8 @@
+From 06897ba10c1ab0d6844e16353a1563174f93ad4f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 23 Apr 2015 20:35:32 -0700
+Subject: [PATCH] fontconfig: Fix pkgconfig file generation to not have
+
 Revert part of http://cgit.freedesktop.org/fontconfig/commit/fontconfig.pc.in?id=338ffe6b886ad4ba86ff471cb59c4a5e5ffbe408
 We really dont do static linking so its not going to cause issues for us but as such this is harming us by adding absolute
 paths into -I options into fontconfig.pc which is them prepended with sysroot when read back by cross pkg-config and
@@ -7,6 +12,9 @@ gently refuses and rightly so.
 
 Upstream-Status: Inappropriate [OE-Specific]
 Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ fontconfig.pc.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/fontconfig.pc.in b/fontconfig.pc.in
 index 61b35fb..5bc9bab 100644
diff --git a/meta/recipes-graphics/fontconfig/fontconfig_2.17.1.bb b/meta/recipes-graphics/fontconfig/fontconfig_2.18.1.bb
similarity index 92%
rename from meta/recipes-graphics/fontconfig/fontconfig_2.17.1.bb
rename to meta/recipes-graphics/fontconfig/fontconfig_2.18.1.bb
index 0d0fcfcceb..76b2652738 100644
--- a/meta/recipes-graphics/fontconfig/fontconfig_2.17.1.bb
+++ b/meta/recipes-graphics/fontconfig/fontconfig_2.18.1.bb
@@ -22,10 +22,8 @@ DEPENDS = "expat freetype zlib gperf-native util-linux"
 
 SRC_URI = "https://gitlab.freedesktop.org/api/v4/projects/890/packages/generic/fontconfig/${PV}/fontconfig-${PV}.tar.xz \
            file://revert-static-pkgconfig.patch \
-           file://musl-fix.patch \
-           file://0001-build-Added-missing-target-rule-dependencies.patch \
            "
-SRC_URI[sha256sum] = "9f5cae93f4fffc1fbc05ae99cdfc708cd60dfd6612ffc0512827025c026fa541"
+SRC_URI[sha256sum] = "2300f3dbfa7253b3a44f4feecdbc8dfa45dde5dc2cfb71fceaf31f394cb41031"
 
 UPSTREAM_CHECK_URI = "https://gitlab.freedesktop.org/fontconfig/fontconfig/-/tags"
 UPSTREAM_CHECK_REGEX = "releases/(?P<pver>.+)"
-- 
2.47.1

