2022-12-19 17:17:39 +01:00
|
|
|
;;; SPDX-License-Identifier: GPL-3.0-or-later
|
2020-01-03 11:16:54 +01:00
|
|
|
;;; 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>
|
2023-12-29 00:34:06 +01:00
|
|
|
;;; Copyright © 2023 Jonathan Brielmaier <jonathan.brielmaier@web.de>
|
2020-01-03 11:16:54 +01:00
|
|
|
|
|
|
|
(define-module (nongnu packages clojure)
|
2021-11-16 23:47:42 +01:00
|
|
|
#:use-module (gnu packages compression)
|
|
|
|
#:use-module (gnu packages gcc)
|
2021-06-14 01:50:23 +02:00
|
|
|
#:use-module (gnu packages readline)
|
|
|
|
#: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)
|
2023-12-29 00:34:06 +01:00
|
|
|
#:use-module (guix gexp)
|
2020-01-14 15:31:00 +01:00
|
|
|
#:use-module (guix git-download)
|
2021-11-16 23:47:42 +01:00
|
|
|
#:use-module (guix packages)
|
|
|
|
#:use-module (nonguix build-system binary)
|
2020-01-03 11:16:54 +01:00
|
|
|
#:use-module ((guix licenses) #:prefix license:))
|
|
|
|
|
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")
|
2023-03-07 00:51:31 +01:00
|
|
|
(version "2.10.0")
|
2020-01-03 11:16:54 +01:00
|
|
|
(source (origin
|
2020-01-14 15:31:00 +01:00
|
|
|
(method url-fetch)
|
2023-03-07 00:51:31 +01:00
|
|
|
(uri "https://codeberg.org/attachments/43cebda5-a7c2-405b-b641-5143a00051b5")
|
2020-01-14 15:31:00 +01:00
|
|
|
(file-name "leiningen-standalone.jar")
|
2020-01-03 11:16:54 +01:00
|
|
|
(sha256
|
|
|
|
(base32
|
2023-03-07 00:51:31 +01:00
|
|
|
"0d5vmpyp9ddxpj1s5c60fv2f5iimz1chbgfhchlaqxa0sfx9jwnj"))))
|
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")
|
2023-03-07 00:51:31 +01:00
|
|
|
(version "2.10.0")
|
2020-01-14 15:31:00 +01:00
|
|
|
(source (origin
|
|
|
|
(method git-fetch)
|
|
|
|
(uri (git-reference
|
2022-08-30 15:35:05 +02:00
|
|
|
(url "https://codeberg.org/leiningen/leiningen.git")
|
2020-01-14 15:31:00 +01:00
|
|
|
(commit version)))
|
|
|
|
(file-name (git-file-name name version))
|
|
|
|
(sha256
|
|
|
|
(base32
|
2023-03-07 00:51:31 +01:00
|
|
|
"0xvniav6iy1yrbamvbg8i3dq8issiczv3rbig2yc3nm08d2q0rig"))))
|
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)))))
|
2021-11-16 23:47:42 +01:00
|
|
|
|
|
|
|
(define-public clj-kondo
|
|
|
|
(package
|
|
|
|
(name "clj-kondo")
|
2024-03-23 02:25:15 +01:00
|
|
|
(version "2024.03.13")
|
2021-11-16 23:47:42 +01:00
|
|
|
(source (origin
|
|
|
|
(method url-fetch/zipbomb)
|
|
|
|
(uri (string-append
|
|
|
|
"https://github.com/clj-kondo/clj-kondo/releases/download/v"
|
|
|
|
version "/clj-kondo-" version "-linux-amd64.zip"))
|
|
|
|
(sha256
|
|
|
|
(base32
|
2024-03-23 02:25:15 +01:00
|
|
|
"0qdimdf854wsy19i39j18f01b3dhj4zccslymbkn8j9rm90k91m3"))))
|
2021-11-16 23:47:42 +01:00
|
|
|
(build-system binary-build-system)
|
|
|
|
(arguments
|
2023-12-29 00:34:06 +01:00
|
|
|
(list #:patchelf-plan `'(("clj-kondo" ("gcc" "zlib")))
|
2024-03-23 02:25:15 +01:00
|
|
|
#:install-plan `'(("./clj-kondo" "/bin/"))
|
2023-12-29 00:34:06 +01:00
|
|
|
#:phases #~(modify-phases %standard-phases
|
|
|
|
(add-after 'unpack 'chmod
|
|
|
|
(lambda _
|
|
|
|
(chmod "clj-kondo" #o755))))))
|
2021-11-16 23:47:42 +01:00
|
|
|
(native-inputs
|
2023-12-29 00:34:06 +01:00
|
|
|
(list unzip))
|
2021-11-16 23:47:42 +01:00
|
|
|
(inputs
|
2023-12-29 00:34:06 +01:00
|
|
|
(list `(,gcc "lib")
|
|
|
|
zlib))
|
2021-11-16 23:47:42 +01:00
|
|
|
(supported-systems '("x86_64-linux"))
|
|
|
|
(home-page "https://github.com/clj-kondo/clj-kondo")
|
|
|
|
(synopsis "Linter for Clojure code")
|
|
|
|
(description "Clj-kondo performs static analysis on Clojure, ClojureScript
|
|
|
|
and EDN, without the need of a running REPL.")
|
|
|
|
(license license:epl1.0)))
|