$NetBSD: patch-meson.build,v 1.17 2022/07/24 21:24:56 wiz Exp $ - On Darwin, optionally use Cocoa (needed for X11 users). - Don't insist that Python binary is called "python3". (Requires meson >= 0.50.0) - Don't install bash completion scripts. - Tolerate getxattr not existing (smartOS) https://gitlab.gnome.org/GNOME/glib/merge_requests/888 - Define a newer POSIX, as we build this package with -std=gnu99 --- meson.build.orig 2022-05-30 13:26:47.000000000 +0000 +++ meson.build @@ -821,7 +821,7 @@ if host_system == 'darwin' #error "Detected GNUstep, not Cocoa" #endif''', name : 'Mac OS X Cocoa support') - + glib_have_cocoa = glib_have_cocoa and get_option('use_cocoa') if glib_have_cocoa glib_conf.set('HAVE_COCOA', true) endif @@ -2159,18 +2159,17 @@ if host_system != 'windows' and get_opti # try glibc if cc.has_function('getxattr') and cc.has_header('sys/xattr.h') + glib_conf.set('HAVE_XATTR', 1) glib_conf.set('HAVE_SYS_XATTR_H', 1) glib_conf_prefix = glib_conf_prefix + '#define @0@ 1\n'.format('HAVE_SYS_XATTR_H') #failure. try libattr elif cc.has_header_symbol('attr/xattr.h', 'getxattr') + glib_conf.set('HAVE_XATTR', 1) glib_conf.set('HAVE_ATTR_XATTR_H', 1) glib_conf_prefix = glib_conf_prefix + '#define @0@ 1\n'.format('HAVE_ATTR_XATTR_H') xattr_dep = [cc.find_library('xattr')] - else - error('No getxattr implementation found in C library or libxattr') endif - glib_conf.set('HAVE_XATTR', 1) if cc.compiles(glib_conf_prefix + ''' #include #ifdef HAVE_SYS_TYPES_H @@ -2271,9 +2270,12 @@ endif glib_conf.set('HAVE_PROC_SELF_CMDLINE', have_proc_self_cmdline) -python = import('python').find_installation('python3') -# used for '#!/usr/bin/env ' -python_name = 'python3' +python = import('python').find_installation('python3', required: false) +if not python.found() + python = import('python').find_installation() +endif +python_name = python.path() + python_version = python.language_version() python_version_req = '>=3.5' @@ -2282,7 +2284,7 @@ if not python_version.version_compare(py endif # Determine which user environment-dependent files that we want to install -have_bash = find_program('bash', required : false).found() # For completion scripts +have_bash = false bash_comp_dep = dependency('bash-completion', version: '>=2.0', required: false) have_sh = find_program('sh', required : false).found() # For glib-gettextize @@ -2291,8 +2293,7 @@ env_program = find_program('env', requir # FIXME: How to detect Solaris? https://github.com/mesonbuild/meson/issues/1578 if host_system == 'sunos' - glib_conf.set('_XOPEN_SOURCE_EXTENDED', 1) - glib_conf.set('_XOPEN_SOURCE', 2) + glib_conf.set('_POSIX_C_SOURCE',200809) glib_conf.set('__EXTENSIONS__',1) endif