[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
27/50: gnu: ecj-javac-wrapper: Use G-Expression.
From: |
guix-commits |
Subject: |
27/50: gnu: ecj-javac-wrapper: Use G-Expression. |
Date: |
Thu, 23 Dec 2021 12:52:36 -0500 (EST) |
rekado pushed a commit to branch wip-java-bootstrap-simplify
in repository guix.
commit 913ce500e3fe37bea9268ccb1ab702f891b0732b
Author: Ricardo Wurmus <rekado@elephly.net>
AuthorDate: Sat Dec 18 17:28:08 2021 +0100
gnu: ecj-javac-wrapper: Use G-Expression.
* gnu/packages/java.scm (ecj-javac-wrapper)[arguments]: Use a gexp to remove
references to %outputs and %build-inputs.
[native-inputs]: Use label-less style.
---
gnu/packages/java.scm | 114 +++++++++++++++++++++++++-------------------------
1 file changed, 56 insertions(+), 58 deletions(-)
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index 8f5e378..b8ed4d5 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -506,64 +506,62 @@ requirement for all GNU Classpath releases after version
0.93.")
(arguments
`(#:modules ((guix build utils))
#:builder
- (begin
- (use-modules (guix build utils))
- (let* ((bin (string-append (assoc-ref %outputs "out") "/bin"))
- (target (string-append bin "/javac"))
- (guile (string-append (assoc-ref %build-inputs "guile")
- "/bin/guile"))
- (ecj (string-append (assoc-ref %build-inputs
"ecj-bootstrap")
- "/share/java/ecj-bootstrap.jar"))
- (java (string-append (assoc-ref %build-inputs "jamvm")
- "/bin/jamvm"))
- (bootcp (let ((jvmlib (string-append (assoc-ref %build-inputs
"classpath")
- "/share/classpath")))
- (string-append jvmlib "/glibj.zip:"
- jvmlib "/tools.zip"))))
- (mkdir-p bin)
- (with-output-to-file target
- (lambda _
- (format #t "#!~a --no-auto-compile\n!#\n" guile)
- (write
- `(begin (use-modules (ice-9 match)
- (ice-9 receive)
- (ice-9 hash-table)
- (srfi srfi-1)
- (srfi srfi-26))
- (define defaults
- '(("-bootclasspath" ,bootcp)
- ("-source" "1.5")
- ("-target" "1.5")
- ("-cp" ".")))
- (define (main args)
- (let ((classpath (getenv "CLASSPATH")))
- (setenv "CLASSPATH"
- (string-join (list ,ecj (or classpath ""))
- ":")))
- (receive (vm-args other-args)
- ;; Separate VM arguments from arguments to ECJ.
- (partition (cut string-prefix? "-J" <>)
- (fold (lambda (default acc)
- (if (member (first default)
acc)
- acc (append default acc)))
- args defaults))
- (apply system* ,java
- (append
- ;; Remove "-J" prefix
- (map (cut string-drop <> 2) vm-args)
-
'("org.eclipse.jdt.internal.compiler.batch.Main")
- (cons "-nowarn" other-args)))))
- ;; Entry point
- (let ((args (cdr (command-line))))
- (if (null? args)
- (format (current-error-port) "javac: no
arguments given!\n")
- (main args)))))))
- (chmod target #o755)))))
- (native-inputs
- `(("guile" ,guile-3.0)
- ("ecj-bootstrap" ,ecj-bootstrap)
- ("jamvm" ,jamvm-1-bootstrap)
- ("classpath" ,classpath-bootstrap)))
+ ,#~(begin
+ (use-modules (guix build utils))
+ (let* ((bin (string-append #$output "/bin"))
+ (target (string-append bin "/javac"))
+ (guile (string-append (assoc-ref %build-inputs "guile")
+ "/bin/guile"))
+ (ecj (string-append #$(this-package-native-input
"ecj-bootstrap")
+ "/share/java/ecj-bootstrap.jar"))
+ (java (string-append #$(this-package-native-input "jamvm")
+ "/bin/jamvm"))
+ (bootcp (let ((jvmlib (string-append
+ #$(this-package-native-input
"classpath")
+ "/share/classpath")))
+ (string-append jvmlib "/glibj.zip:"
+ jvmlib "/tools.zip"))))
+ (mkdir-p bin)
+ (with-output-to-file target
+ (lambda _
+ (format #t "#!~a --no-auto-compile\n!#\n" guile)
+ (write
+ `(begin (use-modules (ice-9 match)
+ (ice-9 receive)
+ (ice-9 hash-table)
+ (srfi srfi-1)
+ (srfi srfi-26))
+ (define defaults
+ '(("-bootclasspath" ,bootcp)
+ ("-source" "1.5")
+ ("-target" "1.5")
+ ("-cp" ".")))
+ (define (main args)
+ (let ((classpath (getenv "CLASSPATH")))
+ (setenv "CLASSPATH"
+ (string-join (list ,ecj (or classpath
""))
+ ":")))
+ (receive (vm-args other-args)
+ ;; Separate VM arguments from arguments to
ECJ.
+ (partition (cut string-prefix? "-J" <>)
+ (fold (lambda (default acc)
+ (if (member (first
default) acc)
+ acc (append default
acc)))
+ args defaults))
+ (apply system* ,java
+ (append
+ ;; Remove "-J" prefix
+ (map (cut string-drop <> 2) vm-args)
+
'("org.eclipse.jdt.internal.compiler.batch.Main")
+ (cons "-nowarn" other-args)))))
+ ;; Entry point
+ (let ((args (cdr (command-line))))
+ (if (null? args)
+ (format (current-error-port) "javac: no
arguments given!\n")
+ (main args)))))))
+ (chmod target #o755)))))
+ (native-inputs
+ (list guile-3.0 ecj-bootstrap jamvm-1-bootstrap classpath-bootstrap))
(description "This package provides a wrapper around the @dfn{Eclipse
compiler for Java} (ecj) with a command line interface that is compatible with
the standard javac executable.")))
- 24/50: gnu: ant-bootstrap: Remove trailing #T from build phase., (continued)
- 24/50: gnu: ant-bootstrap: Remove trailing #T from build phase., guix-commits, 2021/12/23
- 15/50: gnu: icedtea-7: Import missing module for read-line., guix-commits, 2021/12/23
- 35/50: gnu: classpath-devel: Use label-less input style., guix-commits, 2021/12/23
- 42/50: gnu: java-mail: Disable SSL test., guix-commits, 2021/12/23
- 50/50: gnu: axoloti-patcher-next: Fix file names., guix-commits, 2021/12/23
- 17/50: gnu: icedtea-8: Remove commented configure flag., guix-commits, 2021/12/23
- 38/50: gnu: java-icu4j: Update to 70.1., guix-commits, 2021/12/23
- 36/50: gnu: drip: Move it below the Java bootstrap packages., guix-commits, 2021/12/23
- 33/50: gnu: ecj-bootstrap: Use label-less input style., guix-commits, 2021/12/23
- 49/50: gnu: axoloti-patcher-next: Remove trailing #T., guix-commits, 2021/12/23
- 27/50: gnu: ecj-javac-wrapper: Use G-Expression.,
guix-commits <=
- 40/50: gnu: java-kafka-clients: Use new input style., guix-commits, 2021/12/23
- 41/50: gnu: java-kafka-clients: Update to 1.1.1., guix-commits, 2021/12/23
- 44/50: gnu: java-mail: Use new input style., guix-commits, 2021/12/23
- 06/50: gnu: ecj-javac-wrapper-final: Use Guile 3., guix-commits, 2021/12/23
- 08/50: gnu: Add ecj4-bootstrap., guix-commits, 2021/12/23
- 10/50: gnu: Add jamvm-with-ecj4., guix-commits, 2021/12/23
- 11/50: gnu: icedtea-7: Run tests conditionally., guix-commits, 2021/12/23
- 13/50: gnu: icedtea-7: Bind INPUTS in 'patch-paths build phase., guix-commits, 2021/12/23
- 14/50: gnu: icedtea-7: Use system lcms and pcsc., guix-commits, 2021/12/23
- 26/50: gnu: ecj-bootstrap: Remove #:modules from arguments., guix-commits, 2021/12/23