summaryrefslogtreecommitdiff
path: root/devel/glib2/patches/patch-meson.build
blob: 67d8c595235f929bc98e535c9500d9a82c60372d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
$NetBSD: patch-meson.build,v 1.18 2022/11/23 10:41:41 adam 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-10-25 12:53:22.000000000 +0000
+++ meson.build
@@ -874,7 +874,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
@@ -2167,18 +2167,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 <stdio.h>
                  #ifdef HAVE_SYS_TYPES_H
@@ -2281,7 +2280,7 @@ glib_conf.set('HAVE_PROC_SELF_CMDLINE', 
 
 python = import('python').find_installation()
 # used for '#!/usr/bin/env <name>'
-python_name = 'python3'
+python_name = python.path()
 
 python_version = python.language_version()
 python_version_req = '>=3.5'
@@ -2290,7 +2289,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
 
@@ -2299,8 +2298,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