mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-09-28 10:50:15 +00:00
writeTextFile: set meta.mainProgram based on destination
(cherry picked from commit 4b94ae4bc6)
This commit is contained in:
committed by
github-actions[bot]
parent
f3fbbc36b4
commit
bf31528ed1
@@ -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}
|
||||
@@ -350,8 +356,6 @@ rec {
|
||||
runHook postCheck
|
||||
''
|
||||
else checkPhase;
|
||||
|
||||
meta.mainProgram = name;
|
||||
};
|
||||
|
||||
# Create a C binary
|
||||
|
||||
Reference in New Issue
Block a user