unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Packaging leiningen (feedback desired)
@ 2017-02-07  3:30 alex.ter.weele
  2017-02-07  8:19 ` Danny Milosavljevic
  0 siblings, 1 reply; 6+ messages in thread
From: alex.ter.weele @ 2017-02-07  3:30 UTC (permalink / raw)
  To: guix-devel

If anyone's around, I would appreciate some feedback. I'm trying to
package leiningen, a build tool for clojure projects. The recommended
way to manually install leiningen is to use a script that will download
a .jar
(https://github.com/technomancy/leiningen/blob/stable/bin/lein#L65). This
is also the recommended way to bootstrap: use an older version of
leiningen to build the newer version
(https://github.com/technomancy/leiningen/blob/stable/CONTRIBUTING.md#bootstrapping).

Other distributions, even Nix, use this approach for their leiningen
package. Download the .jar and the "lein" script and put them in the
appropriate places
(https://github.com/technomancy/leiningen/wiki/Packaging).
  * https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/tools/build-managers/leiningen/default.nix
  * https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-java/leiningen-bin/leiningen-bin-2.7.1.ebuild

Anyway, I'm trying to do this right, so my plan is to make a
leiningen-bootstrap package (based on an old version of leiningen) that
will be built "manually", then using that to build a modern
leiningen. Is this the right idea?

I'm also running into some problems with either the clojure or the
icedtea packages, manifesting as "Could not find or load main class":

bash-4.4$ guix environment --ad-hoc clojure
bash-4.4$ java -cp $GUIX_ENVIRONMENT/share/java/ clojure.main
bash: java: command not found
bash-4.4$ exit
bash-4.4$ guix environment clojure
bash-4.4$ java -cp clojure-1.8.0.jar clojure.main
Error: Could not find or load main class clojure.main
bash-4.4$ file clojure-1.8.0.jar 
clojure-1.8.0.jar: Zip archive data, at least v1.0 to extract
bash-4.4$ clojure
bash: clojure: command not found

(I'm trying to emulate https://clojure.org/guides/getting_started here.)

It is unclear to me how the current clojure package is meant to be
used. Could someone clarify that? Ricardo, I believe you reviewed the
patch to add the package...any ideas?

Thanks,
Alex

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Packaging leiningen (feedback desired)
  2017-02-07  3:30 Packaging leiningen (feedback desired) alex.ter.weele
@ 2017-02-07  8:19 ` Danny Milosavljevic
  2017-02-07 23:00   ` Ben Woodcroft
  0 siblings, 1 reply; 6+ messages in thread
From: Danny Milosavljevic @ 2017-02-07  8:19 UTC (permalink / raw)
  To: alex.ter.weele; +Cc: guix-devel

Hmmm... works for me with:

$ java -cp "${HOME}/.guix-profile/share/java/clojure-1.8.0.jar" clojure.main

(Note: java -> /gnu/store/4lnjmsr4szhqyixy238xjl83k8h5f0ck-icedtea-3.2.0/bin/java)

Also works within guix environment --ad-hoc clojure.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Packaging leiningen (feedback desired)
  2017-02-07  8:19 ` Danny Milosavljevic
@ 2017-02-07 23:00   ` Ben Woodcroft
  2017-02-08  0:01     ` Catonano
  0 siblings, 1 reply; 6+ messages in thread
From: Ben Woodcroft @ 2017-02-07 23:00 UTC (permalink / raw)
  To: Danny Milosavljevic, alex.ter.weele; +Cc: guix-devel

Hi Danny, Alex,

