diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2022-09-08 02:25:39 +0530 |
---|---|---|
committer | Sebastian Dröge <slomo@coaxion.net> | 2023-01-12 21:57:08 +0000 |
commit | ac953430d31669f473e5c96b408c27fd4a2a7e4d (patch) | |
tree | 2cd98857ab6bd83f697cd8ef227e647bb4f966ac /recipes | |
parent | bda5e209a013e097e2dcece431a683a61d045ce9 (diff) |
glib: Fix intl detection on cross-windows and android
Need to include the prefix header so that the has_function check
can pull in the `#define ngettext libintl_ngettext` from there.
Would fail with:
Run-time dependency intl found: YES
Checking for function "ngettext" with dependency intl: NO
Library pthread found: YES
Checking for function "ngettext" with dependencies intl, -lpthread: NO
../meson.build:2128:2: ERROR: Automatic wrap-based subproject downloading is disabled
Part-of: <https://gitlab.freedesktop.org/gstreamer/cerbero/-/merge_requests/864>
Diffstat (limited to 'recipes')
-rw-r--r-- | recipes/glib.recipe | 2 | ||||
-rw-r--r-- | recipes/glib/0001-meson-Fix-detection-of-a-system-provided-proxy-libin.patch | 50 |
2 files changed, 52 insertions, 0 deletions
diff --git a/recipes/glib.recipe b/recipes/glib.recipe index 41e28af8..ac9e473f 100644 --- a/recipes/glib.recipe +++ b/recipes/glib.recipe @@ -36,6 +36,8 @@ class Recipe(recipe.Recipe): 'glib/0004-Allow-for-a-second-distro-GIO-module-path-as-used-on.patch', 'glib/0006-giomodule-do-not-try-to-load-modules-from-gio-module.patch', 'glib/0008-Unhide-_g_io_modules_ensure_extension_points_registe.patch', + # TODO upstreaming + 'glib/0001-meson-Fix-detection-of-a-system-provided-proxy-libin.patch', ] files_libs = [ diff --git a/recipes/glib/0001-meson-Fix-detection-of-a-system-provided-proxy-libin.patch b/recipes/glib/0001-meson-Fix-detection-of-a-system-provided-proxy-libin.patch new file mode 100644 index 00000000..f277cb23 --- /dev/null +++ b/recipes/glib/0001-meson-Fix-detection-of-a-system-provided-proxy-libin.patch @@ -0,0 +1,50 @@ +From 9324113970f4781eafa8792130d7eb936c5897dc Mon Sep 17 00:00:00 2001 +From: Nirbheek Chauhan <nirbheek@centricular.com> +Date: Thu, 8 Sep 2022 02:36:33 +0530 +Subject: [PATCH] meson: Fix detection of a system-provided proxy-libintl + +proxy-libintl defines ngettext() as a define in the header that points +to the actual symbol in the library which is g_libintl_ngettext(). +Same with bind_textdomain_codeset(). +--- + meson.build | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/meson.build b/meson.build +index 47850adc3..e2c62d915 100644 +--- a/meson.build ++++ b/meson.build +@@ -2088,6 +2088,7 @@ endif + # FIXME: glib-gettext.m4 has much more checks to detect broken/uncompatible + # implementations. This could be extended if issues are found in some platforms. + libintl_deps = [] ++libintl_prefix = '#include <libintl.h>' + libintl = dependency('intl', required: false) + if libintl.found() + # libintl supports different threading APIs, which may not +@@ -2099,11 +2100,11 @@ if libintl.found() + # + # Meson's builtin dependency lookup as of 0.60.0 doesn't check for + # pthread, so we do this manually here. +- if cc.has_function('ngettext', dependencies : libintl) ++ if cc.has_function('ngettext', dependencies : libintl, prefix: libintl_prefix) + libintl_deps += [libintl] + else + libintl_pthread = cc.find_library('pthread', required : false) +- if libintl_pthread.found() and cc.has_function('ngettext', dependencies : [libintl, libintl_pthread]) ++ if libintl_pthread.found() and cc.has_function('ngettext', dependencies : [libintl, libintl_pthread], prefix: libintl_prefix) + libintl_deps += [libintl, libintl_pthread] + else + libintl = disabler() +@@ -2112,7 +2113,7 @@ if libintl.found() + endif + + if libintl.found() +- have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset', dependencies: libintl_deps) ++ have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset', dependencies: libintl_deps, prefix: libintl_prefix) + else + libintl = subproject('proxy-libintl').get_variable('intl_dep') + libintl_deps = [libintl] +-- +2.37.1 + |