unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / Atom feed
* [bug#38704] [PATCH] gnu: clojure: Add wrapper.
@ 2019-12-21 23:56 Jesse Gibbons
  2020-11-20 20:16 ` bug#38704: " Christopher Baines
  0 siblings, 1 reply; 2+ messages in thread
From: Jesse Gibbons @ 2019-12-21 23:56 UTC (permalink / raw)
  To: 38704

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@gmail.com>
 ;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz>
 ;;; Copyright © 2019 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2019 Jesse Gibbons <jgibbons2357+guix@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")

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

* bug#38704: [PATCH] gnu: clojure: Add wrapper.
  2019-12-21 23:56 [bug#38704] [PATCH] gnu: clojure: Add wrapper Jesse Gibbons
@ 2020-11-20 20:16 ` Christopher Baines
  0 siblings, 0 replies; 2+ messages in thread
From: Christopher Baines @ 2020-11-20 20:16 UTC (permalink / raw)
  To: Jesse Gibbons; +Cc: 38704-done

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


Jesse Gibbons <jgibbons2357@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@gmail.com>
>  ;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz>
>  ;;; Copyright © 2019 Tobias Geerinckx-Rice <me@tobias.gr>
> +;;; Copyright © 2019 Jesse Gibbons <jgibbons2357+guix@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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 987 bytes --]

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

end of thread, other threads:[~2020-11-20 20:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-21 23:56 [bug#38704] [PATCH] gnu: clojure: Add wrapper Jesse Gibbons
2020-11-20 20:16 ` bug#38704: " Christopher Baines

unofficial mirror of guix-patches@gnu.org 

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/guix-patches/1 guix-patches/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 guix-patches guix-patches/ https://yhetil.org/guix-patches \
		guix-patches@gnu.org
	public-inbox-index guix-patches

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://news.yhetil.org/yhetil.gnu.guix.patches


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git