aboutsummaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorQyriad <qyriad@qyriad.me>2024-04-09 02:03:24 -0600
committerQyriad <qyriad@qyriad.me>2024-04-09 02:25:58 -0600
commit4b99f43aeb34f4b27ed5d8090b8822bee3365f2b (patch)
tree529950823018e4ac5b5850f34919de4fa107c787 /meson.build
parent2a98fe28cb18b117e4eabc8a3e237bf2606d9a51 (diff)
meson: correctly differentiate $profiledir and $sysconfdir/profile.d
The configured sysconfdir is used to look for nix.conf, so it needs to be /etc, and not $out/etc, so we separate out the place where shell profile files are installed, which is the only other place sysconfdir is at all used. See https://git.lix.systems/lix-project/lix/issues/231#issuecomment-1989 for more info. Change-Id: Idbed8ba82e711b8a9d6b6127904befa27d58e279
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build10
1 files changed, 9 insertions, 1 deletions
diff --git a/meson.build b/meson.build
index 456be5aa2..22739a4ab 100644
--- a/meson.build
+++ b/meson.build
@@ -45,7 +45,6 @@ prefix = get_option('prefix')
path_opts = [
# Meson built-ins.
'datadir',
- 'sysconfdir',
'bindir',
'mandir',
'libdir',
@@ -55,12 +54,14 @@ path_opts = [
'store-dir',
'state-dir',
'log-dir',
+ 'profile-dir',
]
# For your grepping pleasure, this loop sets the following variables that aren't mentioned
# literally above:
# store_dir
# state_dir
# log_dir
+# profile_dir
foreach optname : path_opts
varname = optname.replace('-', '_')
path = get_option(optname)
@@ -71,6 +72,13 @@ foreach optname : path_opts
endif
endforeach
+# sysconfdir doesn't get anything installed to directly, and is only used to
+# tell Lix where to look for nix.conf, so it doesn't get appended to prefix.
+sysconfdir = get_option('sysconfdir')
+if not fs.is_absolute(sysconfdir)
+ sysconfdir = '/' / sysconfdir
+endif
+
enable_docs = get_option('enable-docs')
enable_tests = get_option('enable-tests')