blob: 35e02d450e5123a97f735a0e004493fff8ae9f9e (
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
31
32
33
|
{
pkgs,
shell-library,
...
}: {
makeShellScriptWithLibrary = {
dependencies,
name,
script,
...
}:
pkgs.runCommandLocal name {
nativeBuildInputs = [pkgs.makeWrapper] ++ dependencies;
} ''
install -m755 ${script} -D "$out/bin/${name}"
sed -i 's|%SHELL_LIBRARY_PATH|${shell-library}/lib|' "$out/bin/${name}"
patchShebangs "$out/bin/${name}"
wrapProgram "$out/bin/${name}" --prefix PATH : ${pkgs.lib.makeBinPath dependencies}
'';
makeShellScriptWithLibraryUnwrapped = {
name,
script,
...
}:
pkgs.runCommandLocal name {
nativeBuildInputs = [];
} ''
install -m755 ${script} -D "$out/bin/${name}"
sed -i 's|%SHELL_LIBRARY_PATH|${shell-library}/lib|' "$out/bin/${name}"
patchShebangs "$out/bin/${name}"
'';
}
|