Skip to content

Commit

Permalink
Merge pull request #149 from bgilbert/glib
Browse files Browse the repository at this point in the history
Update glib; fix PCRE2 detection regression
  • Loading branch information
bgilbert authored Oct 2, 2023
2 parents b2e101e + 359e47e commit 9df0a4f
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 6 deletions.
15 changes: 9 additions & 6 deletions meson/subprojects/glib.wrap
Original file line number Diff line number Diff line change
@@ -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
Expand Down
39 changes: 39 additions & 0 deletions meson/subprojects/packagefiles/glib-pcre2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
From 34e457e9f146425153d4d89dd0b57320ba381702 Mon Sep 17 00:00:00 2001
From: Benjamin Gilbert <[email protected]>
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 <pcre2.h>
--
2.41.0

0 comments on commit 9df0a4f

Please sign in to comment.