From 359e47eb94ac69e76494b66f46123269f8d43179 Mon Sep 17 00:00:00 2001 From: Benjamin Gilbert Date: Sun, 1 Oct 2023 23:22:47 -0500 Subject: [PATCH] Update glib; fix PCRE2 detection regression Signed-off-by: Benjamin Gilbert --- meson/subprojects/glib.wrap | 15 ++++--- .../subprojects/packagefiles/glib-pcre2.patch | 39 +++++++++++++++++++ 2 files changed, 48 insertions(+), 6 deletions(-) create mode 100644 meson/subprojects/packagefiles/glib-pcre2.patch diff --git a/meson/subprojects/glib.wrap b/meson/subprojects/glib.wrap index c5dc5127..c46372e2 100644 --- a/meson/subprojects/glib.wrap +++ b/meson/subprojects/glib.wrap @@ -1,10 +1,13 @@ [wrap-file] -directory = glib-2.76.5 -source_url = https://download.gnome.org/sources/glib/2.76/glib-2.76.5.tar.xz -source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/glib_2.76.5-1/glib-2.76.5.tar.xz -source_filename = glib-2.76.5.tar.xz -source_hash = ed3a9953a90b20da8e5578a79f7d1c8a532eacbe2adac82aa3881208db8a3abe -wrapdb_version = 2.76.5-1 +directory = glib-2.78.0 +source_url = https://download.gnome.org/sources/glib/2.78/glib-2.78.0.tar.xz +source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/glib_2.78.0-1/glib-2.78.0.tar.xz +source_filename = glib-2.78.0.tar.xz +source_hash = 44eaab8b720877ce303c5540b657b126f12dc94972d9880b52959f43fb537b30 +wrapdb_version = 2.78.0-1 + +# https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3601 +diff_files = glib-pcre2.patch [provide] dependency_names = gthread-2.0, gobject-2.0, gmodule-no-export-2.0, gmodule-export-2.0, gmodule-2.0, glib-2.0, gio-2.0, gio-windows-2.0, gio-unix-2.0 diff --git a/meson/subprojects/packagefiles/glib-pcre2.patch b/meson/subprojects/packagefiles/glib-pcre2.patch new file mode 100644 index 00000000..23af4fea --- /dev/null +++ b/meson/subprojects/packagefiles/glib-pcre2.patch @@ -0,0 +1,39 @@ +From 34e457e9f146425153d4d89dd0b57320ba381702 Mon Sep 17 00:00:00 2001 +From: Benjamin Gilbert +Date: Sun, 1 Oct 2023 18:26:02 -0500 +Subject: [PATCH] meson: Fix Windows build with PCRE2 as sibling subproject + +If glib and PCRE2 are both built for Windows as subprojects of a parent +project, cc.links() will fail because PCRE2 hasn't been built yet when +glib is being configured: + + subprojects/glib-2.78.0/meson.build:2109:20: ERROR: Dependencies must be external dependencies + +609d58beea changed the detection logic to avoid cc.links() in this +case, but dd5683ce64 broke it again. PCRE2 detection could use a +broader cleanup, but for now, make the minimum change to fix this case. + +use_pcre2_static_flag ends up set to false, matching the behavior of +609d58beea. + +Fixes: dd5683ce64 ("meson: Allow fallback & static build of pcre subproject") +--- + meson.build | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/meson.build b/meson.build +index 25ae10fc211f..3ad200a6a332 100644 +--- a/meson.build ++++ b/meson.build +@@ -2105,7 +2105,7 @@ if not pcre2.found() + # static flags are automatically enabled by the subproject if it's built + # with default_library=static + use_pcre2_static_flag = false +-elif host_system == 'windows' ++elif host_system == 'windows' and pcre2.type_name() != 'internal' + pcre2_static = cc.links('''#define PCRE2_STATIC + #define PCRE2_CODE_UNIT_WIDTH 8 + #include +-- +2.41.0 +