gnu: emacs-consult: Fix grammar.
[jackhill/guix/guix.git] / gnu / packages / clojure.scm
index 1dba4ce..5b238ab 100644 (file)
@@ -1,6 +1,9 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
 ;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz>
+;;; Copyright © 2019 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2019 Jesse Gibbons <jgibbons2357+guix@gmail.com>
+;;; Copyright © 2020 Ludovic Courtès <ludo@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -19,6 +22,7 @@
 
 (define-module (gnu packages clojure)
   #:use-module (gnu packages)
+  #:use-module (gnu packages java)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
 
     (package
       (name "clojure")
-      (version "1.9.0")
-      (source
-       (origin
-         (method url-fetch)
-         (uri
-          (string-append "https://github.com/clojure/clojure/archive/clojure-"
-                         version ".tar.gz"))
-         (sha256
-          (base32 "0xjbzcw45z32vsn9pifp7ndysjzqswp5ig0jkjpivigh2ckkdzha"))))
+      (version "1.10.0")
+      (source (let ((name+version (string-append name "-" version)))
+                (origin
+                  (method git-fetch)
+                  (uri (git-reference
+                        (url "https://github.com/clojure/clojure")
+                        (commit name+version)))
+                  (file-name (string-append name+version "-checkout"))
+                  (sha256
+                   (base32 "1kcyv2836acs27vi75hvf3r773ahv2nlh9b3j9xa9m9sdanz1h83")))))
       (build-system ant-build-system)
+      (inputs
+       `(("jre" ,icedtea)))
       (arguments
        `(#:imported-modules ((guix build clojure-utils)
                              (guix build guile-build-system)
            (add-after 'install-license-files 'install-doc
              (cut install-doc #:doc-dirs '("doc/clojure/") <...>))
            (add-after 'install-doc 'install-javadoc
-             (install-javadoc "target/javadoc/")))))
+             (install-javadoc "target/javadoc/"))
+           (add-after 'install 'make-wrapper
+             (lambda* (#:key inputs outputs #:allow-other-keys)
+               (let* ((out (assoc-ref outputs "out"))
+                      (wrapper (string-append out "/bin/clojure")))
+                 (mkdir-p (string-append out "/bin"))
+                 (with-output-to-file wrapper
+                   (lambda _
+                     (display
+                      (string-append
+                       "#!"
+                       (which "sh")
+                       "\n\n"
+                       (assoc-ref inputs "jre") "/bin/java -jar "
+                       out "/share/java/clojure.jar \"$@\"\n"))))
+                 (chmod wrapper #o555))
+               #t)))))
       (native-inputs libraries)
       (home-page "https://clojure.org/")
       (synopsis "Lisp dialect running on the JVM")
@@ -146,12 +169,13 @@ designs.")
     (version "0.1.3")
     (source
      (origin
-       (method url-fetch)
-       (uri
-        (string-append "https://github.com/clojure/algo.generic/archive"
-                       "/algo.generic-" version ".tar.gz"))
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/clojure/algo.generic")
+             (commit (string-append "algo.generic-" version))))
+       (file-name (git-file-name name version))
        (sha256
-        (base32 "12w9681i545gp1af4576z1qbixwps1j13c16fmcc7zsb0bd1zr7w"))))
+        (base32 "1s6q10qp276dcpzv06bq1q3bvkvlw03qhmncqcs9cc6p9lc0w4p4"))))
     (build-system clojure-build-system)
     (arguments
      '(#:source-dirs '("src/main/clojure/")
@@ -170,12 +194,13 @@ that can be implemented for any data type.")
     (version "0.1.6")
     (source
      (origin
-       (method url-fetch)
-       (uri
-        (string-append "https://github.com/clojure/algo.monads/archive"
-                       "/algo.monads-" version ".tar.gz"))
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/clojure/algo.monads")
+             (commit (string-append "algo.monads-" version))))
+       (file-name (git-file-name name version))
        (sha256
-        (base32 "14gbvfgmrda990h45yn7zag83vp1kdkz4f4yzmyvkr0sjihlgdmq"))))
+        (base32 "0mv3ba72hyhgasg2k3zy83ij61gak6cs4d6qgh8123z3j02mbh8p"))))
     (build-system clojure-build-system)
     (arguments
      '(#:source-dirs '("src/main/clojure/")
@@ -200,7 +225,7 @@ defining and using monads and useful monadic functions.")
       (source (origin
                 (method git-fetch)
                 (uri (git-reference
-                      (url "https://github.com/clojure/core.match.git")
+                      (url "https://github.com/clojure/core.match")
                       (commit commit)))
                 (file-name (git-file-name name version))
                 (sha256
@@ -227,7 +252,7 @@ It supports Clojure 1.5.1 and later as well as ClojureScript.")
       (source (origin
                 (method git-fetch)
                 (uri (git-reference
-                      (url "https://github.com/Engelberg/instaparse.git")
+                      (url "https://github.com/Engelberg/instaparse")
                       (commit commit)))
                 (file-name (git-file-name name version))
                 (sha256
@@ -276,12 +301,13 @@ tree.
     (version "0.1.5")
     (source
      (origin
-       (method url-fetch)
-       (uri
-        (string-append "https://github.com/clojure/tools.macro/archive"
-                       "/tools.macro-" version ".tar.gz"))
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/clojure/tools.macro")
+             (commit (string-append "tools.macro-" version))))
+       (file-name (git-file-name name version))
        (sha256
-        (base32 "0fs64a0g63xx6g7sj6vrsqknhl90s0isf6k053nw8vv5prfzc7v6"))))
+        (base32 "14mdxqkwja0cffmyfav5pbcli2qvw1mjdgz0n619a2z2036andx8"))))
     (build-system clojure-build-system)
     (arguments
      '(#:source-dirs '("src/main/clojure/")
@@ -291,3 +317,27 @@ tree.
     (description "Tools for writing macros.")
     (home-page "https://github.com/clojure/tools.macro")
     (license license:epl1.0)))
+
+(define-public clojure-tools-cli
+  (package
+    (name "clojure-tools-cli")
+    (version "0.4.2")
+    (home-page "https://github.com/clojure/tools.cli")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url home-page)
+                    (commit (string-append "tools.cli-" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32 "1yqlm8lwbcjm0dp032z7vzc4bdlmc4jixznvf4adsqhvqw85hvj2"))))
+    (build-system clojure-build-system)
+    (arguments
+     '(#:source-dirs '("src/main/clojure/")
+       #:test-dirs '("src/test/clojure/")
+       #:doc-dirs '()))
+    (synopsis "Clojure library for working with command-line arguments")
+    (description
+     "The @code{tools.cli} library provides Clojure programmers with tools to
+work with command-line arguments.")
+    (license license:epl1.0)))