$OpenBSD: patch-meson_build,v 1.7 2021/11/26 14:43:10 ajacoutot Exp $

In file included from /usr/include/readline/readline.h:38:
In file included from /usr/include/readline/keymaps.h:36:
In file included from /usr/include/readline/chardefs.h:39:
/usr/include/c++/v1/string.h:104:13: error: functions that differ only in their return type cannot be overloaded
const char* strstr(const char* __s1, const char* __s2) {return __libcpp_strstr(__s1, __s2);}
      ~~~~~ ^
      /usr/include/string.h:89:7: note: previous declaration is here
      char    *strstr(const char *, const char *);
      ~~~~~~~~~^
      5 errors generated.

XXX check at next release
Fix build with meson >= 0.60.2

Index: meson.build
--- meson.build.orig
+++ meson.build
@@ -156,6 +156,7 @@ readline = cxx.find_library('readline', required: get_
 # On some systems we need to link readline to a termcap compatible library
 readline_code = '''
 #include <cstdio>
+#include <string>
 #include <readline/readline.h>
 int main(void) {
     readline("foo");
@@ -299,9 +300,13 @@ header_conf.set('HAVE_DTRACE', get_option('dtrace'),
     description: 'Using dtrace probes')
 header_conf.set('HAVE_PRINTF_ALTERNATIVE_INT', have_printf_alternative_int,
     description: 'printf() accepts "%Id" for alternative integer output')
+readline_prefix = '''
+#include <cstdio>
+#include <string>
+'''
 if build_readline
     header_conf.set('HAVE_READLINE_READLINE_H',
-        cxx.check_header('readline/readline.h', prefix: '#include <cstdio>',
+        cxx.check_header('readline/readline.h', prefix: readline_prefix,
             required: readline.found()))
 endif
 header_conf.set('USE_UNITY_BUILD', get_option('unity'))
@@ -563,7 +568,7 @@ gjs_private_gir = gnome.generate_gir(libgjs,
     includes: ['GObject-2.0', 'Gio-2.0'], sources: libgjs_private_sources,
     namespace: 'GjsPrivate', nsversion: '1.0', identifier_prefix: 'Gjs',
     symbol_prefix: 'gjs_', extra_args: '--warn-error', install: true,
-    install_dir_gir: false, install_dir_typelib: pkglibdir / 'girepository-1.0')
+    install_dir_typelib: pkglibdir / 'girepository-1.0')
 gjs_private_typelib = gjs_private_gir[1]
 
 ### Build gjs-console interpreter ##############################################
