aboutsummaryrefslogtreecommitdiffstats
path: root/guix/guile-git
diff options
context:
space:
mode:
Diffstat (limited to 'guix/guile-git')
-rw-r--r--guix/guile-git/guile-git-merge-31-fix-clone-tests.patch39
-rw-r--r--guix/guile-git/guile-git-merge-32-libgit2-1.2.0.patch100
-rw-r--r--guix/guile-git/guile-git.spec20
3 files changed, 153 insertions, 6 deletions
diff --git a/guix/guile-git/guile-git-merge-31-fix-clone-tests.patch b/guix/guile-git/guile-git-merge-31-fix-clone-tests.patch
new file mode 100644
index 0000000..4a0b6ef
--- /dev/null
+++ b/guix/guile-git/guile-git-merge-31-fix-clone-tests.patch
@@ -0,0 +1,39 @@
+From 04edea32ea9393b6b8fa77db5f568aaf773cdffd Mon Sep 17 00:00:00 2001
+From: Will Frew <will.frew1@gmail.com>
+Date: Sat, 2 Oct 2021 12:11:13 +0300
+Subject: [PATCH] Fixes git clone tests when running against openssh 8.8
+
+OpenSSH 8.8 turns off the hostkey algorithm 'ssh-rsa' by default.
+See: https://www.openssh.com/txt/release-8.8
+
+Unfortunately, libssh2 (and therefore libgit2) do not yet support the
+newer sha2-based ssh hostkey algorithms.
+See upstream issue: https://github.com/libssh2/libssh2/issues/536
+
+This explicitly re-enables ssh-rsa on the sshd that is spun up for
+testing to ensure that libgit2 can handshake with it again.
+---
+ tests/ssh.scm.in | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/tests/ssh.scm.in b/tests/ssh.scm.in
+index e6621ca..0311681 100644
+--- a/tests/ssh.scm.in
++++ b/tests/ssh.scm.in
+@@ -61,6 +61,13 @@ AuthorizedKeysFile ~a
+ PidFile ~a
+ PermitUserEnvironment yes
+
++# libssh2 and therefore libgit2 do not yet support
++# sha2-based rsa algorithms.
++# See upstream issue:
++# https://github.com/libssh2/libssh2/issues/536
++HostkeyAlgorithms +ssh-rsa
++PubkeyAcceptedAlgorithms +ssh-rsa
++
+ # Disable permission checks on auth files for the sake
+ # of isolated build environments.
+ StrictModes no~%"
+--
+GitLab
+
diff --git a/guix/guile-git/guile-git-merge-32-libgit2-1.2.0.patch b/guix/guile-git/guile-git-merge-32-libgit2-1.2.0.patch
new file mode 100644
index 0000000..d1ec232
--- /dev/null
+++ b/guix/guile-git/guile-git-merge-32-libgit2-1.2.0.patch
@@ -0,0 +1,100 @@
+From 278d23a18df6913bfe87c214d0e6dbeee6996f1d Mon Sep 17 00:00:00 2001
+From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
+Date: Mon, 22 Nov 2021 22:08:31 -0500
+Subject: [PATCH 1/3] structs: Adjust %remote-callbacks for libgit2 v1.2.0.
+
+Fixes <https://gitlab.com/guile-git/guile-git/-/issues/23>.
+
+* configure.ac (AC_CHECK_MEMBER)
+<git_remote_callbacks.remote_ready>: New member check.
+<git_remote_callbacks.resolve_url>: Streamline.
+* git/config.scm.in (%have-remote-callbacks-remote-ready?): New variable.
+* git/structs.scm (%remote-callbacks): Conditionally add the new
+callback 'remote_ready' callback field.
+---
+ configure.ac | 18 ++++++++++++------
+ git/configuration.scm.in | 6 ++++++
+ git/structs.scm | 6 ++++++
+ 3 files changed, 24 insertions(+), 6 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 107e6ca..20e9019 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -2,6 +2,7 @@ dnl Guile-Git --- GNU Guile bindings of libgit2
+ dnl Copyright © 2016-2018 Erik Edrosa <erik.edrosa@gmail.com>
+ dnl Copyright © 2017, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
+ dnl Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
++dnl Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+ dnl
+ dnl This file is part of Guile-Git.
+ dnl
+@@ -43,15 +44,20 @@ AS_IF([test "x$LIBGIT2_LIBDIR" = "x"], [
+ ])
+ AC_SUBST([LIBGIT2_LIBDIR])
+
++dnl Does the 'git_remote_callbacks' struct have a 'remote_ready' field?
++dnl It was added in 1.2.0, obsoleting 'resolve_url'.
++AC_CHECK_MEMBER([git_remote_callbacks.remote_ready],
++ [HAVE_REMOTE_CALLBACKS_REMOTE_READY="#true"],
++ [HAVE_REMOTE_CALLBACKS_REMOTE_READY="#false"],
++ [[#include <git2.h>]])
++AC_SUBST([HAVE_REMOTE_CALLBACKS_REMOTE_READY])
++
+ dnl Does the 'git_remote_callbacks' struct have a 'resolve_url' field?
+ dnl It's missing in libgit2 0.28.5, added in 1.0.
+-AC_CHECK_MEMBER([git_remote_callbacks.resolve_url], [], [],
++AC_CHECK_MEMBER([git_remote_callbacks.resolve_url],
++ [HAVE_REMOTE_CALLBACKS_RESOLVE_URL="#true"],
++ [HAVE_REMOTE_CALLBACKS_RESOLVE_URL="#false"],
+ [[#include <git2.h>]])
+-if test "x$ac_cv_member_git_remote_callbacks_resolve_url" = "xyes"; then
+- HAVE_REMOTE_CALLBACKS_RESOLVE_URL="#true"
+-else
+- HAVE_REMOTE_CALLBACKS_RESOLVE_URL="#false"
+-fi
+ AC_SUBST([HAVE_REMOTE_CALLBACKS_RESOLVE_URL])
+
+ dnl Those binaries are required for ssh authentication tests.
+diff --git a/git/configuration.scm.in b/git/configuration.scm.in
+index c45f698..64c4360 100644
+--- a/git/configuration.scm.in
++++ b/git/configuration.scm.in
+@@ -19,11 +19,17 @@
+
+ (define-module (git configuration)
+ #:export (%libgit2
++ %have-remote-callbacks-remote-ready?
+ %have-remote-callbacks-resolve-url?))
+
+ (define %libgit2
+ "@LIBGIT2_LIBDIR@/libgit2")
+
++(define %have-remote-callbacks-remote-ready?
++ ;; True if the 'git_remote_callbacks' struct has a
++ ;; 'remote_ready' field.
++ @HAVE_REMOTE_CALLBACKS_REMOTE_READY@)
++
+ (define %have-remote-callbacks-resolve-url?
+ ;; True if the 'git_remote_callbacks' struct has a 'resolve_url' field.
+ @HAVE_REMOTE_CALLBACKS_RESOLVE_URL@)
+diff --git a/git/structs.scm b/git/structs.scm
+index ca51728..be3d050 100644
+--- a/git/structs.scm
++++ b/git/structs.scm
+@@ -637,6 +637,12 @@ type to 'specified for this to take effect."
+ (push-update-reference ,(bs:pointer uint8))
+ (push-negotiation ,(bs:pointer uint8))
+ (transport ,(bs:pointer uint8))
++
++ ;; Added in libgit2 1.2.0.
++ ,@(if %have-remote-callbacks-remote-ready?
++ `((remote-ready ,(bs:pointer uint8)))
++ '())
++
+ (payload ,(bs:pointer uint8))
+
+ ;; libgit2 1.0 added this field, which is missing from 0.28.5,
+--
+GitLab
+
diff --git a/guix/guile-git/guile-git.spec b/guix/guile-git/guile-git.spec
index 959fb96..fd460ca 100644
--- a/guix/guile-git/guile-git.spec
+++ b/guix/guile-git/guile-git.spec
@@ -8,20 +8,23 @@
Name: guile-git
Version: 0.5.2
-Release: 3%{?dist}
+Release: 4%{?dist}
Summary: Guile bindings of libgit2
License: GPLv3+ and LGPLv3+
URL: https://gitlab.com/guile-git/guile-git
Source0: https://gitlab.com/guile-git/guile-git/uploads/6450f3991aa524484038cdcea3fb248d/guile-git-%{version}.tar.gz
+Patch0: guile-git-merge-31-fix-clone-tests.patch
+Patch1: guile-git-merge-32-libgit2-1.2.0.patch
-%global guile_source_dir %{_datadir}/guile/site/2.2
-%global guile_ccache_dir %{_libdir}/guile/2.2/site-ccache
+%global guile_source_dir %{_datadir}/guile/site/3.0
+%global guile_ccache_dir %{_libdir}/guile/3.0/site-ccache
BuildRequires: gcc
BuildRequires: autoconf, automake, texinfo
-BuildRequires: pkgconfig(guile-2.2), pkgconfig(libgit2), guile-bytestructures
-Requires: guile22, guile-bytestructures, libgit2-devel
+BuildRequires: pkgconfig(guile-3.0), pkgconfig(libgit2), guile-bytestructures
+BuildRequires: git, openssh-clients, openssh-server
+Requires: guile30, guile-bytestructures, libgit2-devel
Requires(post): info
Requires(preun): info
@@ -35,7 +38,8 @@ repositories of the Git version control system.
%build
-%configure GUILE=%{_bindir}/guile2.2 GUILD=%{_bindir}/guild2.2
+autoreconf -fiv
+%configure
%make_build
@@ -75,6 +79,10 @@ fi
%changelog
+* Sun Feb 12 2023 Ting-Wei Lan <lantw44@gmail.com> - 0.5.2-4
+- Switch to Guile 3.0
+- Run SSH tests
+
* Sat Oct 29 2022 Ting-Wei Lan <lantw44@gmail.com> - 0.5.2-3
- Rebuilt for Fedora 37 and 38