1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 02:21:16 +02:00

packaging: Restore libgit2 USE_SSH=exec

... when nixpkgs is nixos-unstable or the overlay is used.
This commit is contained in:
Robert Hensing 2025-02-19 00:36:29 +01:00
parent e672243bed
commit 5488e29d2f

View file

@ -29,8 +29,7 @@ let
darwinStdenv = pkgs.overrideSDK prevStdenv { darwinMinVersion = "10.13"; }; darwinStdenv = pkgs.overrideSDK prevStdenv { darwinMinVersion = "10.13"; };
in in
scope: scope: {
{
inherit stdenv; inherit stdenv;
aws-sdk-cpp = aws-sdk-cpp =
@ -66,36 +65,39 @@ scope:
installPhase = lib.replaceStrings [ "--without-python" ] [ "" ] old.installPhase; installPhase = lib.replaceStrings [ "--without-python" ] [ "" ] old.installPhase;
}); });
} libgit2 = pkgs.libgit2.overrideAttrs (
# libgit2: Nixpkgs 24.11 has < 1.9.0 attrs:
// lib.optionalAttrs (!lib.versionAtLeast pkgs.libgit2.version "1.9.0") { {
libgit2 = pkgs.libgit2.overrideAttrs (attrs: { cmakeFlags = attrs.cmakeFlags or [ ] ++ [ "-DUSE_SSH=exec" ];
cmakeFlags = attrs.cmakeFlags or [ ] ++ [ "-DUSE_SSH=exec" ]; }
nativeBuildInputs = # libgit2: Nixpkgs 24.11 has < 1.9.0, which needs our patches
attrs.nativeBuildInputs or [ ] // lib.optionalAttrs (!lib.versionAtLeast pkgs.libgit2.version "1.9.0") {
# gitMinimal does not build on Windows. See packbuilder patch. nativeBuildInputs =
++ lib.optionals (!stdenv.hostPlatform.isWindows) [ attrs.nativeBuildInputs or [ ]
# Needed for `git apply`; see `prePatch` # gitMinimal does not build on Windows. See packbuilder patch.
pkgs.buildPackages.gitMinimal ++ lib.optionals (!stdenv.hostPlatform.isWindows) [
]; # Needed for `git apply`; see `prePatch`
# Only `git apply` can handle git binary patches pkgs.buildPackages.gitMinimal
prePatch = ];
attrs.prePatch or "" # Only `git apply` can handle git binary patches
+ lib.optionalString (!stdenv.hostPlatform.isWindows) '' prePatch =
patch() { attrs.prePatch or ""
git apply + lib.optionalString (!stdenv.hostPlatform.isWindows) ''
} patch() {
''; git apply
patches = }
attrs.patches or [ ] '';
++ [ patches =
./patches/libgit2-mempack-thin-packfile.patch attrs.patches or [ ]
] ++ [
# gitMinimal does not build on Windows, but fortunately this patch only ./patches/libgit2-mempack-thin-packfile.patch
# impacts interruptibility ]
++ lib.optionals (!stdenv.hostPlatform.isWindows) [ # gitMinimal does not build on Windows, but fortunately this patch only
# binary patch; see `prePatch` # impacts interruptibility
./patches/libgit2-packbuilder-callback-interruptible.patch ++ lib.optionals (!stdenv.hostPlatform.isWindows) [
]; # binary patch; see `prePatch`
}); ./patches/libgit2-packbuilder-callback-interruptible.patch
];
}
);
} }