[PATCH] gnu: Add clojure-tools.

  • Done
  • quality assurance status badge
Details
4 participants
  • Ludovic Courtès
  • Reily Siegel
  • Maxime Devos
  • Ricardo Wurmus
Owner
unassigned
Submitted by
Reily Siegel
Severity
normal
R
R
Reily Siegel wrote on 30 May 2021 04:10
(address . guix-patches@gnu.org)
87o8ct6kfe.fsf@reilysiegel.com
From a377461613f7aff8436b4969d3cce1c2cd079191 Mon Sep 17 00:00:00 2001
From: Reily Siegel <mail@reilysiegel.com>
Date: Sat, 29 May 2021 21:35:45 -0400
Subject: [PATCH] gnu: Add clojure-tools.

* gnu/packages/clojure.scm (clojure-tools): New variable.
---
gnu/packages/clojure.scm | 41 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)

Toggle diff (73 lines)
diff --git a/gnu/packages/clojure.scm b/gnu/packages/clojure.scm
index 5b238ab996..d203a67b01 100644
--- a/gnu/packages/clojure.scm
+++ b/gnu/packages/clojure.scm
@@ -4,6 +4,7 @@
;;; Copyright © 2019 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2019 Jesse Gibbons <jgibbons2357+guix@gmail.com>
;;; Copyright © 2020 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2021 Reily Siegel <mail@reilysiegel.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -23,11 +24,13 @@
(define-module (gnu packages clojure)
#:use-module (gnu packages)
#:use-module (gnu packages java)
+ #: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))
@@ -163,6 +166,44 @@ designs.")
license:asl2.0
license:cpl1.0)))))
+(define-public clojure-tools
+ (package
+ (name "clojure-tools")
+ (version "1.10.3.855")
+ (inputs `(("rlwrap" ,rlwrap)))
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "https://download.clojure.org/install/clojure-tools-"
+ version
+ ".tar.gz"))
+ (sha256 (base32 "114kn44azhsgzbjhiisdm502j6ss4kfg1mck9rjldrka2hwfwqyb"))))
+ (build-system copy-build-system)
+ (arguments
+ `(#:install-plan
+ '(("deps.edn" "lib/clojure/")
+ ("example-deps.edn" "lib/clojure/")
+ ("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)))))
+ (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")))
+
(define-public clojure-algo-generic
(package
(name "clojure-algo-generic")
--
2.31.1
M
M
Maxime Devos wrote on 31 May 2021 11:15
3e6f745410e895466a1d15bb64b4cbe31848752c.camel@telenet.be
Reily Siegel schreef op za 29-05-2021 om 22:10 [-0400]:
Toggle quote (11 lines)
> [...]
> + (build-system copy-build-system)
> + (arguments
> + `(#:install-plan
> + '(("deps.edn" "lib/clojure/")
> + ("example-deps.edn" "lib/clojure/")
> + ("exec.jar" "lib/clojure/libexec/")
> + (,(string-append "clojure-tools-" version ".jar") "lib/clojure/libexec/")
> + ("clojure" "bin/")
> + ("clj" "bin/"))

Packages in Guix must be compiled from the source code.
"exec.jar" and "clojure-tools-VERSION.jar" look like
compiled Java code to me. Oddly, I can't find the source

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYLSpHhccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7hdcAP4yjouam0oGpBoM579x+PUIBWmP
pjQepnmrIr8KuS806AD9EW1vOIQ0ncUbRiJTgeFuwyz2s/pW2LV0EW97sfLDmAU=
=Am6U
-----END PGP SIGNATURE-----


L
L
Ludovic Courtès wrote on 3 Sep 2021 18:11
Re: bug#48735: [PATCH] gnu: Add clojure-tools.
(name . Maxime Devos)(address . maximedevos@telenet.be)
87a6kt1vwg.fsf_-_@gnu.org
Hi,

Maxime Devos <maximedevos@telenet.be> skribis:

Toggle quote (17 lines)
> Reily Siegel schreef op za 29-05-2021 om 22:10 [-0400]:
>> [...]
>> + (build-system copy-build-system)
>> + (arguments
>> + `(#:install-plan
>> + '(("deps.edn" "lib/clojure/")
>> + ("example-deps.edn" "lib/clojure/")
>> + ("exec.jar" "lib/clojure/libexec/")
>> + (,(string-append "clojure-tools-" version ".jar") "lib/clojure/libexec/")
>> + ("clojure" "bin/")
>> + ("clj" "bin/"))
>
> Packages in Guix must be compiled from the source code.
> "exec.jar" and "clojure-tools-VERSION.jar" look like
> compiled Java code to me. Oddly, I can't find the source
> code at <https://github.com/clojure/>.

Reily, could you clarify whether this package can be built from source,
and if so, whether you could post an updated patch set?


Thanks in advance,
Ludo’.
L
L
Ludovic Courtès wrote on 6 Sep 2021 09:56
(name . Reily Siegel)(address . mail@reilysiegel.com)(address . 48735-done@debbugs.gnu.org)
87sfyi9lx9.fsf@gnu.org
Hi Reily,

Reily Siegel <mail@reilysiegel.com> skribis:

Toggle quote (13 lines)
> Ludovic Courtès <ludo@gnu.org> writes:
>
>> Reily, could you clarify whether this package can be built from source,
>> and if so, whether you could post an updated patch set?
>
> I have taken a look into building this from source, however, although
> possible, it relies indirectly on several Google Java libraries with
> very particular build system. While it is possible to build from source,
> it would be very cumbersome. I haven't looked at trying to do this since
> the Maven Build System was introduced, however I likely wont have the
> time required to package all the dependencies, even if it is now
> simpler.

Thanks for explaining. I’m closing this issue for now, but I hope what
we’ll eventually close is the gap that prevents us from building
clojure-tools from source!

Ludo’.
Closed
R
R
Reily Siegel wrote on 24 Dec 2021 00:00
(no subject)
(address . control@debbugs.gnu.org)
87wnjvapvx.fsf@reilysiegel.com
unarchive 48735
reopen 48735
R
R
Reily Siegel wrote on 24 Dec 2021 00:04
[PATCH v2 01/10] gnu: Add maven-resolver-transport-file.
(address . 48735@debbugs.gnu.org)
b5a7a2ca8640505ebc4fb38c83f8d2187591fdc3.1640300654.git.mail@reilysiegel.com
* gnu/packages/maven.scm (maven-resolver-transport-file): New variable.
---
gnu/packages/maven.scm | 42 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+)

Toggle diff (55 lines)
diff --git a/gnu/packages/maven.scm b/gnu/packages/maven.scm
index 479746639a..0f00053207 100644
--- a/gnu/packages/maven.scm
+++ b/gnu/packages/maven.scm
@@ -312,6 +312,48 @@ (define-public maven-resolver-transport-wagon
(description "This package contains a transport implementation based on
Maven Wagon, for use in Maven.")))
+(define-public maven-resolver-transport-file
+ (package
+ (inherit maven-resolver-api)
+ (name "maven-resolver-transport-file")
+ (arguments
+ `(#:jar-name "maven-resolver-transport-file.jar"
+ #:source-dir "maven-resolver-transport-file/src/main/java"
+ #:test-dir "maven-resolver-transport-file/src/test"
+ #:jdk ,icedtea-8
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'build 'generate-sisu
+ (lambda _
+ (mkdir-p "build/classes/META-INF/sisu")
+ (with-output-to-file "build/classes/META-INF/sisu/javax.inject.Named"
+ (lambda _
+ (display "org.eclipse.aether.transport.file.FileTransporterFactory\n")))
+ #t)))))
+ (inputs
+ (list maven-resolver-api
+ maven-resolver-spi
+ maven-resolver-util
+ java-javax-inject
+ maven-wagon-provider-api
+ java-plexus-component-annotations
+ java-plexus-classworlds
+ java-plexus-utils
+ java-slf4j-api
+ java-eclipse-sisu-inject
+ java-eclipse-sisu-plexus))
+ (native-inputs
+ (list java-junit
+ java-hamcrest-core
+ maven-resolver-test-util
+ java-guava
+ java-cglib
+ java-asm
+ java-aopalliance
+ java-guice))
+ (synopsis "Transport implementation for Maven")
+ (description "This package contains a transport implementation based on
+files, for use in Maven.")))
;; aether is the parent project that was forked into maven-resolver. It used
;; to be used with older versions of Maven, and is still required for some
;; plugins and their dependencies. This version is required for the plugins,
--
2.34.0
R
R
Reily Siegel wrote on 24 Dec 2021 00:04
[PATCH v2 02/10] gnu: Add maven-resolver-transport-http.
(address . 48735@debbugs.gnu.org)
4bd8a27a2f18d6422634df4ec202a5b9696529d8.1640300654.git.mail@reilysiegel.com
* gnu/packages/maven.scm (maven-resolver-transport-http): New variable.
---
gnu/packages/maven.scm | 53 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 53 insertions(+)

Toggle diff (66 lines)
diff --git a/gnu/packages/maven.scm b/gnu/packages/maven.scm
index 0f00053207..ad592df8fa 100644
--- a/gnu/packages/maven.scm
+++ b/gnu/packages/maven.scm
@@ -354,6 +354,59 @@ (define-public maven-resolver-transport-file
(synopsis "Transport implementation for Maven")
(description "This package contains a transport implementation based on
files, for use in Maven.")))
+
+(define-public maven-resolver-transport-http
+ (package
+ (inherit maven-resolver-api)
+ (name "maven-resolver-transport-http")
+ (arguments
+ `(#:jar-name "maven-resolver-transport-http.jar"
+ #:source-dir "maven-resolver-transport-http/src/main/java"
+ #:test-dir "maven-resolver-transport-http/src/test"
+ #:jdk ,icedtea-8
+ #:tests? #f
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'build 'generate-sisu
+ (lambda _
+ (mkdir-p "build/classes/META-INF/sisu")
+ (with-output-to-file "build/classes/META-INF/sisu/javax.inject.Named"
+ (lambda _
+ (display "org.eclipse.aether.transport.http.HttpTransporterFactory\n")))
+ #t)))))
+ (inputs
+ (list maven-resolver-api
+ maven-resolver-spi
+ maven-resolver-util
+ java-javax-inject
+ maven-wagon-provider-api
+ java-plexus-component-annotations
+ java-plexus-classworlds
+ java-plexus-utils
+ java-slf4j-api
+ java-eclipse-sisu-inject
+ java-eclipse-sisu-plexus))
+ (propagated-inputs
+ (list java-httpcomponents-httpclient
+ java-httpcomponents-httpcore))
+ (native-inputs
+ (list java-junit
+ java-hamcrest-core
+ maven-resolver-test-util
+ java-guava
+ java-cglib
+ java-asm
+ java-aopalliance
+ java-guice
+ java-eclipse-jetty-server
+ java-eclipse-jetty-servlet
+ java-eclipse-jetty-util
+ java-eclipse-jetty-http
+ java-javaee-servletapi))
+ (synopsis "Transport implementation for Maven")
+ (description "This package contains a transport implementation based on
+HTTP, for use in Maven.")))
+
;; aether is the parent project that was forked into maven-resolver. It used
;; to be used with older versions of Maven, and is still required for some
;; plugins and their dependencies. This version is required for the plugins,
--
2.34.0
R
R
Reily Siegel wrote on 24 Dec 2021 00:04
[PATCH v2 03/10] build: clojure-utils: Don't try to compile Clojure
(address . 48735@debbugs.gnu.org)
28950252d5f801644706d747b97e46ed4796181f.1640300654.git.mail@reilysiegel.com
* guix/build/clojure-utils.scm (%aot-include): Add "data-readers" to the
default list of files to exclude from ahead-of-time compilation.
---
guix/build/clojure-utils.scm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Toggle diff (15 lines)
diff --git a/guix/build/clojure-utils.scm b/guix/build/clojure-utils.scm
index a9ffad3c8f..8817cab52a 100644
--- a/guix/build/clojure-utils.scm
+++ b/guix/build/clojure-utils.scm
@@ -135,7 +135,7 @@ (define-with-docs %aot-include
(define-with-docs %aot-exclude
"A default list of symbols deciding what not to compile.
See the doc string of '%aot-include' for more details."
- '())
+ '(data-readers))
(define-with-docs %tests?
"Enable tests by default."
--
2.34.0
R
R
Reily Siegel wrote on 24 Dec 2021 00:04
[PATCH v2 04/10] gnu: Add clojure-test-check.
(address . 48735@debbugs.gnu.org)
9e561666cdecbd9cef4d9db0e5136ae8b918771b.1640300654.git.mail@reilysiegel.com
* gnu/packages/clojure.scm (clojure-test-check): New variable.
---
gnu/packages/clojure.scm | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)

Toggle diff (40 lines)
diff --git a/gnu/packages/clojure.scm b/gnu/packages/clojure.scm
index f48101079e..463d0fb46c 100644
--- a/gnu/packages/clojure.scm
+++ b/gnu/packages/clojure.scm
@@ -295,6 +295,33 @@ (define-public clojure-instaparse
(home-page "https://github.com/Engelberg/instaparse")
(license license:epl1.0))))
+(define-public clojure-test-check
+ (package
+ (name "clojure-test-check")
+ (version "1.1.1")
+ (home-page "https://github.com/clojure/test.check")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url home-page)
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "09jvlibnxhjv0l57y0sa7yy5in67gq4sssag77hv2d980mwdnls6"))))
+ (build-system clojure-build-system)
+ (arguments
+ '(#:source-dirs '("src/main/clojure")
+ #:test-dirs '("src/test/clojure")
+ #:doc-dirs '()))
+ (synopsis "QuickCheck for Clojure")
+ (description "@code{test.check} is a Clojure property-based testing tool
+inspired by QuickCheck. The core idea of @code{test.check} is that instead of
+enumerating expected input and output for unit tests, you write properties
+about your function that should hold true for all inputs. This lets you write
+concise, powerful tests.")
+ (license license:epl1.0)))
+
(define-public clojure-tools-macro
(package
(name "clojure-tools-macro")
--
2.34.0
R
R
Reily Siegel wrote on 24 Dec 2021 00:04
[PATCH v2 05/10] gnu: Add clojure-tools-gitlibs.
(address . 48735@debbugs.gnu.org)
a5bb9a458f89374d78c5198aa7a0dc8c70e58376.1640300654.git.mail@reilysiegel.com
* gnu/packages/clojure.scm (clojure-tools-gitlibs): New variable.
---
gnu/packages/clojure.scm | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)

Toggle diff (49 lines)
diff --git a/gnu/packages/clojure.scm b/gnu/packages/clojure.scm
index 463d0fb46c..70239cb7e7 100644
--- a/gnu/packages/clojure.scm
+++ b/gnu/packages/clojure.scm
@@ -23,6 +23,7 @@
(define-module (gnu packages clojure)
#:use-module (gnu packages)
#:use-module (gnu packages java)
+ #:use-module (gnu packages version-control)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages)
#:use-module (guix download)
@@ -368,3 +369,34 @@ (define-public clojure-tools-cli
"The @code{tools.cli} library provides Clojure programmers with tools to
work with command-line arguments.")
(license license:epl1.0)))
+
+(define-public clojure-tools-gitlibs
+ (package
+ (name "clojure-tools-gitlibs")
+ (version "2.4.172")
+ (home-page "https://github.com/clojure/tools.gitlibs")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url home-page)
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "19d83wigmigy66f5i61a3ishg7zrlv8jngj8m9brsh9v38a0fwdr"))))
+ (build-system clojure-build-system)
+ (arguments
+ '(#:source-dirs '("src/main/clojure")
+ #:test-dirs '("src/test/clojure")
+ #:doc-dirs '()
+ ;; FIXME: Tests modify filesystem (cloning git repos), and the build
+ ;; system does not like this.
+ #:tests? #f))
+ (native-inputs (list git))
+ (synopsis "API for retrieving, caching, and programatically accessing git
+libraries")
+ (description "To access git dependencies (for example, via tools.deps),
+one must download git directories and working trees as indicated by git
+shas. This library provides this functionality and also keeps a cache of git
+dirs and working trees that can be reused.")
+ (license license:epl1.0)))
--
2.34.0
R
R
Reily Siegel wrote on 24 Dec 2021 00:04
[PATCH v2 06/10] gnu: Add clojure-data-codec.
(address . 48735@debbugs.gnu.org)
ef5640e114ecc917a029a20b7e0f486ff0d9762e.1640300654.git.mail@reilysiegel.com
* gnu/packages/clojure.scm (clojure-data-codec): New variable.
---
gnu/packages/clojure.scm | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)

Toggle diff (42 lines)
diff --git a/gnu/packages/clojure.scm b/gnu/packages/clojure.scm
index 70239cb7e7..9dca984c10 100644
--- a/gnu/packages/clojure.scm
+++ b/gnu/packages/clojure.scm
@@ -244,6 +244,35 @@ (define-public clojure-core-match
(home-page "https://github.com/clojure/core.match")
(license license:epl1.0))))
+(define-public clojure-data-codec
+ (package
+ (name "clojure-data-codec")
+ (version "0.1.1")
+ (home-page "https://github.com/clojure/data.codec")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url home-page)
+ (commit (string-append "data.codec-" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "192df1dmbwvf1x837mi731n9x94bdypaz18va45plzgdsh4xx6dr"))))
+ (build-system clojure-build-system)
+ (arguments
+ '(#:source-dirs '("src/main/clojure")
+ #:test-dirs '("src/test/clojure")
+ #:doc-dirs '()))
+ (native-inputs (list java-commons-codec
+ clojure-test-check))
+ (synopsis "Native codec implementations for Clojure")
+ (description "Native codec implementations for Clojure. Currently only
+base64 has been implemented. Implements the standard base64 encoding
+character set, but does not yet support automatic fixed line-length encoding.
+All operations work on either byte arrays or Input/OutputStreams. Performance
+is on par with Java implementations, e.g., Apache commons-codec.")
+ (license license:epl1.0)))
+
(define-public clojure-instaparse
(let ((commit "dcfffad5b065e750f0f5835f017cdd8188b8ca2e")
(version "1.4.9")) ; upstream forget to tag this release
--
2.34.0
R
R
Reily Siegel wrote on 24 Dec 2021 00:04
[PATCH v2 07/10] gnu: Add clojure-data-xml.
(address . 48735@debbugs.gnu.org)
8013f2e778c737447d6f362ca4233b19f5831a21.1640300654.git.mail@reilysiegel.com
* gnu/packages/clojure.scm (clojure-data-xml): New variable.
---
gnu/packages/clojure.scm | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)

Toggle diff (44 lines)
diff --git a/gnu/packages/clojure.scm b/gnu/packages/clojure.scm
index 9dca984c10..45865bd4e1 100644
--- a/gnu/packages/clojure.scm
+++ b/gnu/packages/clojure.scm
@@ -273,6 +273,37 @@ (define-public clojure-data-codec
is on par with Java implementations, e.g., Apache commons-codec.")
(license license:epl1.0)))
+(define-public clojure-data-xml
+ (package
+ (name "clojure-data-xml")
+ (version "0.2.0-alpha6")
+ (home-page "https://github.com/clojure/data.xml")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url home-page)
+ (commit (string-append "data.xml-" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "08vglcapq7sd9zhw8dw1y7dcdks7f21w1pw9p05i475i3bw4cf94"))))
+ (build-system clojure-build-system)
+ (arguments
+ '(#:source-dirs '("src/main/clojure")
+ #:test-dirs '("src/test/clojure")
+ #:doc-dirs '()))
+ (propagated-inputs (list clojure-data-codec))
+ (synopsis "Clojure library for reading and writing XML data")
+ (description "@code{data.xml} is a Clojure library for reading and writing
+XML data. @code{data.xml} has the following features:
+
+Parses XML documents into Clojure data structures
+Emits XML from Clojure data structures
+No additional dependencies if using JDK >= 1.6
+Uses StAX internally
+lazy - should allow parsing and emitting of large XML documents")
+ (license license:epl1.0)))
+
(define-public clojure-instaparse
(let ((commit "dcfffad5b065e750f0f5835f017cdd8188b8ca2e")
(version "1.4.9")) ; upstream forget to tag this release
--
2.34.0
R
R
Reily Siegel wrote on 24 Dec 2021 00:04
[PATCH v2 08/10] gnu: Add clojure-tools-deps-alpha.
(address . 48735@debbugs.gnu.org)
f55cdda2a5e0f34781d95fbf3d779ccc6d730d9b.1640300654.git.mail@reilysiegel.com
* gnu/packages/clojure.scm (clojure-tools-deps-alpha): New variable.
---
gnu/packages/clojure.scm | 62 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 62 insertions(+)

Toggle diff (82 lines)
diff --git a/gnu/packages/clojure.scm b/gnu/packages/clojure.scm
index 45865bd4e1..11efa89741 100644
--- a/gnu/packages/clojure.scm
+++ b/gnu/packages/clojure.scm
@@ -23,6 +23,7 @@
(define-module (gnu packages clojure)
#:use-module (gnu packages)
#:use-module (gnu packages java)
+ #:use-module (gnu packages maven)
#:use-module (gnu packages version-control)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages)
@@ -430,6 +431,67 @@ (define-public clojure-tools-cli
work with command-line arguments.")
(license license:epl1.0)))
+(define-public clojure-tools-deps-alpha
+ (package
+ (name "clojure-tools-deps-alpha")
+ (version "0.12.1104")
+ (home-page "https://github.com/clojure/tools.deps.alpha")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url home-page)
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "174m83n5m3arai2vbg434zjibbsr3r4pp7lz3adja8lxq7g21r80"))))
+ (build-system clojure-build-system)
+ (arguments
+ `(#:source-dirs '("src/main/clojure" "src/main/resources")
+ #:test-dirs '("src/test/clojure")
+ #:doc-dirs '()
+ #:tests? #f
+ #:phases
+ (modify-phases %standard-phases
+ ;; FIXME: Currently, the S3 transporter depends on ClojureScript,
+ ;; which is very difficult to package due to dependencies on Java
+ ;; libraries with non-standard build systems. Instead of actually
+ ;; packaging these libraries, we just remove the S3 transporter that
+ ;; depends on them.
+ (add-after 'unpack 'remove-s3-transporter
+ (lambda _
+ (for-each delete-file
+ (list
+ (string-append
+ "src/main/clojure/clojure/"
+ "tools/deps/alpha/util/s3_aws_client.clj")
+ (string-append
+ "src/main/clojure/clojure/"
+ "tools/deps/alpha/util/s3_transporter.clj")
+ (string-append
+ "src/test/clojure/clojure/"
+ "tools/deps/alpha/util/test_s3_transporter.clj")))
+ (substitute*
+ "src/main/clojure/clojure/tools/deps/alpha/util/maven.clj"
+ (("clojure.tools.deps.alpha.util.s3-transporter")
+ "")))))))
+ (propagated-inputs (list maven-resolver-api
+ maven-resolver-spi
+ maven-resolver-impl
+ maven-resolver-util
+ maven-resolver-connector-basic
+ maven-resolver-provider
+ maven-core
+ maven-resolver-transport-http
+ maven-resolver-transport-file
+ clojure-tools-gitlibs
+ clojure-tools-cli
+ clojure-data-xml))
+ (synopsis "Clojure library supporting clojure-tools")
+ (description "A functional API for transitive dependency graph expansion and
+the creation of classpaths.")
+ (license license:epl1.0)))
+
(define-public clojure-tools-gitlibs
(package
(name "clojure-tools-gitlibs")
--
2.34.0
R
R
Reily Siegel wrote on 24 Dec 2021 00:04
[PATCH v2 09/10] gnu: Add clojure-tools.
(address . 48735@debbugs.gnu.org)
c7446d78cbf9dee04d4efba04dbcaa559a7f7013.1640300654.git.mail@reilysiegel.com
* gnu/packages/clojure.scm (clojure-tools): New variable.
---
gnu/packages/clojure.scm | 63 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 63 insertions(+)

Toggle diff (89 lines)
diff --git a/gnu/packages/clojure.scm b/gnu/packages/clojure.scm
index 11efa89741..b091f31eca 100644
--- a/gnu/packages/clojure.scm
+++ b/gnu/packages/clojure.scm
@@ -24,12 +24,14 @@ (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 (gnu packages version-control)
#: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))
@@ -165,6 +167,67 @@ (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"))
+ (modules '((guix build utils)))
+ ;; Remove AOT compiled JAR. The other JAR only contains
+ ;; uncompiled Clojure source code, so should be fine.
+ (snippet
+ `(begin
+ (delete-file ,(string-append "clojure-tools-" version ".jar"))
+ #t))))
+ (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")))
+ #true))
+ (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))
+ (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")))
+
(define-public clojure-algo-generic
(package
(name "clojure-algo-generic")
--
2.34.0
R
R
Reily Siegel wrote on 24 Dec 2021 00:04
[PATCH v2 10/10] gnu: clojure: Remove wrapper in favor of using
(address . 48735@debbugs.gnu.org)
bea8af9949b1191ba5fca3e3c64931f36ea74c8b.1640300654.git.mail@reilysiegel.com
* gnu/packages/clojure.scm (clojure): Remove generated wrapper around
clojure.jar, as it conflicts with the clojure-tools package.
---
gnu/packages/clojure.scm | 18 +-----------------
1 file changed, 1 insertion(+), 17 deletions(-)

Toggle diff (31 lines)
diff --git a/gnu/packages/clojure.scm b/gnu/packages/clojure.scm
index b091f31eca..71e5e22937 100644
--- a/gnu/packages/clojure.scm
+++ b/gnu/packages/clojure.scm
@@ -122,23 +122,7 @@ (define (extract-library name)
(add-after 'install-license-files 'install-doc
(cut install-doc #:doc-dirs '("doc/clojure/") <...>))
(add-after 'install-doc 'install-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)))))
+ (install-javadoc "target/javadoc/")))))
(native-inputs libraries)
(home-page "https://clojure.org/")
(synopsis "Lisp dialect running on the JVM")
--
2.34.0
R
R
Ricardo Wurmus wrote on 12 Jan 2022 09:45
[PATCH] gnu: Add clojure-tools.
(address . 48735@debbugs.gnu.org)
87ee5d5oc3.fsf@elephly.net
Hi Reily,

this new patch set looks good. Thank you very much!

I just have a few minor comments/questions:

- build phases and snippets no longer need to end on #t or #true

- nitpick: I’m not a fan of the somewhat unusual location of the
“home-page” field, but I understand that you’re reusing the URL. My
personal preference is not to do that and to move the “home-page”
field above the “synopsis” field.

- some packages have disabled tests; it would be good to add a comment
as to why the tests are disabled

- some descriptions are not complete sentences.

If you can tell me about these disabled tests (e.g. in
clojure-tools-deps-alpha), I can add comments and make the changes I
suggested above when applying the patches. (You don’t need to send new
patches.)

Thanks again!

--
Ricardo
R
R
Reily Siegel wrote on 12 Jan 2022 10:23
(name . Ricardo Wurmus)(address . rekado@elephly.net)(address . 48735@debbugs.gnu.org)
87r19db94h.fsf@reilysiegel.com
Hello,

Toggle quote (5 lines)
> If you can tell me about these disabled tests (e.g. in
> clojure-tools-deps-alpha), I can add comments and make the changes I
> suggested above when applying the patches. (You don’t need to send new
> patches.)

These tests are disabled for the same reason as the tests in
clojure-tools-gitlibs. The tests do a fair bit of filesystem
access/modification, and this causes problems with the build system.

Thanks again for taking a look at this patch,

Reily
R
R
Ricardo Wurmus wrote on 12 Jan 2022 17:44
(address . 48735-done@debbugs.gnu.org)
87sfts52dr.fsf@elephly.net
Hi again,

I made a couple of changes and pushed the updated series of patches with
the commits ending on 9fe48723c8266ffe8e6a639be2ec2e362cf20cb5.

Thank you for your patience!

--
Ricardo
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 48735@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 48735
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch