0004-meson-Fix-detection-of-a-system-provided-proxy-libin.patch 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. From 2ca9f53327308e85e376bcbef7f8259a6331a453 Mon Sep 17 00:00:00 2001
  2. From: Nirbheek Chauhan <nirbheek@centricular.com>
  3. Date: Thu, 8 Sep 2022 02:36:33 +0530
  4. Subject: [PATCH] meson: Fix detection of a system-provided proxy-libintl
  5. proxy-libintl defines ngettext() as a define in the header that points
  6. to the actual symbol in the library which is g_libintl_ngettext().
  7. Same with bind_textdomain_codeset().
  8. Upstream: https://gitlab.gnome.org/GNOME/glib/-/commit/32249a22fc39319651e7c23442d37ec837f05764
  9. Signed-off-by: Thomas Devoogdt <thomas@devoogdt.com>
  10. ---
  11. meson.build | 7 ++++---
  12. 1 file changed, 4 insertions(+), 3 deletions(-)
  13. diff --git a/meson.build b/meson.build
  14. index 0cbc9689f..de0bee5a3 100644
  15. --- a/meson.build
  16. +++ b/meson.build
  17. @@ -2089,6 +2089,7 @@ libz_dep = dependency('zlib')
  18. # FIXME: glib-gettext.m4 has much more checks to detect broken/uncompatible
  19. # implementations. This could be extended if issues are found in some platforms.
  20. libintl_deps = []
  21. +libintl_prefix = '#include <libintl.h>'
  22. libintl = dependency('intl', required: false, allow_fallback: false)
  23. if libintl.found()
  24. # libintl supports different threading APIs, which may not
  25. @@ -2100,11 +2101,11 @@ if libintl.found()
  26. #
  27. # Meson's builtin dependency lookup as of 0.60.0 doesn't check for
  28. # pthread, so we do this manually here.
  29. - if cc.has_function('ngettext', dependencies : libintl)
  30. + if cc.has_function('ngettext', dependencies : libintl, prefix: libintl_prefix)
  31. libintl_deps += [libintl]
  32. else
  33. libintl_pthread = cc.find_library('pthread', required : false)
  34. - if libintl_pthread.found() and cc.has_function('ngettext', dependencies : [libintl, libintl_pthread])
  35. + if libintl_pthread.found() and cc.has_function('ngettext', dependencies : [libintl, libintl_pthread], prefix: libintl_prefix)
  36. libintl_deps += [libintl, libintl_pthread]
  37. else
  38. libintl = disabler()
  39. @@ -2113,7 +2114,7 @@ if libintl.found()
  40. endif
  41. if libintl.found()
  42. - have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset', dependencies: libintl_deps)
  43. + have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset', dependencies: libintl_deps, prefix: libintl_prefix)
  44. else
  45. libintl = dependency('intl', allow_fallback: true)
  46. assert(libintl.type_name() == 'internal')
  47. --
  48. 2.34.1