Subject: [bug#31250] [PATCH] Add leiningen

From: [email-masked] (Ludovic Courtès)
Date: Wed, 25 Apr 2018 22:54:09 +0200

Hello,

Charlie Ritter <[email-masked]> skribis:

> From eac978c99ef288926530dcdee64cc9e3b7b8fe32 Mon Sep 17 00:00:00 2001
> From: Charlie Ritter <[email-masked]>
> 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’.