Merge pull request #234454 from figsoda/bin

This commit is contained in:
figsoda 2023-05-29 11:47:11 -04:00 committed by GitHub
commit c82114ce5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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