$NetBSD: patch-meson.build,v 1.20 2023/11/03 18:32:32 otis 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 - Check also for sys/ptrace.h header file. --- meson.build.orig 2023-09-08 13:42:18.000000000 +0000 +++ meson.build @@ -383,6 +383,7 @@ headers = [ 'sys/mount.h', 'sys/param.h', 'sys/prctl.h', + 'sys/ptrace.h', 'sys/resource.h', 'sys/select.h', 'sys/statfs.h', @@ -926,7 +927,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) osx_ldflags += ['-Wl,-framework,Foundation', '-Wl,-framework,AppKit'] @@ -2214,18 +2215,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 @@ -2328,7 +2328,7 @@ glib_conf.set('HAVE_PROC_SELF_CMDLINE', python = import('python').find_installation() # used for '#!/usr/bin/env ' -python_name = 'python3' +python_name = python.path() python_version = python.language_version() python_version_req = '>=3.5' @@ -2338,7 +2338,7 @@ endif # Determine which user environment-dependent files that we want to install bash = find_program('bash', required : false) -have_bash = bash.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 have_pkg_config = find_program('pkg-config', required: false).found() @@ -2348,8 +2348,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