Subject: [PATCH 1/3] gnu: Add libversion.

From: Nicolas Graves <[email-masked]>
Date: Sat, 19 Oct 2024 11:09:13 +0200

* gnu/packages/version-control.scm (libversion): New variable.
---
 gnu/packages/version-control.scm | 34 +++++++++++++++++++++++++++++++-
 1 file changed, 33 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 6bd37fee82..b14ec77ff5 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -47,7 +47,7 @@
 ;;; Copyright © 2022 Maxime Devos <[email-masked]>
 ;;; Copyright © 2022 Dhruvin Gandhi <[email-masked]>
 ;;; Copyright © 2015, 2022 David Thompson <[email-masked]>
-;;; Copyright © 2023 Nicolas Graves <[email-masked]>
+;;; Copyright © 2023, 2024 Nicolas Graves <[email-masked]>
 ;;; Copyright © 2023 Bruno Victal <[email-masked]>
 ;;; Copyright © 2023 Kjartan Oli Agustsson <[email-masked]>
 ;;; Copyright © 2023 Steve George <[email-masked]>
@@ -1251,6 +1251,38 @@ (define-public libgit2-1.3
                    ;; Tests may be disabled if cross-compiling.
                    (format #t "Test suite not run.~%"))))))))))
 
+(define-public libversion
+  (package
+    (name "libversion")
+    (version "3.0.3")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/repology/libversion")
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "186dq3x9w8k5xp4b84ms7f5cm10si3yzs52iscgv0xs58c7rfja4"))))
+    (build-system cmake-build-system)
+    (home-page "https://github.com/repology/libversion")
+    (synopsis "Version string comparison library")
+    (description "This package provides a very advanced string comparison
+library, used by the @url{https://repology.org, Repology} project, and able to
+compare versions with:
+
+@itemize
+@item insignificant components
+@item leading zero
+@item unusual separators
+@item letter suffixes
+@item alphanumeric prerelease components
+@item prerelease keywords
+@item patch, post and pl keywords
+@item customizable handling of ambiguous p keyword
+@end itemize")
+    (license license:expat)))
+
 (define-public git-crypt
   (package
     (name "git-crypt")
-- 
2.46.0