mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-26 08:53:21 +00:00
Merge pull request #234454 from figsoda/bin
This commit is contained in:
commit
c82114ce5d
@ -135,9 +135,15 @@ rec {
|
||||
, allowSubstitutes ? false
|
||||
, preferLocalBuild ? true
|
||||
}:
|
||||
let
|
||||
matches = builtins.match "/bin/([^/]+)" destination;
|
||||
in
|
||||
runCommand name
|
||||
{ inherit text executable checkPhase meta allowSubstitutes preferLocalBuild;
|
||||
{ inherit text executable checkPhase allowSubstitutes preferLocalBuild;
|
||||
passAsFile = [ "text" ];
|
||||
meta = lib.optionalAttrs (executable && matches != null) {
|
||||
mainProgram = lib.head matches;
|
||||
} // meta;
|
||||
}
|
||||
''
|
||||
target=$out${lib.escapeShellArg destination}
|
||||
@ -230,7 +236,7 @@ rec {
|
||||
|
||||
|
||||
*/
|
||||
writeScriptBin = name: text: writeTextFile {inherit name text; executable = true; destination = "/bin/${name}"; meta.mainProgram = name;};
|
||||
writeScriptBin = name: text: writeTextFile {inherit name text; executable = true; destination = "/bin/${name}";};
|
||||
|
||||
/*
|
||||
Similar to writeScript. Writes a Shell script and checks its syntax.
|
||||
@ -288,7 +294,6 @@ rec {
|
||||
checkPhase = ''
|
||||
${stdenv.shellDryRun} "$target"
|
||||
'';
|
||||
meta.mainProgram = name;
|
||||
};
|
||||
|
||||
/*
|
||||
@ -351,8 +356,6 @@ rec {
|
||||
runHook postCheck
|
||||
''
|
||||
else checkPhase;
|
||||
|
||||
meta.mainProgram = name;
|
||||
};
|
||||
|
||||
# Create a C binary
|
||||
|
Loading…
Reference in New Issue
Block a user