@@ -65,39 +65,37 @@ scope: {
6565 installPhase = lib . replaceStrings [ "--without-python" ] [ "" ] old . installPhase ;
6666 } ) ;
6767
68- libgit2 = pkgs . libgit2 . overrideAttrs (
69- attrs :
70- {
71- cmakeFlags = attrs . cmakeFlags or [ ] ++ [ "-DUSE_SSH=exec" ] ;
72- }
73- # libgit2: Nixpkgs 24.11 has < 1.9.0, which needs our patches
74- // lib . optionalAttrs ( ! lib . versionAtLeast pkgs . libgit2 . version "1.9.0" ) {
75- nativeBuildInputs =
76- attrs . nativeBuildInputs or [ ]
77- # gitMinimal does not build on Windows. See packbuilder patch.
78- ++ lib . optionals ( ! stdenv . hostPlatform . isWindows ) [
79- # Needed for `git apply`; see `prePatch`
80- pkgs . buildPackages . gitMinimal
81- ] ;
82- # Only `git apply` can handle git binary patches
83- prePatch =
84- attrs . prePatch or ""
85- + lib . optionalString ( ! stdenv . hostPlatform . isWindows ) ''
86- patch() {
87- git apply
88- }
89- '' ;
90- patches =
91- attrs . patches or [ ]
92- ++ [
93- ./patches/libgit2-mempack-thin-packfile.patch
94- ]
95- # gitMinimal does not build on Windows, but fortunately this patch only
96- # impacts interruptibility
97- ++ lib . optionals ( ! stdenv . hostPlatform . isWindows ) [
98- # binary patch; see `prePatch`
99- ./patches/libgit2-packbuilder-callback-interruptible.patch
100- ] ;
101- }
102- ) ;
68+ libgit2 =
69+ if lib . versionAtLeast pkgs . libgit2 . version "1.9.0" then
70+ pkgs . libgit2
71+ else
72+ pkgs . libgit2 . overrideAttrs ( attrs : {
73+ # libgit2: Nixpkgs 24.11 has < 1.9.0, which needs our patches
74+ nativeBuildInputs =
75+ attrs . nativeBuildInputs or [ ]
76+ # gitMinimal does not build on Windows. See packbuilder patch.
77+ ++ lib . optionals ( ! stdenv . hostPlatform . isWindows ) [
78+ # Needed for `git apply`; see `prePatch`
79+ pkgs . buildPackages . gitMinimal
80+ ] ;
81+ # Only `git apply` can handle git binary patches
82+ prePatch =
83+ attrs . prePatch or ""
84+ + lib . optionalString ( ! stdenv . hostPlatform . isWindows ) ''
85+ patch() {
86+ git apply
87+ }
88+ '' ;
89+ patches =
90+ attrs . patches or [ ]
91+ ++ [
92+ ./patches/libgit2-mempack-thin-packfile.patch
93+ ]
94+ # gitMinimal does not build on Windows, but fortunately this patch only
95+ # impacts interruptibility
96+ ++ lib . optionals ( ! stdenv . hostPlatform . isWindows ) [
97+ # binary patch; see `prePatch`
98+ ./patches/libgit2-packbuilder-callback-interruptible.patch
99+ ] ;
100+ } ) ;
103101}
0 commit comments