GNU bug report logs - #31250
[PATCH] Add leiningen

Previous Next

Package: guix-patches;

Reported by: Charlie Ritter <chewzerita <at> posteo.net>

Date: Tue, 24 Apr 2018 15:46:02 UTC

Severity: normal

Tags: moreinfo, patch

Done: Steve George <steve <at> futurile.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 31250 in the body.
You can then email your comments to 31250 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#31250; Package guix-patches. (Tue, 24 Apr 2018 15:46:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Charlie Ritter <chewzerita <at> posteo.net>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Tue, 24 Apr 2018 15:46:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Charlie Ritter <chewzerita <at> posteo.net>
To: guix-patches <at> gnu.org
Subject: [PATCH] Add leiningen
Date: Tue, 24 Apr 2018 11:44:56 -0400
[0001-gnu-Add-leiningen.patch (text/x-patch, inline)]
From eac978c99ef288926530dcdee64cc9e3b7b8fe32 Mon Sep 17 00:00:00 2001
From: Charlie Ritter <chewzerita <at> posteo.net>
Date: Tue, 24 Apr 2018 11:42:39 -0400
Subject: [PATCH] gnu: Add leiningen.

* gnu/packages/java.scm (leiningen): New variable.
---
 gnu/packages/java.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index 500f27dcf..ffbd40890 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -9,6 +9,7 @@
 ;;; Copyright © 2017 Tobias Geerinckx-Rice <me <at> tobias.gr>
 ;;; Copyright © 2018 Gábor Boskovits <boskovits <at> gmail.com>
 ;;; Copyright © 2018 Chris Marusich <cmmarusich <at> gmail.com>
+;;; Copyright © 2018 Charlie Ritter <chewzerita <at> posteo.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1861,6 +1862,38 @@ designs.")
                      license:asl2.0
                      license:cpl1.0)))))
 
