Subject: [bug#76150] [PATCH 14/16] gnu: Add libsemigroups.

From: Vinicius Monego <[email-masked]>
Date: Sun, 9 Feb 2025 01:52:31 +0000

* gnu/packages/algebra.scm (libsemigroups): New variable.

Change-Id: I6e929fe6b479c7e7c2b5b4632759bd781af3c927
---
 gnu/packages/algebra.scm | 41 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/gnu/packages/algebra.scm b/gnu/packages/algebra.scm
index 8175589006..9da5f0124c 100644
--- a/gnu/packages/algebra.scm
+++ b/gnu/packages/algebra.scm
@@ -63,6 +63,7 @@ (define-module (gnu packages algebra)
   #:use-module (gnu packages ocaml)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages pretty-print)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-build)
@@ -1836,6 +1837,46 @@ (define-public r-dtt
 (@dfn{DHT}).")
     (license license:gpl2+)))
 
+(define-public libsemigroups
+  (package
+    (name "libsemigroups")
+    (version "2.7.1")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/libsemigroups/libsemigroups")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0acpx6n6chqm365k71ba6lwqqzapbh6h4wzra63p6mbgb8dw9l1f"))))
+    (build-system gnu-build-system)
+    (arguments
+     (list
+      ;; XXX: libsemigroup's build system doesn't have an option to use
+      ;; external HPCombi.  Try to work it around in the future and skip
+      ;; support for now.
+      #:configure-flags #~(list "--enable-fmt=yes"
+                                "--enable-hpcombi=no"
+                                "--with-external-eigen=yes"
+                                "--with-external-fmt=yes")
+      #:phases #~(modify-phases %standard-phases
+                   (add-after 'unpack 'fix-version
+                     (lambda* (#:key inputs #:allow-other-keys)
+                       (substitute* "etc/version-number.sh"
+                         (("/bin/sh")
+                          (search-input-file inputs "/bin/bash"))))))))
+    (native-inputs
+     (list autoconf automake libtool pkg-config))
+    (inputs (list eigen fmt))
+    (home-page "https://github.com/libsemigroups/libsemigroups")
+    (synopsis "Library for semigroups and monoids")
+    (description
+     "@code{libsemigroups} is a C++14 library containing implementations of
+several algorithms for computing finite, and finitely presented,
+semigroups and monoids.")
+    (license license:gpl2+)))
+
 (define-public sollya
   (package
    (name "sollya")
-- 
2.48.1