On 07/02/17 18:19, Danny Milosavljevic wrote:
> Hmmm... works for me with:
>
> $ java -cp "${HOME}/.guix-profile/share/java/clojure-1.8.0.jar" clojure.main
>
> (Note: java -> /gnu/store/4lnjmsr4szhqyixy238xjl83k8h5f0ck-icedtea-3.2.0/bin/java)
>
> Also works within guix environment --ad-hoc clojure.
I was unable to use that command with that exact environment (clojure 
doesn't propagate any java), but it does work when icedtea is added i.e.

guix environment --container --ad-hoc clojure icedtea

I'm not expert enough to comment on whether the clojure package itself 
needs to be changed, but this is a workaround at least.
ben

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Packaging leiningen (feedback desired)
  2017-02-07 23:00   ` Ben Woodcroft
@ 2017-02-08  0:01     ` Catonano
  2017-02-08 15:53       ` Ricardo Wurmus
  0 siblings, 1 reply; 6+ messages in thread
From: Catonano @ 2017-02-08  0:01 UTC (permalink / raw)
  To: Ben Woodcroft; +Cc: guix-devel, alex.ter.weele

[-- Attachment #1: Type: text/plain, Size: 1202 bytes --]

2017-02-08 0:00 GMT+01:00 Ben Woodcroft <b.woodcroft@uq.edu.au>:

> Hi Danny, Alex,
>
>
> On 07/02/17 18:19, Danny Milosavljevic wrote:
>
>> Hmmm... works for me with:
>>
>> $ java -cp "${HOME}/.guix-profile/share/java/clojure-1.8.0.jar"
>> clojure.main
>>
>> (Note: java -> /gnu/store/4lnjmsr4szhqyixy238xjl83k8h5f0ck-icedtea-3.2.0/
>> bin/java)
>>
>> Also works within guix environment --ad-hoc clojure.
>>
> I was unable to use that command with that exact environment (clojure
> doesn't propagate any java), but it does work when icedtea is added i.e.
>
> guix environment --container --ad-hoc clojure icedtea
>
> I'm not expert enough to comment on whether the clojure package itself
> needs to be changed, but this is a workaround at least.
> ben
>
>
>
>
>
The Clojure compilation target is the Jvm. Any Clojure based software needs
a Jvm in order to run

And the Clojure REPL is a Clojure based program. Without a Jvm it won' t
run.

I don' t remember now if the compiler is written in Java or in Clojure.
Anyway, the compiler too needs a Jvm in order to run.

That is to say that as far as I understand both Clojure and Guix, a Java
runtime should be a propagated input of any Clojure package.

[-- Attachment #2: Type: text/html, Size: 1985 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Packaging leiningen (feedback desired)
  2017-02-08  0:01     ` Catonano
@ 2017-02-08 15:53       ` Ricardo Wurmus
  2017-02-08 16:37         ` Catonano
  0 siblings, 1 reply; 6+ messages in thread
From: Ricardo Wurmus @ 2017-02-08 15:53 UTC (permalink / raw)
  To: Catonano; +Cc: guix-devel, alex.ter.weele


Catonano <catonano@gmail.com> writes:

> The Clojure compilation target is the Jvm. Any Clojure based software needs
> a Jvm in order to run
>
> And the Clojure REPL is a Clojure based program. Without a Jvm it won' t
> run.
>
> I don' t remember now if the compiler is written in Java or in Clojure.
> Anyway, the compiler too needs a Jvm in order to run.
>
> That is to say that as far as I understand both Clojure and Guix, a Java
> runtime should be a propagated input of any Clojure package.

I’d like to avoid propagating inputs.  Could we add a wrapper instead?
The wrapper would set the appropriate environment variables and retain a
reference to the JVM.

-- 
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
https://elephly.net

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Packaging leiningen (feedback desired)
  2017-02-08 15:53       ` Ricardo Wurmus
@ 2017-02-08 16:37         ` Catonano
  0 siblings, 0 replies; 6+ messages in thread
From: Catonano @ 2017-02-08 16:37 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel, Alex ter Weele

[-- Attachment #1: Type: text/plain, Size: 293 bytes --]

2017-02-08 16:53 GMT+01:00 Ricardo Wurmus <rekado@elephly.net>:

I’d like to avoid propagating inputs.  Could we add a wrapper instead?
> The wrapper would set the appropriate environment variables and retain a
> reference to the JVM.
>

Good. So I can see how a wrapper is arranged

[-- Attachment #2: Type: text/html, Size: 655 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-02-08 16:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-07  3:30 Packaging leiningen (feedback desired) alex.ter.weele
2017-02-07  8:19 ` Danny Milosavljevic
2017-02-07 23:00   ` Ben Woodcroft
2017-02-08  0:01     ` Catonano
2017-02-08 15:53       ` Ricardo Wurmus
2017-02-08 16:37         ` Catonano

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).