diff mbox series

[bug#61678,v2,2/2] gnu: Add smlsharp.

Message ID d875feffbbc59948b4c0fd9cfc0aef5331e0fae9.1688054848.git.gemmaro.dev@gmail.com
State New
Headers show
Series [bug#61678,v2,1/2] gnu: Add massivethreads. | expand

Commit Message

gemmaro June 29, 2023, 4:07 p.m. UTC
* gnu/packages/sml.scm (smlsharp): New variable.
---
 gnu/packages/sml.scm | 52 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)
diff mbox series

Patch

diff --git a/gnu/packages/sml.scm b/gnu/packages/sml.scm
index 368abf6cfa9..12c2d89d486 100644
--- a/gnu/packages/sml.scm
+++ b/gnu/packages/sml.scm
@@ -4,6 +4,7 @@ 
 ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2019, 2020 Brett Gilio <brettg@gnu.org>
 ;;; Copyright © 2021, 2022 Foo Chuan Wei <chuanwei.foo@hotmail.com>
+;;; Copyright © 2023 gemmaro <gemmaro.dev@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -21,12 +22,17 @@ 
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages sml)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages bash)
   #:use-module (gnu packages lesstif)
   #:use-module (gnu packages libffi)
+  #:use-module (gnu packages llvm)
   #:use-module (gnu packages multiprecision)
+  #:use-module (gnu packages parallel)
   #:use-module (gnu packages xorg)
   #:use-module (guix build-system gnu)
   #:use-module (guix download)
+  #:use-module (guix gexp)
   #:use-module (guix git-download)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
@@ -340,3 +346,49 @@  (define-public smlnj
     (license (license:fsf-free
                "https://www.smlnj.org/license.html"
                "https://www.gnu.org/licenses/license-list#StandardMLofNJ"))))
+
+(define-public smlsharp
+  (package
+    (name "smlsharp")
+    (version "4.0.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "https://github.com/smlsharp/smlsharp/releases/download/v"
+                    version "/smlsharp-" version ".tar.gz"))
+              (sha256
+               (base32
+                "1nv567na798qysyw7bc8aaz0v51f239z0s3w37nzqz4z6qgzni0b"))))
+    (build-system gnu-build-system)
+    (arguments
+     (list #:parallel-build? #t
+           #:parallel-tests? #t
+           #:test-target "test"
+           #:phases #~(modify-phases %standard-phases
+                        ;; NOTE: Needed for running SML# executables
+                        (add-after 'install 'wrap-programs
+                          (lambda* (#:key inputs outputs #:allow-other-keys)
+                            (let ((out (assoc-ref outputs "out"))
+                                  (libs (map (lambda (name)
+                                               (string-append (assoc-ref
+                                                               inputs name)
+                                                              "/lib"))
+                                             '("gmp" "massivethreads" "glibc"))))
+                              (with-directory-excursion (string-append out
+                                                                       "/bin")
+                                (for-each (lambda (file)
+                                            (wrap-program (basename file)
+                                              `("LIBRARY_PATH" prefix
+                                                ,libs)) #t)
+                                          (find-files ".")))))))))
+    (inputs (list llvm-11 gmp massivethreads glibc bash-minimal))
+    (home-page "https://smlsharp.github.io/en/")
+    (synopsis
+     "Open source functional programming language compatible with with
+Standard ML")
+    (description
+     "SML# is an open source functional programming language and have been
+developed by the SML# Delelopment Team.  While maintaining compatibility with
+Standard ML, it provides practically important features such as
+interoperability with C and databases.")
+    (license license:expat)))