diff mbox series

[bug#48735] gnu: Add clojure-tools.

Message ID 87o8ct6kfe.fsf@reilysiegel.com
State Accepted
Headers show
Series [bug#48735] gnu: Add clojure-tools. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

Reily Siegel May 30, 2021, 2:10 a.m. UTC

Comments

M May 31, 2021, 9:15 a.m. UTC | #1
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/>.

Greetings,
Maxime.
Ludovic Courtès Sept. 3, 2021, 4:11 p.m. UTC | #2
Hi,

Maxime Devos <maximedevos@telenet.be> skribis:

> 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?

Context: <https://issues.guix.gnu.org/48735>.

Thanks in advance,
Ludo’.
Ludovic Courtès Sept. 6, 2021, 7:56 a.m. UTC | #3
Hi Reily,

Reily Siegel <mail@reilysiegel.com> skribis:

> 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’.
Ricardo Wurmus Jan. 12, 2022, 8:45 a.m. UTC | #4
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!
Reily Siegel Jan. 12, 2022, 9:23 a.m. UTC | #5
Hello,

> 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
Ricardo Wurmus Jan. 12, 2022, 4:44 p.m. UTC | #6
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!
diff mbox series

Patch

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(+)

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