diff mbox series

[bug#60358,v2,2/2] gnu: guile-gnutls: Update to 3.7.11.

Message ID 865c55e780549ba03e66c7012965253a45da05fe.camel@planete-kraus.eu
State New
Headers show
Series [bug#60358,v2,1/2] gnu: Add gnulib. | expand

Commit Message

Vivien Kraus Dec. 28, 2022, 2:20 a.m. UTC
* gnu/packages/tls.scm (guile-gnutls) [phases]: Patch-shebang autopull.sh and
autogen.sh.
* gnu/packages/tls.scm (guile-gnutls) [native-inupts]: Add gnulib and git.
---
 gnu/packages/tls.scm | 37 ++++++++++++++++++++++++-------------
 1 file changed, 24 insertions(+), 13 deletions(-)

Comments

Vivien Kraus Dec. 28, 2022, 2:50 a.m. UTC | #1
Le mercredi 28 décembre 2022 à 03:20 +0100, Vivien Kraus a écrit :
> * gnu/packages/tls.scm (guile-gnutls) [phases]: Patch-shebang
> autopull.sh and
> autogen.sh.
> * gnu/packages/tls.scm (guile-gnutls) [native-inupts]: Add gnulib and
> git.
> ---
>  gnu/packages/tls.scm | 37 ++++++++++++++++++++++++-------------
>  1 file changed, 24 insertions(+), 13 deletions(-)

This is not required, but it shows that the gnulib package works.

Best regards,

Vivien
Simon Josefsson Dec. 29, 2022, 2:55 p.m. UTC | #2
Vivien Kraus via Guix-patches via <guix-patches@gnu.org> writes:

> Le mercredi 28 décembre 2022 à 03:20 +0100, Vivien Kraus a écrit :
>> * gnu/packages/tls.scm (guile-gnutls) [phases]: Patch-shebang
>> autopull.sh and
>> autogen.sh.
>> * gnu/packages/tls.scm (guile-gnutls) [native-inupts]: Add gnulib and
>> git.
>> ---
>>  gnu/packages/tls.scm | 37 ++++++++++++++++++++++++-------------
>>  1 file changed, 24 insertions(+), 13 deletions(-)
>
> This is not required, but it shows that the gnulib package works.

Thanks for providing an example package that would use the Guix gnulib
package!

I don't think it actually does what you would want it to do: your
resulting build of guile-gnutls will likely NOT use the exact same
version of gnulib that was used when preparing and tagging the
guile-gnutls release.  That's why this approach uses GNULIB_SRCDIR to
force a different gnulib version than the intended one.  Since gnulib
doesn't offer backwards/future compatibility, this will just cause the
guile-gnutls 3.7.11 build to break at some point, or even introduce
subtle unintended bugs, when the gnulib package is updated.

However, if the 'gnulib' package in Guix would provide a copy of the git
repository, and set GNULIB_REFDIR instead, I believe it would work as
intended: ./bootstrap will pick the gnulib commit from the local copy of
gnulib.  This should always work and is future-proof, as long as the
Guix gnulib package provides all historic gnulib git commits forever.

Taking a step back, I think it boils down to two approaches when
building projects:

1) Download git submodules when download git repository of projects that
use gnulib.  This consumes a lot of bandwidth, but will set up the
project the way most developers build the project.

2) Don't fetch the gnulib git submodule (other git submodules will
probably be required, though, depending on project) and add a dependency
to a Guix 'gnulib' package that ships the entire git repository, and
modify the ./bootstrap call to do ./bootstrap --gnulib-refdir=...'.

Approach 2) is less well tested but I think it would work, and
effectively what it achieves compared to 1) is to reduce the bandwidth
requirements and avoid a dependence on an online Savannah.  Is this
really worth the complexity?  Or is there some other advantage that I'm
missing?

Thanks for caring about how gnulib is used in projects!  It is a
complicated situation, and has tricky bill-of-material and security
consequences.

/Simon
diff mbox series

Patch

diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm
index a74b423ccf..d0f8ca8a15 100644
--- a/gnu/packages/tls.scm
+++ b/gnu/packages/tls.scm
@@ -56,6 +56,7 @@  (define-module (gnu packages tls)
   #:use-module (gnu packages)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages bash)
+  #:use-module (gnu packages build-tools)
   #:use-module (gnu packages check)
   #:use-module (gnu packages curl)
   #:use-module (gnu packages dns)
@@ -80,6 +81,7 @@  (define-module (gnu packages tls)
   #:use-module (gnu packages sphinx)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages time)
+  #:use-module (gnu packages version-control)
   #:use-module (gnu packages base)
   #:use-module (srfi srfi-1))
 
@@ -381,7 +383,7 @@  (define-public guile-gnutls
     ;; This package supersedes the Guile bindings that came with GnuTLS until
     ;; version 3.7.8 included.
     (name "guile-gnutls")
-    (version "3.7.9")
+    (version "3.7.11")
     (home-page "https://gitlab.com/gnutls/guile/")
     (source (origin
               (method git-fetch)
@@ -390,21 +392,28 @@  (define-public guile-gnutls
                     (commit (string-append "v" version))))
               (sha256
                (base32
-                "00sfpqjmd263ka51fq4xf7nvaaxyfqsr3r8fj94jgx45q6q6n6wq"))
+                "06d7v3i0d9ayp7zqk1rsy4z0wfpq69n0r54f1xrppb9gn7q9iva6"))
               (file-name (git-file-name name version))
               (patches (search-patches "gnutls-cross.patch"))))
     (build-system gnu-build-system)
     (arguments
-     '(#:configure-flags
-       ;; Tell the build system that we want Guile bindings installed to
-       ;; the output instead of Guiles own module directory.
-       (list "--disable-static"
-             (string-append "--with-guile-site-dir="
-                            "$(datarootdir)/guile/site/$(GUILE_EFFECTIVE_VERSION)")
-             (string-append "--with-guile-site-ccache-dir="
-                            "$(libdir)/guile/$(GUILE_EFFECTIVE_VERSION)/site-ccache")
-             (string-append "--with-guile-extension-dir="
-                            "$(libdir)/guile/$(GUILE_EFFECTIVE_VERSION)/extensions"))))
+     (list
+      #:configure-flags
+      ;; Tell the build system that we want Guile bindings installed to the
+      ;; output instead of Guiles own module directory.
+      #~(list "--disable-static"
+              (string-append "--with-guile-site-dir="
+                             "$(datarootdir)/guile/site/$(GUILE_EFFECTIVE_VERSION)")
+              (string-append "--with-guile-site-ccache-dir="
+                             "$(libdir)/guile/$(GUILE_EFFECTIVE_VERSION)/site-ccache")
+              (string-append "--with-guile-extension-dir="
+                             "$(libdir)/guile/$(GUILE_EFFECTIVE_VERSION)/extensions"))
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'patch-more-shebangs
+            (lambda _
+              (for-each patch-shebang
+                        '("autopull.sh" "autogen.sh")))))))
     (native-inputs
      (list autoconf
            automake
@@ -412,7 +421,9 @@  (define-public guile-gnutls
            pkg-config
            texinfo
            gnutls                 ;XXX: 'guile-snarf' invokes the native 'cpp'
-           guile-3.0))
+           guile-3.0
+           gnulib ; gnulib requires git even if nothing is downloaded.
+           git))
     (inputs
      (list gnutls-latest
            guile-3.0))