diff mbox series

[bug#63545,1/3] gnu: heimdal: Build from Git.

Message ID 2262ef65f5191b0c3d925ea6688c1bd8bf0587d0.1684296904.git.felix.lechner@lease-up.com
State New
Headers show
Series gnu: heimdal: Drop obsolete user tools. | expand

Commit Message

Felix Lechner May 17, 2023, 4:20 a.m. UTC
This is in preparation to drop obsolete tools from the Automake files. The
tarball comes with a ./configure script. It was not clear to the author what
the best way was to run 'autoreconf -f -i' with the tarball in Guix's
gnu-build-system.

* gnu/packages/kerberos (heimdal): Build from Git; prepare to drop obsolete
tools from Automake.
---
 gnu/packages/kerberos.scm | 39 +++++++++++++++++++++++----------------
 1 file changed, 23 insertions(+), 16 deletions(-)

Comments

Josselin Poiret May 17, 2023, 8:20 p.m. UTC | #1
Hi Felix,

I am no user of Heimdal, but this looks good to me apart from some
nitpicks below.

Felix Lechner via Guix-patches via <guix-patches@gnu.org> writes:

>  (define-public heimdal
> +  (let ((commit "a6cf94577c0d1e5bca5304342e4ddffb18255afe")
> +        (revision "1"))

No need to use commit+revision for fixed releases, unless upstream has
the bad habit of moving their upstream tags. I see the tag
heimdal-7.8.0, which you should use in (commit ...), possibly with
(commit (string-append "heimdall-" version)).

>    (package
>      (name "heimdal")
> -    (version "7.8.0")
> +    (version (git-version "7.8.0" revision commit))

This would lead to a very ugly version string for what is actually
7.8.0, no need to change this.

The other patches seem fine, although I think you don't need to go as
far as make the indentation change its own patch (and by dropping the
commit+revision thing, there shouldn't be one).

I haven't tried building this yet though, will let QA go over it.

Best,
diff mbox series

Patch

diff --git a/gnu/packages/kerberos.scm b/gnu/packages/kerberos.scm
index c553f8180a..af67bff6c9 100644
--- a/gnu/packages/kerberos.scm
+++ b/gnu/packages/kerberos.scm
@@ -56,6 +56,7 @@  (define-module (gnu packages kerberos)
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix gexp)
+  #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module (guix build-system gnu))
 
@@ -171,26 +172,22 @@  (define-public shishi
     (license license:gpl3+)))
 
 (define-public heimdal
+  (let ((commit "a6cf94577c0d1e5bca5304342e4ddffb18255afe")
+        (revision "1"))
   (package
     (name "heimdal")
-    (version "7.8.0")
+    (version (git-version "7.8.0" revision commit))
     (source (origin
-              (method url-fetch)
-              (uri (string-append
-                    "https://github.com/heimdal/heimdal/releases/download/"
-                    "heimdal-" version "/" "heimdal-" version ".tar.gz"))
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/heimdal/heimdal")
+                    (commit commit)))
+              (file-name (git-file-name name version))
               (sha256
                (base32
-                "0f4dblav859p5hn7b2jdj1akw6d8p32as6bj6zym19kghh3s51zx"))
+                "0df646hzi10s0w07kqzj10aniv6jsbmlpx6j3lqjvpsjpmm9lww9"))
               (patches
-               (search-patches "heimdal-CVE-2022-45142.patch"))
-              (modules '((guix build utils)))
-              (snippet
-               '(begin
-                  (substitute* "configure"
-                    (("User=.*$") "User=Guix\n")
-                    (("Host=.*$") "Host=GNU")
-                    (("Date=.*$") "Date=2022\n"))))))
+               (search-patches "heimdal-CVE-2022-45142.patch"))))
     (build-system gnu-build-system)
     (arguments
      `(#:configure-flags
@@ -224,6 +221,10 @@  (define-public heimdal
                   (add-before 'configure 'pre-configure
                     (lambda* (#:key inputs #:allow-other-keys)
                       (substitute* "configure"
+                        ;; Reproducible build date, etc.
+                        (("User=.*$") "User=Guix\n")
+                        (("Host=.*$") "Host=GNU")
+                        (("Date=.*$") "Date=2022\n")
                         ;; The e2fsprogs input is included for libcom_err,
                         ;; let's use it even if cross-compiling.
                         (("test \"\\$\\{krb_cv_com_err\\}\" = \"yes\"")
@@ -255,12 +256,17 @@  (define-public heimdal
                           (format #t "#!~a~%exit 1~%" (which "sh")))))))
        ;; Tests fail when run in parallel.
        #:parallel-tests? #f))
-    (native-inputs (list bison
+    (native-inputs (list autoconf
+                         automake
+                         bison
                          e2fsprogs      ;for 'compile_et'
                          flex
+                         libtool
                          texinfo
                          unzip          ;for tests
                          pkg-config
+                         perl
+                         perl-json
                          python))
     (inputs (list readline
                   bash-minimal
@@ -274,4 +280,5 @@  (define-public heimdal
     (description
      "Heimdal is an implementation of Kerberos 5 network authentication
 service.")
-    (license license:bsd-3)))
+    (license license:bsd-3))))
+