Subject: [bug#60724] [PATCH] gnu: normalize package versions

From: [email-masked]
Date: Tue, 10 Jan 2023 21:58:31 -0500

From: Morgan Smith <[email-masked]>

* gnu/packages/fpga.scm (abc): Use full commit sha.
* gnu/packages/graphics.scm (flux): Use full commit sha and git-version.
* gnu/packages/mail.scm (esmtp): Use full commit sha, git-version, and git-file-name.
* gnu/packages/ruby.scm (ruby-minitest-5.14): Move version from name to
version field.
* gnu/packages/textutils.scm (cityhash): Use full commit sha, git-version, and git-file-name.
---

repology has a script that parses our generated packages.json file.  That
script outputs some warnings related to these packages.  No clue if this patch
fixes that but it might.

There are 714 dependent packages of the 5 I touched

repology logs:
https://repology.org/repositories/updates

 gnu/packages/fpga.scm      |  2 +-
 gnu/packages/graphics.scm  | 41 ++++++++++++++--------------
 gnu/packages/mail.scm      | 55 +++++++++++++++++++-------------------
 gnu/packages/ruby.scm      |  3 +--
 gnu/packages/textutils.scm |  7 ++---
 5 files changed, 55 insertions(+), 53 deletions(-)

diff --git a/gnu/packages/fpga.scm b/gnu/packages/fpga.scm
index acce5f8f82..f4562c27d7 100644
--- a/gnu/packages/fpga.scm
+++ b/gnu/packages/fpga.scm
@@ -65,7 +65,7 @@ (define-module (gnu packages fpga)
   #:use-module (gnu packages libusb))
 
 (define-public abc
- (let ((commit "70cb339f869e")
+ (let ((commit "70cb339f869e485802159d7f2b886130793556c4")
        (revision "2"))
   (package
     (name "abc")
diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm
index f23fad7c50..fcc80c6bed 100644
--- a/gnu/packages/graphics.scm
+++ b/gnu/packages/graphics.scm
@@ -234,27 +234,28 @@ (define-public directfb
     (license license:lgpl2.1+)))
 
 (define-public flux
-  (package
-    (name "flux")
-    (version "1.4.4")
-    (source
-     (origin
-       (method git-fetch)
-       (uri
-        (git-reference
-         (url "https://github.com/deniskropp/flux")
-         (commit "e45758a")))
-       (file-name (git-file-name name version))
-       (sha256
-        (base32 "11f3ypg0sdq5kj69zgz6kih1yrzgm48r16spyvzwvlswng147410"))))
-    (build-system gnu-build-system)
-    (native-inputs
-     (list autoconf automake libtool pkg-config))
-    (synopsis "Interface description language")
-    (description "Flux is an interface description language used by DirectFB.
+  (let ((commit "e45758aa9384b9740ff021ea952399fd113eb0e9")
+        (revision "0"))
+    (package
+      (name "flux")
+      (version (git-version "1.4.4" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/deniskropp/flux")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "11f3ypg0sdq5kj69zgz6kih1yrzgm48r16spyvzwvlswng147410"))))
+      (build-system gnu-build-system)
+      (native-inputs (list autoconf automake libtool pkg-config))
+      (synopsis "Interface description language")
+      (description
+       "Flux is an interface description language used by DirectFB.
 Fluxcomp compiles .flux files to .cpp or .c files.")
-    (home-page "https://www.directfb.org/")
-    (license license:lgpl2.1+))) ; Same as DirectFB
+      (home-page "https://www.directfb.org/")
+      (license license:lgpl2.1+)))) ; Same as DirectFB
 
 (define-public fox
   (package
diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index da2189c1ad..5449714c85 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -2494,38 +2494,39 @@ (define-public libesmtp
     (license (list license:lgpl2.1+ license:gpl2+))))
 
 (define-public esmtp
-  (package
-    (name "esmtp")
-    (version "1.2")
-    (source
-     (origin
-       (method git-fetch)
-       (uri (git-reference
-             (url "https://github.com/andywingo/esmtp")
-             (commit "01bf9fc")))
-       (sha256
-        (base32
-         "1ay282rrl92h0m0m8z5zzjnwiiagi7c78aq2qvhia5mw7prwfyw2"))
-       (file-name (string-append name "-" version "-checkout"))
-       (patches (search-patches "esmtp-add-lesmtp.patch"))))
-    (arguments
-     `(#:phases (modify-phases %standard-phases
-                  (replace 'bootstrap
-                   (lambda _ (invoke "autoreconf" "-vfi"))))))
-    (build-system gnu-build-system)
-    (native-inputs
-     (list bison flex autoconf automake libtool))
-    (inputs
-     (list libesmtp))
-    (home-page "https://sourceforge.net/projects/esmtp/")
-    (synopsis "Relay-only mail transfer agent (MTA)")
-    (description "Esmtp is a simple relay-only mail transfer agent built using
+  (let ((commit "01bf9fc9abc85f3f1c9c47d31591fb21da89e65f")
+        (revision "0"))
+    (package
+      (name "esmtp")
+      (version (git-version "1.2" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/andywingo/esmtp")
+                      (commit commit)))
+                (sha256
+                 (base32
+                  "1ay282rrl92h0m0m8z5zzjnwiiagi7c78aq2qvhia5mw7prwfyw2"))
+                (file-name (git-file-name name version))
+                (patches (search-patches "esmtp-add-lesmtp.patch"))))
+      (arguments
+       `(#:phases (modify-phases %standard-phases
+                    (replace 'bootstrap
+                      (lambda _
+                        (invoke "autoreconf" "-vfi"))))))
+      (build-system gnu-build-system)
+      (native-inputs (list bison flex autoconf automake libtool))
+      (inputs (list libesmtp))
+      (home-page "https://sourceforge.net/projects/esmtp/")
+      (synopsis "Relay-only mail transfer agent (MTA)")
+      (description
+       "Esmtp is a simple relay-only mail transfer agent built using
 libESMTP.  It sends e-mail via a remote SMTP server using credentials from the
 user's @file{$HOME/.esmtprc} configuration file; see the @command{esmtprc} man
 page for more on configuration.  This package also provides minimal
 compatibility shims for the @command{sendmail}, @command{mailq}, and
 @command{newaliases} commands.")
-    (license license:gpl2+)))
+      (license license:gpl2+))))
 
 (define-public fdm
   (package
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 540aab23af..8f44795267 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -4341,8 +4341,7 @@ (define-public ruby-minitest
 (define-public ruby-minitest-5.14
   (package
     (inherit ruby-minitest)
-    (name "ruby-minitest-5.14")
-    (version "")
+    (version "5.14.4")
     (source (origin
               (method url-fetch)
               (uri (rubygems-uri "minitest" version))
diff --git a/gnu/packages/textutils.scm b/gnu/packages/textutils.scm
index 151add964e..4fd545720b 100644
--- a/gnu/packages/textutils.scm
+++ b/gnu/packages/textutils.scm
@@ -316,16 +316,17 @@ (define-public libgtextutils
     (license license:agpl3+)))
 
 (define-public cityhash
-  (let ((commit "8af9b8c"))
+  (let ((commit "8af9b8c2b889d80c22d6bc26ba0df1afb79a30db")
+        (revision "2"))
     (package
       (name "cityhash")
-      (version (string-append "1.1-2." commit))
+      (version (git-version "1.1" revision commit))
       (source (origin
                 (method git-fetch)
                 (uri (git-reference
                       (url "https://github.com/google/cityhash")
                       (commit commit)))
-                (file-name (string-append name "-" version ".tar.gz"))
+                (file-name (git-file-name name version))
                 (sha256
                  (base32
                   "0n6skf5dv8yfl1ckax8dqhvsbslkwc9158zf2ims0xqdvzsahbi6"))))
-- 
2.38.1