GNU bug report logs - #38704
[PATCH] gnu: clojure: Add wrapper.

Previous Next

Package: guix-patches;

Reported by: Jesse Gibbons <jgibbons2357 <at> gmail.com>

Date: Sat, 21 Dec 2019 23:57:01 UTC

Severity: normal

Tags: patch

Done: Christopher Baines <mail <at> cbaines.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 38704 in the body.
You can then email your comments to 38704 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#38704; Package guix-patches. (Sat, 21 Dec 2019 23:57:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jesse Gibbons <jgibbons2357 <at> gmail.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sat, 21 Dec 2019 23:57:02 GMT) Full text and rfc822 format available.

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

From: Jesse Gibbons <jgibbons2357 <at> gmail.com>
To: guix-patches mailing list <guix-patches <at> gnu.org>
Subject: [PATCH] gnu: clojure: Add wrapper.
Date: Sat, 21 Dec 2019 16:56:43 -0700
gnu/packages/clojure.scm: (clojure)[inputs]: Add icedtea.
   [phases] {make-wrapper}: New phase.

fixes: https://issues.guix.gnu.org/issue/32709
---
 gnu/packages/clojure.scm | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/clojure.scm b/gnu/packages/clojure.scm
index a9cabfe008..85d8708eee 100644
--- a/gnu/packages/clojure.scm
+++ b/gnu/packages/clojure.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2018 Alex Vong <alexvong1995 <at> gmail.com>
 ;;; Copyright © 2018 Pierre Neidhardt <mail <at> ambrevar.xyz>
 ;;; Copyright © 2019 Tobias Geerinckx-Rice <me <at> tobias.gr>
+;;; Copyright © 2019 Jesse Gibbons <jgibbons2357+guix <at> gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -20,6 +21,7 @@
 
 (define-module (gnu packages clojure)
   #:use-module (gnu packages)
+  #:use-module (gnu packages java)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
@@ -77,6 +79,8 @@
                   (sha256
                    (base32
"1kcyv2836acs27vi75hvf3r773ahv2nlh9b3j9xa9m9sdanz1h83")))))
       (build-system ant-build-system)
+      (inputs
+       `(("jre" ,icedtea)))
       (arguments
        `(#:imported-modules ((guix build clojure-utils)
                              (guix build guile-build-system)
@@ -113,7 +117,21 @@
            (add-after 'install-license-files 'install-doc
              (cut install-doc #:doc-dirs '("doc/clojure/") <...>))
            (add-after 'install-doc 'install-javadoc
-             (install-javadoc "target/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
+                       "#!/bin/sh\n\n"
+                       (assoc-ref inputs "jre") "/bin/java -jar "
+                       out "/share/java/clojure.jar \"$@\"\n"))))
+                 (chmod wrapper #o555))
+               #t)))))
       (native-inputs libraries)
       (home-page "https://clojure.org/")
       (synopsis "Lisp dialect running on the JVM")






Reply sent to Christopher Baines <mail <at> cbaines.net>:
You have taken responsibility. (Fri, 20 Nov 2020 20:17:02 GMT) Full text and rfc822 format available.

Notification sent to Jesse Gibbons <jgibbons2357 <at> gmail.com>:
bug acknowledged by developer. (Fri, 20 Nov 2020 20:17:02 GMT) Full text and rfc822 format available.

Message #10 received at 38704-done <at> debbugs.gnu.org (full text, mbox):

From: Christopher Baines <mail <at> cbaines.net>
To: Jesse Gibbons <jgibbons2357 <at> gmail.com>
Cc: 38704-done <at> debbugs.gnu.org
Subject: Re: [bug#38704] [PATCH] gnu: clojure: Add wrapper.
Date: Fri, 20 Nov 2020 20:16:11 +0000
[Message part 1 (text/plain, inline)]
Jesse Gibbons <jgibbons2357 <at> gmail.com> writes:

> gnu/packages/clojure.scm: (clojure)[inputs]: Add icedtea.
>    [phases] {make-wrapper}: New phase.
>
> fixes: https://issues.guix.gnu.org/issue/32709

Hi Jesse,

Apologies for the long delay with this patch.

I tweaked the commit message, and the patch in one place and I've gone
ahead and pushed it to master as
d38903fab47fe333a99c68166e98e454d6e0e446.

> ---
>  gnu/packages/clojure.scm | 20 +++++++++++++++++++-
>  1 file changed, 19 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/packages/clojure.scm b/gnu/packages/clojure.scm
> index a9cabfe008..85d8708eee 100644
> --- a/gnu/packages/clojure.scm
> +++ b/gnu/packages/clojure.scm
> @@ -2,6 +2,7 @@
>  ;;; Copyright © 2018 Alex Vong <alexvong1995 <at> gmail.com>
>  ;;; Copyright © 2018 Pierre Neidhardt <mail <at> ambrevar.xyz>
>  ;;; Copyright © 2019 Tobias Geerinckx-Rice <me <at> tobias.gr>
> +;;; Copyright © 2019 Jesse Gibbons <jgibbons2357+guix <at> gmail.com>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -20,6 +21,7 @@
>  
>  (define-module (gnu packages clojure)
>    #:use-module (gnu packages)
> +  #:use-module (gnu packages java)
>    #:use-module ((guix licenses) #:prefix license:)
>    #:use-module (guix packages)
>    #:use-module (guix download)
> @@ -77,6 +79,8 @@
>                    (sha256
>                     (base32
> "1kcyv2836acs27vi75hvf3r773ahv2nlh9b3j9xa9m9sdanz1h83")))))
>        (build-system ant-build-system)
> +      (inputs
> +       `(("jre" ,icedtea)))
>        (arguments
>         `(#:imported-modules ((guix build clojure-utils)
>                               (guix build guile-build-system)
> @@ -113,7 +117,21 @@
>             (add-after 'install-license-files 'install-doc
>               (cut install-doc #:doc-dirs '("doc/clojure/") <...>))
>             (add-after 'install-doc 'install-javadoc
> -             (install-javadoc "target/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
> +                       "#!/bin/sh\n\n"

I used (which "sh") here rather than hardcoding /bin/sh, as then there's
no dependency on the changable /bin/sh.

> +                       (assoc-ref inputs "jre") "/bin/java -jar "
> +                       out "/share/java/clojure.jar \"$@\"\n"))))
> +                 (chmod wrapper #o555))
> +               #t)))))
>        (native-inputs libraries)
>        (home-page "https://clojure.org/")
>        (synopsis "Lisp dialect running on the JVM")

Thanks again,

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

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 19 Dec 2020 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 129 days ago.

Previous Next


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