Skip to content

Commit

Permalink
Merge pull request #5539 from input-output-hk/angerman/fix-macos-sign…
Browse files Browse the repository at this point in the history
…atures

Add darwin.signingUtils
  • Loading branch information
angerman authored Nov 15, 2023
2 parents 2532482 + 677711d commit 978b82a
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions nix/set-git-rev.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
{ pkgs }:
drv:
pkgs.buildPackages.runCommand drv.name
with pkgs;
buildPackages.runCommand drv.name
{
inherit (drv) exeName exePath meta passthru;
} ''
# this is to ensure we are re-signing macOS binaries that might have been
# mutilated by set-git-rev (e.g. patching in the git revision.)
nativeBuildInputs = lib.optionals hostPlatform.isDarwin [ darwin.signingUtils ];
} (''
mkdir -p $out
cp --no-preserve=timestamps --recursive ${drv}/* $out/
chmod -R +w $out/bin
${pkgs.pkgsBuildBuild.haskellBuildUtils}/bin/set-git-rev "${pkgs.gitrev}" $out/bin/*
''
${pkgsBuildBuild.haskellBuildUtils}/bin/set-git-rev "${gitrev}" $out/bin/*
'' + lib.optionalString hostPlatform.isDarwin ''
for exe in $out/bin/*; do
signIfRequired "$exe"
done
'')

0 comments on commit 978b82a

Please sign in to comment.