Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libgit2: 1.8.4 -> 1.9.0 (also pygit2 update) #373096

Open
wants to merge 14 commits into
base: staging
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion pkgs/by-name/ca/cargo-generate/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
lib,
rustPlatform,
fetchFromGitHub,
fetchpatch,
pkg-config,
libgit2,
openssl,
Expand All @@ -22,7 +23,16 @@ rustPlatform.buildRustPackage rec {
};

useFetchCargoVendor = true;
cargoHash = "sha256-bYxUqgFiO0SuttVFvHIX+Dorno5n4jK+2ck89ngssBM=";

cargoPatches = [
(fetchpatch {
name = "git2-version.patch";
url = "https://github.com/cargo-generate/cargo-generate/commit/be2237177ee7ae996e2991189b07a5d211cd0d01.patch";
hash = "sha256-F/o1EeDBfRhIB8atpOHoc6ZnUFCyD1QkCERv4m/YeWE=";
})
];

cargoHash = "sha256-5cfROJQWIhQNMbDhaCs2bfv4I3KDWcXBsmbbbDQ331s=";

nativeBuildInputs = [ pkg-config ];

Expand Down
6 changes: 3 additions & 3 deletions pkgs/by-name/ca/cargo-update/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@

rustPlatform.buildRustPackage rec {
pname = "cargo-update";
version = "16.0.0";
version = "16.1.0";

src = fetchCrate {
inherit pname version;
hash = "sha256-jLv/9Fvg+1HNIhfm0D/vvMR9J+Enztj9rXQE1kZITGI=";
hash = "sha256-bdIFenNMW5iDQaKS2+lMYVVfc0zpbYNOHQqczpjBNC4=";
};

useFetchCargoVendor = true;
cargoHash = "sha256-uoLs1CMNI0N0MpjTdpxDFubg6dgK57DVrxltF4HvG1k=";
cargoHash = "sha256-KujJB9o5+yHu6mEQOvzGUcBS6/fh/jcnt7/FbUPLefg=";

nativeBuildInputs =
[
Expand Down
9 changes: 9 additions & 0 deletions pkgs/by-name/ed/edopro/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
lib,
stdenv,
fetchFromGitHub,
fetchpatch,
fetchzip,
makeWrapper,
premake5,
Expand Down Expand Up @@ -140,6 +141,14 @@ let
sqlite
];

patches = [
(fetchpatch {
name = "libgit2-version.patch";
url = "https://github.com/edo9300/edopro/commit/f8ddbfff51231827a8dd1dcfcb2dda85f50a56d9.patch";
hash = "sha256-w9VTmWfw6vEyVvsOH+AK9lAbUOV+MagzGQ3Wa5DCS/U=";
})
];

# nixpkgs' gcc stack currently appears to not support LTO
postPatch = ''
substituteInPlace premake5.lua \
Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/ge/gex/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ rustPlatform.buildRustPackage rec {
];

useFetchCargoVendor = true;
cargoHash = "sha256-LCmc0yYuy51r2wHEzsJMfssCElG1AbnLLWYYnbk0Ddw=";
cargoHash = "sha256-4ejtMCuJOwT5bJQZaPQ1OjrB5O70we77yEXk9RmhywE=";

meta = with lib; {
description = "Git Explorer: cross-platform git workflow improvement tool inspired by Magit";
Expand Down
10 changes: 5 additions & 5 deletions pkgs/by-name/ge/gex/patch-libgit2.patch
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ index 5101c2e..0cb59d2 100644
[[package]]
name = "git2"
-version = "0.18.1"
+version = "0.19.0"
+version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fbf97ba92db08df386e10c8ede66a2a0369bd277090afd8710e19e38de9ec0cd"
+checksum = "b903b73e45dc0c6c596f2d37eccece7c1c8bb6e4407b001096387c63d0d93724"
+checksum = "3fda788993cc341f69012feba8bf45c0ba4f3291fcc08e214b4d5a7332d88aff"
dependencies = [
"bitflags 2.3.3",
"libc",
Expand All @@ -29,10 +29,10 @@ index 5101c2e..0cb59d2 100644
[[package]]
name = "libgit2-sys"
-version = "0.16.1+1.7.1"
+version = "0.17.0+1.8.1"
+version = "0.18.0+1.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f2a2bb3680b094add03bb3732ec520ece34da31a8cd2d633d1389d0f0fb60d0c"
+checksum = "10472326a8a6477c3c20a64547b0059e4b0d086869eee31e6d7da728a8eb7224"
+checksum = "e1a117465e7e1597e8febea8bb0c410f1c7fb93b1e1cddf34363f8390367ffec"
dependencies = [
"cc",
"libc",
Expand All @@ -45,7 +45,7 @@ index 26cef3f..f947945 100644
crossterm = { version = "0.27.0", features = ["serde"] }
dirs = "5.0.1"
-git2 = { version = "0.18.1", default-features = false }
+git2 = { version = "0.19.0", default-features = false }
+git2 = { version = "0.20.0", default-features = false }
itertools = "0.11.0"
nom = "7.1.3"
paste = "1.0.14"
Expand Down
12 changes: 11 additions & 1 deletion pkgs/by-name/gi/git-mit/package.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{ lib
, rustPlatform
, fetchFromGitHub
, fetchpatch
, pkg-config
, libgit2
, openssl
Expand All @@ -24,7 +25,16 @@ rustPlatform.buildRustPackage {
};

useFetchCargoVendor = true;
cargoHash = "sha256-sdAs8zJlmTqapWJNDck9YUHIiXhi0Ji6smejE5jEQXQ=";

cargoPatches = [
(fetchpatch {
name = "libgit2-update.patch";
url = "https://github.com/PurpleBooth/git-mit/pull/1543/commits/3e82a4f5017972c7d28151a468bb71fe7d2279e0.patch";
hash = "sha256-M9RpZHjOpZZqdHQe57LwMZ9zX6/4BNg3ymz8H3qupFk=";
})
];

cargoHash = "sha256-uoS6vmHmOVkHS81mrsbbXqP/dAC/FNHAlpTDHSa632k=";

nativeBuildInputs = [ pkg-config ];

Expand Down
6 changes: 3 additions & 3 deletions pkgs/by-name/gi/git-warp-time/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@

stdenv.mkDerivation (finalAttrs: {
pname = "git-warp-time";
version = "0.8.4";
version = "0.8.5";

src = fetchurl {
url = "https://github.com/alerque/git-warp-time/releases/download/v${finalAttrs.version}/git-warp-time-${finalAttrs.version}.tar.zst";
hash = "sha256-Xh30nA77cJ7+UfKlIslnyD+93AtnQ+8P3sCFsG0DAUk=";
hash = "sha256-bt94Y1EIcLzz1v2Nwyde63y6FWD+iaFkoEYoQpWVWGY=";
};

cargoDeps = rustPlatform.fetchCargoTarball {
inherit (finalAttrs) pname version src;
nativeBuildInputs = [ zstd ];
hash = "sha256-bmClqtH1xU2KOKVbCOrgN14jpLKiA2ZMzWwrOiufwnQ=";
hash = "sha256-qUhMTuvli4hUyHrFWmyaB1Rc/DS9Epae9S/mp6c9LSw=";
};

nativeBuildInputs = [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
From cc70ed70b19a712babd834806d6fc700b20c020a Mon Sep 17 00:00:00 2001
From: Emily <[email protected]>
Date: Wed, 22 Jan 2025 23:25:51 +0000
Subject: [PATCH 1/2] =?UTF-8?q?structs:=20Omit=20=E2=80=98free=E2=80=99=20?=
=?UTF-8?q?field=20from=20=E2=80=98%config-entry=E2=80=99=20on=20libgit2?=
=?UTF-8?q?=201.9+.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* configure.ac: Check for the ‘free’ field of ‘git_config_entry’.
* git/configuration.scm.in (%have-config-entry-free?): New variable.
* git/structs.scm (%config-entry): Omit ‘free’ field conditionally.
---
configure.ac | 10 ++++++++++
git/configuration.scm.in | 4 ++++
git/structs.scm | 4 +++-
3 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index b04ca6b..7f8f0b9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -87,6 +87,16 @@ else
fi
AC_SUBST([HAVE_CONFIG_ENTRY_BACKEND_TYPE])

+dnl Does 'git_config_entry' have 'free'? Removed in 1.9.
+AC_CHECK_MEMBER([git_config_entry.free], [], [],
+ [[#include <git2.h>]])
+if test "x$ac_cv_member_git_config_entry_free" = "xyes"; then
+ HAVE_CONFIG_ENTRY_FREE="#true"
+else
+ HAVE_CONFIG_ENTRY_FREE="#false"
+fi
+AC_SUBST([HAVE_CONFIG_ENTRY_FREE])
+
dnl Does 'git_diff_options' have 'oid_type'? It's new in 1.7.
AC_CHECK_MEMBER([git_diff_options.oid_type], [], [],
[[#include <git2.h>]])
diff --git a/git/configuration.scm.in b/git/configuration.scm.in
index e10b195..864b9ff 100644
--- a/git/configuration.scm.in
+++ b/git/configuration.scm.in
@@ -24,6 +24,7 @@
%have-fetch-options-depth?
%have-diff-options-oid-type?
%have-config-entry-backend-type?
+ %have-config-entry-free?
%have-GIT_OPT_SET_SERVER_CONNECT_TIMEOUT?
%have-GIT_OPT_SET_HOMEDIR?
%have-GIT_OPT_SET_USER_AGENT_PRODUCT?))
@@ -48,6 +49,9 @@
(define %have-config-entry-backend-type?
@HAVE_CONFIG_ENTRY_BACKEND_TYPE@)

+(define %have-config-entry-free?
+ @HAVE_CONFIG_ENTRY_FREE@)
+
(define %have-GIT_OPT_SET_SERVER_CONNECT_TIMEOUT?
@HAVE_GIT_OPT_SET_SERVER_CONNECT_TIMEOUT@)

diff --git a/git/structs.scm b/git/structs.scm
index beebd11..b35ae6d 100644
--- a/git/structs.scm
+++ b/git/structs.scm
@@ -505,7 +505,9 @@
'())
(include-depth ,unsigned-int)
(level ,int) ;git_config_level_t
- (free ,(bs:pointer int))
+ ,@(if %have-config-entry-free?
+ `(free ,(bs:pointer int))
+ '())
,@(if %have-config-entry-backend-type?
'()
`((payload ,(bs:pointer int))))))) ;removed in 1.8
--
2.47.0

Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
From 595b850c85f55592b94d2218a12084fd7050b508 Mon Sep 17 00:00:00 2001
From: Emily <[email protected]>
Date: Wed, 22 Jan 2025 23:55:45 +0000
Subject: [PATCH 2/2] =?UTF-8?q?structs:=20Add=20=E2=80=98update-refs?=
=?UTF-8?q?=E2=80=99=20field=20to=20=E2=80=98%remote-callbacks=E2=80=99=20?=
=?UTF-8?q?on=20libgit2=201.9+.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* configure.ac: Check for the ‘update_refs’ field of
‘git_remote_callbacks’.
* git/configuration.scm.in (%have-remote-callbacks-update-refs?): New
variable.
* git/structs.scm (%remote-callbacks): Add ‘update-refs’ field
conditionally.
---
configure.ac | 10 ++++++++++
git/configuration.scm.in | 4 ++++
git/structs.scm | 5 ++++-
3 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 7f8f0b9..a2575f4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -107,6 +107,16 @@ else
fi
AC_SUBST([HAVE_DIFF_OPTIONS_OID_TYPE])

+dnl Does 'git_remote_callbacks' have 'update_refs'? New in 1.9.
+AC_CHECK_MEMBER([git_remote_callbacks.update_refs], [], [],
+ [[#include <git2.h>]])
+if test "x$ac_cv_member_git_remote_callbacks_update_refs" = "xyes"; then
+ HAVE_REMOTE_CALLBACKS_UPDATE_REFS="#true"
+else
+ HAVE_REMOTE_CALLBACKS_UPDATE_REFS="#false"
+fi
+AC_SUBST([HAVE_REMOTE_CALLBACKS_UPDATE_REFS])
+
dnl 'GIT_OPT_SET_SERVER_CONNECT_TIMEOUT' & co. are new in 1.7.
GUILE_GIT_CHECK_DECLARATION([GIT_OPT_SET_SERVER_CONNECT_TIMEOUT])

diff --git a/git/configuration.scm.in b/git/configuration.scm.in
index 864b9ff..1e82c24 100644
--- a/git/configuration.scm.in
+++ b/git/configuration.scm.in
@@ -25,6 +25,7 @@
%have-diff-options-oid-type?
%have-config-entry-backend-type?
%have-config-entry-free?
+ %have-remote-callbacks-update-refs?
%have-GIT_OPT_SET_SERVER_CONNECT_TIMEOUT?
%have-GIT_OPT_SET_HOMEDIR?
%have-GIT_OPT_SET_USER_AGENT_PRODUCT?))
@@ -52,6 +53,9 @@
(define %have-config-entry-free?
@HAVE_CONFIG_ENTRY_FREE@)

+(define %have-remote-callbacks-update-refs?
+ @HAVE_REMOTE_CALLBACKS_UPDATE_REFS@)
+
(define %have-GIT_OPT_SET_SERVER_CONNECT_TIMEOUT?
@HAVE_GIT_OPT_SET_SERVER_CONNECT_TIMEOUT@)

diff --git a/git/structs.scm b/git/structs.scm
index b35ae6d..664a7c1 100644
--- a/git/structs.scm
+++ b/git/structs.scm
@@ -670,7 +670,10 @@ type to 'specified for this to take effect."
(transport ,(bs:pointer uint8))
(remote-ready ,(bs:pointer void))
(payload ,(bs:pointer uint8))
- (resolve-url ,(bs:pointer uint8)))))
+ (resolve-url ,(bs:pointer uint8))
+ ,@(if %have-remote-callbacks-update-refs?
+ `((update-refs ,(bs:pointer uint8)))
+ '()))))

(define-record-type <remote-callbacks>
(%make-remote-callbacks bytestructure)
--
2.47.0

9 changes: 8 additions & 1 deletion pkgs/by-name/gu/guile-git/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ stdenv.mkDerivation rec {
hash = "sha256-lFBoA1VBJRHcZkP3h2gnlXQrMjDFWS4jl9RlF8VVf/Q=";
};

patches = [
./0001-structs-Omit-free-field-from-config-entry-on-libgit2.patch
./0002-structs-Add-update-refs-field-to-remote-callbacks-on.patch
];

strictDeps = true;
nativeBuildInputs = [
autoreconfHook guile pkg-config texinfo
Expand All @@ -30,7 +35,7 @@ stdenv.mkDerivation rec {
propagatedBuildInputs = [
libgit2 scheme-bytestructures
];
doCheck = !stdenv.hostPlatform.isDarwin;
doCheck = true;
makeFlags = [ "GUILE_AUTO_COMPILE=0" ];

enableParallelBuilding = true;
Expand All @@ -40,6 +45,8 @@ stdenv.mkDerivation rec {
sed -i -e '94i (test-skip 1)' ./tests/proxy.scm
'';

__darwinAllowLocalNetworking = true;

meta = with lib; {
description = "Bindings to Libgit2 for GNU Guile";
homepage = "https://gitlab.com/guile-git/guile-git";
Expand Down
Loading