Merge pull request #238323 from szlend/fixed-path-codesign-allocate
codesign_allocate: use absolute path
This commit is contained in:
commit
67633c2a6f
@ -79,16 +79,11 @@ rec {
|
||||
let
|
||||
name = last (builtins.split "/" nameOrPath);
|
||||
in
|
||||
pkgs.runCommand name ((if (types.str.check content) then {
|
||||
pkgs.runCommand name (if (types.str.check content) then {
|
||||
inherit content;
|
||||
passAsFile = [ "content" ];
|
||||
} else {
|
||||
contentPath = content;
|
||||
}) // lib.optionalAttrs (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) {
|
||||
# post-link-hook expects codesign_allocate to be in PATH
|
||||
# https://github.com/NixOS/nixpkgs/issues/154203
|
||||
# https://github.com/NixOS/nixpkgs/issues/148189
|
||||
nativeBuildInputs = [ stdenv.cc.bintools ];
|
||||
}) ''
|
||||
${compileScript}
|
||||
${lib.optionalString strip
|
||||
|
@ -0,0 +1,13 @@
|
||||
{ writeTextFile, cctools, sigtool }:
|
||||
|
||||
writeTextFile {
|
||||
name = "post-link-sign-hook";
|
||||
executable = true;
|
||||
|
||||
text = ''
|
||||
if [ "$linkerOutput" != "/dev/null" ]; then
|
||||
CODESIGN_ALLOCATE=${cctools}/bin/${cctools.targetPrefix}codesign_allocate \
|
||||
${sigtool}/bin/codesign -f -s - "$linkerOutput"
|
||||
fi
|
||||
'';
|
||||
}
|
@ -464,6 +464,10 @@ in
|
||||
inherit (selfDarwin) sigtool;
|
||||
};
|
||||
|
||||
postLinkSignHook = prevStage.darwin.postLinkSignHook.override {
|
||||
inherit (selfDarwin) sigtool;
|
||||
};
|
||||
|
||||
binutils = superDarwin.binutils.override {
|
||||
inherit (self) coreutils;
|
||||
inherit (selfDarwin) postLinkSignHook signingUtils;
|
||||
|
@ -133,20 +133,10 @@ impure-cmds // appleSourcePackages // chooseLibs // {
|
||||
|
||||
sigtool = callPackage ../os-specific/darwin/sigtool { };
|
||||
|
||||
postLinkSignHook = pkgs.writeTextFile {
|
||||
name = "post-link-sign-hook";
|
||||
executable = true;
|
||||
|
||||
text = ''
|
||||
if [ "$linkerOutput" != "/dev/null" ]; then
|
||||
CODESIGN_ALLOCATE=${targetPrefix}codesign_allocate \
|
||||
${self.sigtool}/bin/codesign -f -s - "$linkerOutput"
|
||||
fi
|
||||
'';
|
||||
};
|
||||
|
||||
signingUtils = callPackage ../os-specific/darwin/signing-utils { };
|
||||
|
||||
postLinkSignHook = callPackage ../os-specific/darwin/signing-utils/post-link-sign-hook.nix { };
|
||||
|
||||
autoSignDarwinBinariesHook = pkgs.makeSetupHook {
|
||||
name = "auto-sign-darwin-binaries-hook";
|
||||
propagatedBuildInputs = [ self.signingUtils ];
|
||||
|
Loading…
Reference in New Issue
Block a user