summaryrefslogtreecommitdiff
path: root/x11-wm/mango/files/patch-meson.build
blob: 5fc5a00341f6e03ecc2bd9ee525b08f52aaf2bfa (plain) (blame)
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
--- meson.build.orig	2026-05-29 13:04:35 UTC
+++ meson.build
@@ -12,12 +12,16 @@ endif
     endif
 endif
 
+osname = build_machine.system()
+
 prefix = get_option('prefix')
 sysconfdir = get_option('sysconfdir')
 
 # 如果 sysconfdir 以 prefix 开头,去掉 prefix
-if sysconfdir.startswith(prefix) and not is_nixos
-  sysconfdir = sysconfdir.substring(prefix.length())
+if sysconfdir.startswith(prefix) and not is_nixos and osname != 'freebsd'
+  sysconfdir = sysconfdir.replace(prefix, '')
   # 确保 sysconfdir 是绝对路径
   if not sysconfdir.startswith('/')
     sysconfdir = '/' + sysconfdir
@@ -72,9 +76,8 @@ c_args = [
   '-g',
   '-Wno-unused-function',
   '-DWLR_USE_UNSTABLE',
-  '-D_POSIX_C_SOURCE=200809L',
   '-DVERSION="@0@"'.format(version_with_hash),
-  '-DSYSCONFDIR="@0@"'.format('/etc'),
+  '-DSYSCONFDIR="@0@"'.format(sysconfdir),
 ]
 
 # 仅在 debug 选项启用时添加调试参数