| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | $NetBSD: patch-meson.build,v 1.15 2021/10/11 10:03:47 cirnatdan Exp $ | | 1 | $NetBSD: patch-meson.build,v 1.16 2021/10/15 15:04:47 jperkin Exp $ |
2 | | | 2 | |
3 | - On Darwin, optionally use Cocoa (needed for X11 users). | | 3 | - On Darwin, optionally use Cocoa (needed for X11 users). |
4 | | | 4 | |
5 | - Don't insist that Python binary is called "python3". | | 5 | - Don't insist that Python binary is called "python3". |
6 | (Requires meson >= 0.50.0) | | 6 | (Requires meson >= 0.50.0) |
7 | | | 7 | |
8 | - Don't install bash completion scripts. | | 8 | - Don't install bash completion scripts. |
9 | | | 9 | |
10 | - Tolerate getxattr not existing (smartOS) | | 10 | - Tolerate getxattr not existing (smartOS) |
11 | https://gitlab.gnome.org/GNOME/glib/merge_requests/888 | | 11 | https://gitlab.gnome.org/GNOME/glib/merge_requests/888 |
12 | | | 12 | |
13 | - Define a newer POSIX, as we build this package with -std=gnu99 | | 13 | - Define a newer POSIX, as we build this package with -std=gnu99 |
14 | | | 14 | |
| @@ -22,48 +22,69 @@ $NetBSD: patch-meson.build,v 1.15 2021/1 | | | @@ -22,48 +22,69 @@ $NetBSD: patch-meson.build,v 1.15 2021/1 |
22 | + glib_have_cocoa = glib_have_cocoa and get_option('use_cocoa') | | 22 | + glib_have_cocoa = glib_have_cocoa and get_option('use_cocoa') |
23 | if glib_have_cocoa | | 23 | if glib_have_cocoa |
24 | glib_conf.set('HAVE_COCOA', true) | | 24 | glib_conf.set('HAVE_COCOA', true) |
25 | osx_ldflags += ['-Wl,-framework,Foundation', '-Wl,-framework,AppKit'] | | 25 | osx_ldflags += ['-Wl,-framework,Foundation', '-Wl,-framework,AppKit'] |
26 | @@ -2047,7 +2047,7 @@ endif | | 26 | @@ -2047,7 +2047,7 @@ endif |
27 | # FIXME: glib-gettext.m4 has much more checks to detect broken/uncompatible | | 27 | # FIXME: glib-gettext.m4 has much more checks to detect broken/uncompatible |
28 | # implementations. This could be extended if issues are found in some platforms. | | 28 | # implementations. This could be extended if issues are found in some platforms. |
29 | libintl_deps = [] | | 29 | libintl_deps = [] |
30 | -if cc.has_function('ngettext', args : osx_ldflags) | | 30 | -if cc.has_function('ngettext', args : osx_ldflags) |
31 | +if cc.has_function('ngettext', args : osx_ldflags) and host_system != 'sunos' | | 31 | +if cc.has_function('ngettext', args : osx_ldflags) and host_system != 'sunos' |
32 | have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset') | | 32 | have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset') |
33 | else | | 33 | else |
34 | # First just find the bare library. | | 34 | # First just find the bare library. |
35 | @@ -2230,9 +2230,12 @@ endif | | 35 | @@ -2118,18 +2118,17 @@ if host_system != 'windows' and get_opti |
| | | 36 | |
| | | 37 | # try glibc |
| | | 38 | if cc.has_function('getxattr') and cc.has_header('sys/xattr.h') |
| | | 39 | + glib_conf.set('HAVE_XATTR', 1) |
| | | 40 | glib_conf.set('HAVE_SYS_XATTR_H', 1) |
| | | 41 | glib_conf_prefix = glib_conf_prefix + '#define @0@ 1\n'.format('HAVE_SYS_XATTR_H') |
| | | 42 | #failure. try libattr |
| | | 43 | elif cc.has_header_symbol('attr/xattr.h', 'getxattr') |
| | | 44 | + glib_conf.set('HAVE_XATTR', 1) |
| | | 45 | glib_conf.set('HAVE_ATTR_XATTR_H', 1) |
| | | 46 | glib_conf_prefix = glib_conf_prefix + '#define @0@ 1\n'.format('HAVE_ATTR_XATTR_H') |
| | | 47 | xattr_dep = [cc.find_library('xattr')] |
| | | 48 | - else |
| | | 49 | - error('No getxattr implementation found in C library or libxattr') |
| | | 50 | endif |
| | | 51 | |
| | | 52 | - glib_conf.set('HAVE_XATTR', 1) |
| | | 53 | if cc.compiles(glib_conf_prefix + ''' |
| | | 54 | #include <stdio.h> |
| | | 55 | #ifdef HAVE_SYS_TYPES_H |
| | | 56 | @@ -2230,9 +2229,12 @@ endif |
36 | | | 57 | |
37 | glib_conf.set('HAVE_PROC_SELF_CMDLINE', have_proc_self_cmdline) | | 58 | glib_conf.set('HAVE_PROC_SELF_CMDLINE', have_proc_self_cmdline) |
38 | | | 59 | |
39 | -python = import('python').find_installation('python3') | | 60 | -python = import('python').find_installation('python3') |
40 | -# used for '#!/usr/bin/env <name>' | | 61 | -# used for '#!/usr/bin/env <name>' |
41 | -python_name = 'python3' | | 62 | -python_name = 'python3' |
42 | +python = import('python').find_installation('python3', required: false) | | 63 | +python = import('python').find_installation('python3', required: false) |
43 | +if not python.found() | | 64 | +if not python.found() |
44 | + python = import('python').find_installation() | | 65 | + python = import('python').find_installation() |
45 | +endif | | 66 | +endif |
46 | +python_name = python.path() | | 67 | +python_name = python.path() |
47 | + | | 68 | + |
48 | | | 69 | |
49 | python_version = python.language_version() | | 70 | python_version = python.language_version() |
50 | python_version_req = '>=3.5' | | 71 | python_version_req = '>=3.5' |
51 | @@ -2241,7 +2244,7 @@ if not python_version.version_compare(py | | 72 | @@ -2241,7 +2243,7 @@ if not python_version.version_compare(py |
52 | endif | | 73 | endif |
53 | | | 74 | |
54 | # Determine which user environment-dependent files that we want to install | | 75 | # Determine which user environment-dependent files that we want to install |
55 | -have_bash = find_program('bash', required : false).found() # For completion scripts | | 76 | -have_bash = find_program('bash', required : false).found() # For completion scripts |
56 | +have_bash = false | | 77 | +have_bash = false |
57 | bash_comp_dep = dependency('bash-completion', version: '>=2.0', required: false) | | 78 | bash_comp_dep = dependency('bash-completion', version: '>=2.0', required: false) |
58 | have_sh = find_program('sh', required : false).found() # For glib-gettextize | | 79 | have_sh = find_program('sh', required : false).found() # For glib-gettextize |
59 | | | 80 | |
60 | @@ -2250,8 +2253,7 @@ env_program = find_program('env', requir | | 81 | @@ -2250,8 +2252,7 @@ env_program = find_program('env', requir |
61 | | | 82 | |
62 | # FIXME: How to detect Solaris? https://github.com/mesonbuild/meson/issues/1578 | | 83 | # FIXME: How to detect Solaris? https://github.com/mesonbuild/meson/issues/1578 |
63 | if host_system == 'sunos' | | 84 | if host_system == 'sunos' |
64 | - glib_conf.set('_XOPEN_SOURCE_EXTENDED', 1) | | 85 | - glib_conf.set('_XOPEN_SOURCE_EXTENDED', 1) |
65 | - glib_conf.set('_XOPEN_SOURCE', 2) | | 86 | - glib_conf.set('_XOPEN_SOURCE', 2) |
66 | + glib_conf.set('_POSIX_C_SOURCE',200809) | | 87 | + glib_conf.set('_POSIX_C_SOURCE',200809) |
67 | glib_conf.set('__EXTENSIONS__',1) | | 88 | glib_conf.set('__EXTENSIONS__',1) |
68 | endif | | 89 | endif |
69 | | | 90 | |