git-annex: wrap with coreutils on all platforms

Co-authored-by: sternenseemann <sternenseemann@systemli.org>
This commit is contained in:
Atemu 2022-07-18 17:31:13 +02:00
parent 8f485713f5
commit 9c98a3908d

View File

@ -535,9 +535,7 @@ self: super: builtins.intersectAttrs super {
})
(addBuildTools (with pkgs.buildPackages; [makeWrapper python3Packages.sphinx]) super.futhark);
git-annex = let
pathForDarwin = pkgs.lib.makeBinPath [ pkgs.coreutils ];
in overrideCabal (drv: pkgs.lib.optionalAttrs (!pkgs.stdenv.isLinux) {
git-annex = overrideCabal (drv: {
# This is an instance of https://github.com/NixOS/nix/pull/1085
# Fails with:
# gpg: can't connect to the agent: File name too long
@ -545,11 +543,12 @@ self: super: builtins.intersectAttrs super {
substituteInPlace Test.hs \
--replace ', testCase "crypto" test_crypto' ""
'' + (drv.postPatch or "");
# On Darwin, git-annex mis-detects options to `cp`, so we wrap the
# binary to ensure it uses Nixpkgs' coreutils.
# Ensure git-annex uses the exact same coreutils it saw at build-time.
# This is especially important on Darwin but also in Linux environments
# where non-GNU coreutils are used by default.
postFixup = ''
wrapProgram $out/bin/git-annex \
--prefix PATH : "${pathForDarwin}"
--prefix PATH : "${pkgs.lib.makeBinPath [ pkgs.coreutils ]}"
'' + (drv.postFixup or "");
buildTools = [
pkgs.buildPackages.makeWrapper