+(define-public leiningen
+  (package
+    (name "leiningen")
+    (version "2.8.1")
+    (source (origin
+              (method url-fetch/tarbomb)
+              (uri (string-append
+                    "https://github.com/technomancy/"
+                    name "/archive/" version ".tar.gz"))
+              (sha256
+               (base32
+                "0hjjszxqhc9sh31dpirak3c5ws90z41ypcc16y4s1q35ydlajv3w"))))
+    (build-system ant-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (delete 'build)
+         (delete 'check)
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (install-file (string-append
+                            ,name "-" ,version "/bin/lein")
+                           (string-append
+                            (assoc-ref outputs "out") "/bin")))))))
+    (home-page "https://leiningen.org")
+    (synopsis "Automating Clojure projects without setting your hair on fire")
+    (description "Leiningen is the easiest way to use Clojure.  With a focus
+on project automation and declarative configuration, it gets out of your way
+and lets you focus on your code.")
+    (license license:epl1.0)))
+
 (define-public javacc
   (package
     (name "javacc")
-- 
2.17.0

[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#31250; Package guix-patches. (Wed, 25 Apr 2018 20:55:01 GMT) Full text and rfc822 format available.

Message #8 received at 31250 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Charlie Ritter <chewzerita <at> posteo.net>
Cc: 31250 <at> debbugs.gnu.org
Subject: Re: [bug#31250] [PATCH] Add leiningen
Date: Wed, 25 Apr 2018 22:54:09 +0200
Hello,

Charlie Ritter <chewzerita <at> posteo.net> skribis:

> From eac978c99ef288926530dcdee64cc9e3b7b8fe32 Mon Sep 17 00:00:00 2001
> From: Charlie Ritter <chewzerita <at> posteo.net>
> Date: Tue, 24 Apr 2018 11:42:39 -0400
> Subject: [PATCH] gnu: Add leiningen.
>
> * gnu/packages/java.scm (leiningen): New variable.

Good to see the family of package managers *and* Lisps grow in Guix.
:-)

> +    (source (origin
> +              (method url-fetch/tarbomb)
> +              (uri (string-append
> +                    "https://github.com/technomancy/"
> +                    name "/archive/" version ".tar.gz"))
> +              (sha256
> +               (base32
> +                "0hjjszxqhc9sh31dpirak3c5ws90z41ypcc16y4s1q35ydlajv3w"))))
> +    (build-system ant-build-system)
> +    (arguments
> +     `(#:phases
> +       (modify-phases %standard-phases
> +         (delete 'configure)
> +         (delete 'build)
> +         (delete 'check)
> +         (replace 'install
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (install-file (string-append
> +                            ,name "-" ,version "/bin/lein")
> +                           (string-append
> +                            (assoc-ref outputs "out") "/bin")))))))

Unfortunately installing the ‘lein’ script alone won’t cut it.  The
issue is that, AIUI, the script downloads and installs pre-built Jars on
a first run (through its ‘self_install’ function).

The policy for Guix is to build things from source.  So we would have to
provide Leiningen and its dependencies as packages built from source,
and to remove the auto-download functionality from the script.

That’s obviously more work.  WDYT?

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#31250; Package guix-patches. (Thu, 26 Apr 2018 12:42:01 GMT) Full text and rfc822 format available.

Message #11 received at 31250 <at> debbugs.gnu.org (full text, mbox):

From: Nils Gillmann <ng0 <at> n0.is>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: Charlie Ritter <chewzerita <at> posteo.net>, 31250 <at> debbugs.gnu.org
Subject: Re: [bug#31250] [PATCH] Add leiningen
Date: Thu, 26 Apr 2018 12:41:32 +0000
Ludovic Courtès transcribed 1.7K bytes:
> Hello,
> 
> Charlie Ritter <chewzerita <at> posteo.net> skribis:
> 
> > From eac978c99ef288926530dcdee64cc9e3b7b8fe32 Mon Sep 17 00:00:00 2001
> > From: Charlie Ritter <chewzerita <at> posteo.net>
> > Date: Tue, 24 Apr 2018 11:42:39 -0400
> > Subject: [PATCH] gnu: Add leiningen.
> >
> > * gnu/packages/java.scm (leiningen): New variable.

Nice!

> Good to see the family of package managers *and* Lisps grow in Guix.
> :-)
> 
> > +    (source (origin
> > +              (method url-fetch/tarbomb)
> > +              (uri (string-append
> > +                    "https://github.com/technomancy/"
> > +                    name "/archive/" version ".tar.gz"))
> > +              (sha256
> > +               (base32
> > +                "0hjjszxqhc9sh31dpirak3c5ws90z41ypcc16y4s1q35ydlajv3w"))))
> > +    (build-system ant-build-system)
> > +    (arguments
> > +     `(#:phases
> > +       (modify-phases %standard-phases
> > +         (delete 'configure)
> > +         (delete 'build)
> > +         (delete 'check)
> > +         (replace 'install
> > +           (lambda* (#:key outputs #:allow-other-keys)
> > +             (install-file (string-append
> > +                            ,name "-" ,version "/bin/lein")
> > +                           (string-append
> > +                            (assoc-ref outputs "out") "/bin")))))))
> 
> Unfortunately installing the ‘lein’ script alone won’t cut it.  The
> issue is that, AIUI, the script downloads and installs pre-built Jars on
> a first run (through its ‘self_install’ function).

Yes, that's why my attempt at leiningen has been "sleeping" for a long time now...

> The policy for Guix is to build things from source.  So we would have to
> provide Leiningen and its dependencies as packages built from source,
> and to remove the auto-download functionality from the script.

But this is on first run, not during the installation as far as I remember.
So in my opinion that's not an immediate blocker for the initial package.
The obvious fix afterwards is to apply the building from source.

> That’s obviously more work.  WDYT?
> 
> Thanks,
> Ludo’.
> 
> 
> 




Information forwarded to guix-patches <at> gnu.org:
bug#31250; Package guix-patches. (Fri, 27 Apr 2018 05:17:02 GMT) Full text and rfc822 format available.

Message #14 received at 31250 <at> debbugs.gnu.org (full text, mbox):

From: Pjotr Prins <pjotr.public12 <at> thebird.nl>
To: Nils Gillmann <ng0 <at> n0.is>
Cc: Ludovic Courtès <ludo <at> gnu.org>,
 Charlie Ritter <chewzerita <at> posteo.net>, 31250 <at> debbugs.gnu.org
Subject: Re: [bug#31250] [PATCH] Add leiningen
Date: Fri, 27 Apr 2018 07:16:33 +0200
On Thu, Apr 26, 2018 at 12:41:32PM +0000, Nils Gillmann wrote:
> > The policy for Guix is to build things from source.  So we would have to
> > provide Leiningen and its dependencies as packages built from source,
> > and to remove the auto-download functionality from the script.
> 
> But this is on first run, not during the installation as far as I remember.
> So in my opinion that's not an immediate blocker for the initial package.
> The obvious fix afterwards is to apply the building from source.

We also packaged tools like conda that download binaries when run.

Adding Leiningen may accelerate using Clojure from Guix and support
will get better over time. Every time Rich Hickey talks about
deployment I am thinking he should be introduced to Guix.

Thanks for this!

Pj.




Information forwarded to guix-patches <at> gnu.org:
bug#31250; Package guix-patches. (Sat, 28 Apr 2018 20:45:03 GMT) Full text and rfc822 format available.

Message #17 received at 31250 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Pjotr Prins <pjotr.public12 <at> thebird.nl>
Cc: Charlie Ritter <chewzerita <at> posteo.net>, 31250 <at> debbugs.gnu.org,
 Nils Gillmann <ng0 <at> n0.is>
Subject: Re: [bug#31250] [PATCH] Add leiningen
Date: Sat, 28 Apr 2018 22:44:19 +0200
Pjotr Prins <pjotr.public12 <at> thebird.nl> skribis:

> On Thu, Apr 26, 2018 at 12:41:32PM +0000, Nils Gillmann wrote:
>> > The policy for Guix is to build things from source.  So we would have to
>> > provide Leiningen and its dependencies as packages built from source,
>> > and to remove the auto-download functionality from the script.
>> 
>> But this is on first run, not during the installation as far as I remember.
>> So in my opinion that's not an immediate blocker for the initial package.
>> The obvious fix afterwards is to apply the building from source.
>
> We also packaged tools like conda that download binaries when run.

True, that’s not great, and Leiningen may actually do the same thing as
part of its normal job…

I think it’s good to estimate how difficult it would be to build
Leiningen from source, and then we can decide what to do.

Ludo’.




Added tag(s) moreinfo. Request was from ludo <at> gnu.org (Ludovic Courtès) to control <at> debbugs.gnu.org. (Sat, 05 May 2018 20:28:02 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#31250; Package guix-patches. (Wed, 26 Jul 2023 14:57:03 GMT) Full text and rfc822 format available.

Message #22 received at 31250 <at> debbugs.gnu.org (full text, mbox):

From: Przemysław Kamiński <cgenie <at> pm.me>
To: 31250 <at> debbugs.gnu.org
Subject: [PATCH] Add leiningen
Date: Wed, 26 Jul 2023 13:21:39 +0000
[Message part 1 (text/plain, inline)]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hello,

I did take a look at what Nix does and apparently one should use
lein-pkg instead of lein and perform some regexp replaces.

Here's what I have, but it doesn't work since my Guix knowledge is too
small (I added comments where appropriate, also I think it's better to
use Codeberg than GitHub):

```
(use-modules (guix)
             (guix download)
             ((guix licenses) #:prefix license:)
             (guix packages)
             (guix build-system ant)
             (guix build-system copy)
             (gnu packages clojure)
             (gnu packages wget))


(define-public leiningen-jar-standalone
  ;; 1. fetch https://codeberg.org/attachments/43cebda5-a7c2-405b-b641-5143a00051b5 (leiningen-2.10.0-standalone.jar)
  (package
    (name "leiningen-jar-standalone")
    (version "2.10.0")
    (source (origin
             (method url-fetch)
             (uri (string-append "https://codeberg.org/attachments/43cebda5-a7c2-405b-b641-5143a00051b5"))
             (file-name (string-append "leiningen-" version "-standalone.jar"))
             (sha256
              (base32
               "0d5vmpyp9ddxpj1s5c60fv2f5iimz1chbgfhchlaqxa0sfx9jwnj"))))
    (build-system copy-build-system)
    (home-page "https://leiningen.org")
    (synopsis "Automating Clojure projects without setting your hair on fire")
    (description "Leiningen is the easiest way to use Clojure.  With a focus
on project automation and declarative configuration, it gets out of your way
and lets you focus on your code.")
    (license license:epl1.0)))


(define-public leiningen
  (package
    (name "leiningen")
    (version "2.10.0")
    (source (origin
             (method url-fetch/tarbomb)
             ;; https://codeberg.org/leiningen/leiningen/archive/2.10.0.zip
             (uri (string-append
                   "https://codeberg.org/leiningen/"
                   name "/archive/" version ".tar.gz"))
              (sha256
               (base32
                "0hxp8qlxcn7svskvvhalyk0ajaqd56nma03vq96w7d2ajghdn13b"))))
    (build-system ant-build-system)
    (arguments
     `(#:phases
       (modify-phases %standard-phases
         (delete 'configure)
         (delete 'build)
         (delete 'check)
    ;; TODO
    ;; 2. replace 'LEIN_JAR=/usr/share/java/leiningen-$LEIN_VERSION-standalone.jar' "LEIN_JAR=$out/share/$JARNAME"
    ;; 3 . wrapProgram $out/bin/lein
    ;;       --prefix PATH ":" "${lib.makeBinPath [ rlwrap coreutils ]}"
    ;;       --set LEIN_GPG ${gnupg}/bin/gpg
    ;;       --set JAVA_CMD ${jdk}/bin/java
         (replace 'install
                  (lambda* (#:key outputs #:allow-other-keys)
                           (install-file (string-append
                                          ,name "/bin/lein-pkg")
                                         (string-append
                                          (assoc-ref outputs "out") "/bin/lein")))))))
    (native-inputs (list leiningen-jar-standalone))
    ;; (build-inputs (list clojure clojure-tools))
    (home-page "https://leiningen.org")
    (synopsis "Automating Clojure projects without setting your hair on fire")
    (description "Leiningen is the easiest way to use Clojure.  With a focus
on project automation and declarative configuration, it gets out of your way
and lets you focus on your code.")
    (license license:epl1.0)))

leiningen
```
-----BEGIN PGP SIGNATURE-----

iIMEARYIACsWIQQeBFZmqKTSqjEi1nTzlEDXxNbhWAUCZMEd1A0cY2dlbmllQHBt
Lm1lAAoJEPOUQNfE1uFYOFwBAJ2bDsW2vrysvvcWLgwpOCpz0wKvNGYSdFA/9ZJv
aNsOAQCBI3BQxW7ZDU4moGSaw/27n1k6oKP90PVID8J+RojHDg==
=5cDc
-----END PGP SIGNATURE-----
[publickey - cgenie@pm.me - 9cc42b0a.asc (application/pgp-keys, attachment)]
[signature.asc (application/pgp-signature, attachment)]

bug closed, send any further explanations to 31250 <at> debbugs.gnu.org and Charlie Ritter <chewzerita <at> posteo.net> Request was from Steve George <steve <at> futurile.net> to control <at> debbugs.gnu.org. (Thu, 31 Oct 2024 10:38:02 GMT) Full text and rfc822 format available.

Message sent on to Charlie Ritter <chewzerita <at> posteo.net>:
bug#31250. (Thu, 31 Oct 2024 10:38:03 GMT) Full text and rfc822 format available.

Message #27 received at 31250-submitter <at> debbugs.gnu.org (full text, mbox):

From: Steve George <steve <at> futurile.net>
To: control <at> debbugs.gnu.org
Cc: 31250-submitter <at> debbugs.gnu.org
Subject: closing 31250
Date: Thu, 31 Oct 2024 10:35:12 +0000
close 31250 
We got there in the end, this package is now in Guix!
thanks





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 28 Nov 2024 12:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 105 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.