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') diff --git a/meson.options b/meson.options index 393d61c49..c71ec18ae 100644 --- a/meson.options +++ b/meson.options @@ -50,3 +50,8 @@ option('log-dir', type : 'string', value : '/nix/var/log', option('enable-docs', type : 'boolean', value : true, description : 'whether to build documentation', ) + +# A relative path means it gets appended to prefix. +option('profile-dir', type : 'string', value : 'etc/profile.d', + description : 'the path to install shell profile files', +) diff --git a/scripts/meson.build b/scripts/meson.build index 5bfda71cf..c916c8efa 100644 --- a/scripts/meson.build +++ b/scripts/meson.build @@ -20,7 +20,7 @@ foreach rc : [ '.sh', '.fish', '-daemon.sh', '-daemon.fish' ] input : 'nix-profile' + rc + '.in', output : 'nix' + rc, install : true, - install_dir : sysconfdir / 'profile.d', + install_dir : profile_dir, install_mode : 'rw-r--r--', configuration : { 'localstatedir': state_dir,