2020-01-03 11:16:54 +01:00
|
|
|
;;; GNU Guix --- Functional package management for GNU
|
|
|
|
;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
|
2020-01-14 15:31:00 +01:00
|
|
|
;;; Copyright © 2020 Jelle Licht <jlicht@fsfe.org>
|
2020-03-18 23:30:14 +01:00
|
|
|
;;; Copyright © 2020 Alex Griffin <a@ajgrf.com>
|
2020-01-03 11:16:54 +01:00
|
|
|
;;;
|
|
|
|
;;; This file is not part of GNU Guix.
|
|
|
|
;;;
|
|
|
|
;;; GNU Guix is free software; you can redistribute it and/or modify it
|
|
|
|
;;; under the terms of the GNU General Public License as published by
|
|
|
|
;;; the Free Software Foundation; either version 3 of the License, or (at
|
|
|
|
;;; your option) any later version.
|
|
|
|
;;;
|
|
|
|
;;; GNU Guix is distributed in the hope that it will be useful, but
|
|
|
|
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
;;; GNU General Public License for more details.
|
|
|
|
;;;
|
|
|
|
;;; You should have received a copy of the GNU General Public License
|
|
|
|
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
(define-module (nongnu packages clojure)
|
2021-06-14 01:50:23 +02:00
|
|
|
#:use-module (gnu packages readline)
|
2020-01-03 11:16:54 +01:00
|
|
|
#:use-module (guix packages)
|
2021-06-14 01:50:23 +02:00
|
|
|
#:use-module (guix build-system copy)
|
2020-01-14 15:31:00 +01:00
|
|
|
#:use-module (guix build-system gnu)
|
|
|
|
#:use-module (guix build-system trivial)
|
2020-01-03 11:16:54 +01:00
|
|
|
#:use-module (guix download)
|
2020-01-14 15:31:00 +01:00
|
|
|
#:use-module (guix git-download)
|
2020-01-03 11:16:54 +01:00
|
|
|
#:use-module ((guix licenses) #:prefix license:))
|
|
|
|
|
2021-06-14 01:50:23 +02:00
|
|
|
(define-public clojure-tools
|
|
|
|
(package
|
|
|
|
(name "clojure-tools")
|
2021-08-20 21:53:53 +02:00
|
|
|
(version "1.10.3.943")
|
2021-06-14 01:50:23 +02:00
|
|
|
(source
|
|
|
|
(origin
|
|
|
|
(method url-fetch)
|
|
|
|
(uri (string-append "https://download.clojure.org/install/clojure-tools-"
|
|
|
|
version
|
|
|
|
".tar.gz"))
|
2021-08-20 21:53:53 +02:00
|
|
|
(sha256 (base32 "1yrk6m9f6n8f0drpx305jb95d61py423aawkl2p6syr2kfyx2w63"))))
|
2021-06-14 01:50:23 +02:00
|
|
|
(build-system copy-build-system)
|
|
|
|
(arguments
|
|
|
|
`(#:install-plan
|
|
|
|
'(("deps.edn" "lib/clojure/")
|
|
|
|
("example-deps.edn" "lib/clojure/")
|
2021-08-01 22:43:29 +02:00
|
|
|
("tools.edn" "lib/clojure/")
|
2021-06-14 01:50:23 +02:00
|
|
|
("exec.jar" "lib/clojure/libexec/")
|
|
|
|
(,(string-append "clojure-tools-" version ".jar") "lib/clojure/libexec/")
|
|
|
|
("clojure" "bin/")
|
|
|
|
("clj" "bin/"))
|
|
|
|
#: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")))
|
|
|
|
#true)))))
|
|
|
|
(inputs `(("rlwrap" ,rlwrap)))
|
|
|
|
(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)
|
|
|
|
(home-page "https://clojure.org/releases/tools")))
|
|
|
|
|
|
|
|
|
2020-01-14 15:31:00 +01:00
|
|
|
;; This is a hidden package, as it does not really serve a purpose on its own.
|
|
|
|
(define leiningen-jar
|
2020-01-03 11:16:54 +01:00
|
|
|
(package
|
2020-01-14 15:31:00 +01:00
|
|
|
(name "leiningen-jar")
|
2021-05-12 18:02:49 +02:00
|
|
|
(version "2.9.6")
|
2020-01-03 11:16:54 +01:00
|
|
|
(source (origin
|
2020-01-14 15:31:00 +01:00
|
|
|
(method url-fetch)
|
|
|
|
(uri (string-append "https://github.com/technomancy/leiningen/releases/download/"
|
2020-03-18 23:30:14 +01:00
|
|
|
version "/leiningen-" version "-standalone.zip"))
|
2020-01-14 15:31:00 +01:00
|
|
|
(file-name "leiningen-standalone.jar")
|
2020-01-03 11:16:54 +01:00
|
|
|
(sha256
|
|
|
|
(base32
|
2021-05-12 18:02:49 +02:00
|
|
|
"1f3hb57rqp9qkh5n2wf65dvxraf21y15s3g643f2fhzc7vvl7ia1"))))
|
2020-01-14 15:31:00 +01:00
|
|
|
(build-system trivial-build-system)
|
2020-01-03 11:16:54 +01:00
|
|
|
(arguments
|
2020-01-14 15:31:00 +01:00
|
|
|
`(#:modules ((guix build utils))
|
|
|
|
#:builder (begin
|
|
|
|
(use-modules (guix build utils))
|
|
|
|
(let ((source (assoc-ref %build-inputs "source"))
|
|
|
|
(jar-dir (string-append %output "/share/")))
|
|
|
|
(mkdir-p jar-dir)
|
|
|
|
(copy-file source
|
|
|
|
(string-append jar-dir "leiningen-standalone.jar"))))))
|
2020-01-03 11:16:54 +01:00
|
|
|
(home-page "https://leiningen.org")
|
2020-01-14 15:31:00 +01:00
|
|
|
(synopsis "Automate Clojure projects without setting your hair on fire")
|
|
|
|
(description "Leiningen is a Clojure tool with a focus on project
|
|
|
|
automation and declarative configuration. It gets out of your way and
|
|
|
|
lets you focus on your code.")
|
2020-01-03 11:16:54 +01:00
|
|
|
(license license:epl1.0)))
|
2020-01-14 15:31:00 +01:00
|
|
|
|
|
|
|
(define-public leiningen
|
|
|
|
(package
|
|
|
|
(inherit leiningen-jar)
|
|
|
|
(name "leiningen")
|
2021-05-12 18:02:49 +02:00
|
|
|
(version "2.9.6")
|
2020-01-14 15:31:00 +01:00
|
|
|
(source (origin
|
|
|
|
(method git-fetch)
|
|
|
|
(uri (git-reference
|
|
|
|
(url "https://github.com/technomancy/leiningen.git")
|
|
|
|
(commit version)))
|
|
|
|
(file-name (git-file-name name version))
|
|
|
|
(sha256
|
|
|
|
(base32
|
2021-05-12 18:02:49 +02:00
|
|
|
"0z1zwx5aq5gvp6396gmq8dl0yh0i8sshsw3vsvfbl96246in5yz8"))))
|
2020-01-14 15:31:00 +01:00
|
|
|
(build-system gnu-build-system)
|
|
|
|
(arguments
|
|
|
|
`(#:tests? #f
|
|
|
|
#:phases (modify-phases %standard-phases
|
|
|
|
(delete 'configure)
|
|
|
|
(delete 'build)
|
|
|
|
(replace 'install
|
|
|
|
(lambda _
|
|
|
|
(let* ((lein-pkg (string-append (assoc-ref %build-inputs "source") "/bin/lein-pkg"))
|
|
|
|
(lein-jar (string-append (assoc-ref %build-inputs "leiningen-jar")
|
|
|
|
"/share/leiningen-standalone.jar"))
|
|
|
|
(bin-dir (string-append %output "/bin"))
|
|
|
|
(lein (string-append bin-dir "/lein")))
|
|
|
|
(mkdir-p bin-dir)
|
|
|
|
(copy-file lein-pkg lein)
|
|
|
|
(patch-shebang lein)
|
|
|
|
(chmod lein #o555)
|
|
|
|
(substitute* lein
|
|
|
|
(("LEIN_JAR=.*") (string-append "LEIN_JAR=" lein-jar)))
|
|
|
|
#t))))))
|
|
|
|
(inputs
|
|
|
|
`(("leiningen-jar" ,leiningen-jar)))))
|