From 8cf2817d4c2e0ab8c7ab219be444f6ffa2970549 Mon Sep 17 00:00:00 2001 From: Reily Siegel Date: Thu, 23 Dec 2021 18:04:46 -0500 Subject: gnu: Add clojure-tools. * gnu/packages/clojure.scm (clojure-tools): New variable. --- gnu/packages/clojure.scm | 58 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) (limited to 'gnu') diff --git a/gnu/packages/clojure.scm b/gnu/packages/clojure.scm index 0cd064adf6..cb8a7a2cbe 100644 --- a/gnu/packages/clojure.scm +++ b/gnu/packages/clojure.scm @@ -24,11 +24,13 @@ (define-module (gnu packages clojure) #:use-module (gnu packages) #:use-module (gnu packages java) #:use-module (gnu packages maven) + #:use-module (gnu packages readline) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix git-download) #:use-module (guix build-system ant) + #:use-module (guix build-system copy) #:use-module (guix build-system clojure) #:use-module (ice-9 match)) @@ -164,6 +166,62 @@ (define (extract-library name) license:asl2.0 license:cpl1.0))))) +(define-public clojure-tools + (package + (name "clojure-tools") + (version "1.10.3.1040") + (source + (origin + (method url-fetch) + (uri (string-append "https://download.clojure.org/install/clojure-tools-" + version + ".tar.gz")) + (sha256 (base32 "0xvr9nmk9q789vp32zmmzj4macv8v7y9ivnfd6lf7i8vxgg6hvgv")) + ;; Remove AOT compiled JAR. The other JAR only contains uncompiled + ;; Clojure source code. + (snippet + `(delete-file ,(string-append "clojure-tools-" version ".jar"))))) + (build-system copy-build-system) + (arguments + `(#:install-plan + '(("deps.edn" "lib/clojure/") + ("example-deps.edn" "lib/clojure/") + ("exec.jar" "lib/clojure/libexec/") + ("clojure" "bin/") + ("clj" "bin/")) + #:modules ((guix build copy-build-system) + (guix build utils) + (srfi srfi-1) + (ice-9 match)) + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'fix-paths + (lambda* (#:key outputs #:allow-other-keys) + (substitute* "clojure" + (("PREFIX") (string-append (assoc-ref outputs "out") "/lib/clojure"))) + (substitute* "clj" + (("BINDIR") (string-append (assoc-ref outputs "out") "/bin")) + (("rlwrap") (which "rlwrap"))))) + (add-after 'fix-paths 'copy-tools-deps-alpha-jar + (lambda* (#:key inputs outputs #:allow-other-keys) + (substitute* "clojure" + (("\\$install_dir/libexec/clojure-tools-\\$version\\.jar") + (string-join + (append-map (match-lambda + ((label . dir) + (find-files dir "\\.jar$"))) + inputs) + ":")))))))) + (inputs (list rlwrap + clojure + clojure-tools-deps-alpha + java-commons-logging-minimal)) + (home-page "https://clojure.org/releases/tools") + (synopsis "CLI tools for the Clojure programming language") + (description "The Clojure command line tools can be used to start a +Clojure repl, use Clojure and Java libraries, and start Clojure programs.") + (license license:epl1.0))) + (define-public clojure-algo-generic (package (name "clojure-algo-generic") -- cgit v1.2.3