meson: install shell files

Change-Id: I7c30690e5763d095cf7444333f7b687509051c5f
This commit is contained in:
eldritch horrors
2024-03-29 20:10:33 +00:00
parent 1da1f501fc
commit e28dc26084
6 changed files with 46 additions and 5 deletions
+2 -5
View File
@@ -354,13 +354,10 @@ if get_option('profile-build').require(meson.get_compiler('cpp').get_id() == 'cl
endif
subdir('src')
subdir('scripts')
subdir('misc')
if enable_tests
# Just configures `scripts/nix-profile.sh.in` (and copies the original to the build directory).
# Done as a subdirectory to convince Meson to put the configured files
# in `build/scripts` instead of just `build`.
subdir('scripts')
subdir('tests/unit')
subdir('tests/functional')
endif
+8
View File
@@ -0,0 +1,8 @@
configure_file(
input : 'completion.sh',
output : 'nix',
install : true,
install_dir : datadir / 'bash-completion/completions',
install_mode : 'rw-r--r--',
copy : true,
)
+8
View File
@@ -0,0 +1,8 @@
configure_file(
input : 'completion.fish',
output : 'nix.fish',
install : true,
install_dir : datadir / 'fish/vendor_completions.d',
install_mode : 'rw-r--r--',
copy : true,
)
+3
View File
@@ -0,0 +1,3 @@
subdir('bash')
subdir('fish')
subdir('zsh')
+10
View File
@@ -0,0 +1,10 @@
foreach script : [ [ 'completion.zsh', '_nix' ], [ 'run-help-nix' ] ]
configure_file(
input : script[0],
output : script.get(1, script[0]),
install : true,
install_dir : datadir / 'zsh/site-functions',
install_mode : 'rw-r--r--',
copy : true,
)
endforeach
+15
View File
@@ -1,3 +1,5 @@
# configures `scripts/nix-profile.sh.in` (and copies the original to the build directory).
# this is only needed for tests, but running it unconditionally does not hurt enough to care.
configure_file(
input : 'nix-profile.sh.in',
output : 'nix-profile.sh',
@@ -12,3 +14,16 @@ configure_file(
output : 'nix-profile.sh.in',
copy : true,
)
foreach rc : [ '.sh', '.fish', '-daemon.sh', '-daemon.fish' ]
configure_file(
input : 'nix-profile' + rc + '.in',
output : 'nix' + rc,
install : true,
install_dir : sysconfdir / 'profile.d',
install_mode : 'rw-r--r--',
configuration : {
'localstatedir': state_dir,
},
)
endforeach