Skip to content

Commit

Permalink
Merge pull request #12518 from roberth/libgit2-use-ssh-exec
Browse files Browse the repository at this point in the history
packaging: Restore libgit2 USE_SSH=exec
  • Loading branch information
roberth authored Feb 19, 2025
2 parents e672243 + 5488e29 commit f201446
Showing 1 changed file with 36 additions and 34 deletions.
70 changes: 36 additions & 34 deletions packaging/dependencies.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ let
darwinStdenv = pkgs.overrideSDK prevStdenv { darwinMinVersion = "10.13"; };

in
scope:
{
scope: {
inherit stdenv;

aws-sdk-cpp =
Expand Down Expand Up @@ -66,36 +65,39 @@ scope:
installPhase = lib.replaceStrings [ "--without-python" ] [ "" ] old.installPhase;
});

}
# libgit2: Nixpkgs 24.11 has < 1.9.0
// lib.optionalAttrs (!lib.versionAtLeast pkgs.libgit2.version "1.9.0") {
libgit2 = pkgs.libgit2.overrideAttrs (attrs: {
cmakeFlags = attrs.cmakeFlags or [ ] ++ [ "-DUSE_SSH=exec" ];
nativeBuildInputs =
attrs.nativeBuildInputs or [ ]
# gitMinimal does not build on Windows. See packbuilder patch.
++ lib.optionals (!stdenv.hostPlatform.isWindows) [
# Needed for `git apply`; see `prePatch`
pkgs.buildPackages.gitMinimal
];
# Only `git apply` can handle git binary patches
prePatch =
attrs.prePatch or ""
+ lib.optionalString (!stdenv.hostPlatform.isWindows) ''
patch() {
git apply
}
'';
patches =
attrs.patches or [ ]
++ [
./patches/libgit2-mempack-thin-packfile.patch
]
# gitMinimal does not build on Windows, but fortunately this patch only
# impacts interruptibility
++ lib.optionals (!stdenv.hostPlatform.isWindows) [
# binary patch; see `prePatch`
./patches/libgit2-packbuilder-callback-interruptible.patch
];
});
libgit2 = pkgs.libgit2.overrideAttrs (
attrs:
{
cmakeFlags = attrs.cmakeFlags or [ ] ++ [ "-DUSE_SSH=exec" ];
}
# libgit2: Nixpkgs 24.11 has < 1.9.0, which needs our patches
// lib.optionalAttrs (!lib.versionAtLeast pkgs.libgit2.version "1.9.0") {
nativeBuildInputs =
attrs.nativeBuildInputs or [ ]
# gitMinimal does not build on Windows. See packbuilder patch.
++ lib.optionals (!stdenv.hostPlatform.isWindows) [
# Needed for `git apply`; see `prePatch`
pkgs.buildPackages.gitMinimal
];
# Only `git apply` can handle git binary patches
prePatch =
attrs.prePatch or ""
+ lib.optionalString (!stdenv.hostPlatform.isWindows) ''
patch() {
git apply
}
'';
patches =
attrs.patches or [ ]
++ [
./patches/libgit2-mempack-thin-packfile.patch
]
# gitMinimal does not build on Windows, but fortunately this patch only
# impacts interruptibility
++ lib.optionals (!stdenv.hostPlatform.isWindows) [
# binary patch; see `prePatch`
./patches/libgit2-packbuilder-callback-interruptible.patch
];
}
);
}

0 comments on commit f201446

Please sign in to comment.