[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] GCJ: run libjava tests.
From: |
Ricardo Wurmus |
Subject: |
Re: [PATCH] GCJ: run libjava tests. |
Date: |
Tue, 27 Oct 2015 11:59:07 +0100 |
Ludovic Courtès <address@hidden> writes:
> ‘substitute-keyword-arguments’ only works if the given keyword appears
> in the input:
>
> (substitute-keyword-arguments '()
> ((#:foo _) 'bar))
>
> => ()
>
> It might be what’s happening here?
You are right, this exactly what happened here.
Attached is a new patch that pulls the ‘#:test-target’ line out of the
‘substitute-keyword-arguments’ expression. The indentation of many
lines changes because of this. ‘git diff -w’ shows that the actual
change is pretty small.
>From 95609455bbdaa43699a66efe9a5508c06e0bf9ad Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <address@hidden>
Date: Thu, 22 Oct 2015 13:02:37 +0200
Subject: [PATCH] gnu: gcj: Run libjava tests.
* gnu/packages/gcc.scm (gcj)[native-inputs]: Add dejagnu.
[arguments]: Replace check phase to run "check-target-libjava" target.
---
gnu/packages/gcc.scm | 138 +++++++++++++++++++++++++++------------------------
1 file changed, 72 insertions(+), 66 deletions(-)
diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index 7e4f18b..5d07255 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -1,7 +1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <address@hidden>
;;; Copyright © 2014, 2015 Mark H Weaver <address@hidden>
-;;; Copyright © 2014 Ricardo Wurmus <address@hidden>
+;;; Copyright © 2014, 2015 Ricardo Wurmus <address@hidden>
;;; Copyright © 2015 Andreas Enge <address@hidden>
;;;
;;; This file is part of GNU Guix.
@@ -27,6 +27,7 @@
#:use-module (gnu packages compression)
#:use-module (gnu packages multiprecision)
#:use-module (gnu packages texinfo)
+ #:use-module (gnu packages dejagnu)
#:use-module (gnu packages doxygen)
#:use-module (gnu packages xml)
#:use-module (gnu packages docbook)
@@ -460,77 +461,82 @@ using compilers other than GCC."
("javac.in" ,javac.in)
("ecj-bootstrap" ,ecj-bootstrap)
,@(package-inputs gcc)))
+ (native-inputs
+ `(("dejagnu" ,dejagnu)
+ ,@(package-native-inputs gcc)))
;; Suppress the separate "lib" output, because otherwise the
;; "lib" and "out" outputs would refer to each other, creating
;; a cyclic dependency. <http://debbugs.gnu.org/18101>
(outputs
(delete "lib" (package-outputs gcc)))
(arguments
- (substitute-keyword-arguments `(#:modules ((guix build gnu-build-system)
- (guix build utils)
- (ice-9 regex)
- (srfi srfi-1)
- (srfi srfi-26))
- ,@(package-arguments gcc))
- ((#:configure-flags flags)
- `(let ((ecj (assoc-ref %build-inputs "ecj-bootstrap")))
- `("--enable-java-home"
- "--enable-gjdoc"
- ,(string-append "--with-ecj-jar=" ecj)
- "--enable-languages=java"
- ,@(remove (cut string-match "--enable-languages.*" <>)
- ,flags))))
- ((#:phases phases)
- `(modify-phases ,phases
- (add-after
- 'unpack 'add-lib-output-to-rpath
- (lambda _
- (substitute* "libjava/Makefile.in"
- (("libgcj_bc_dummy_LINK = .* -shared" line)
- (string-append line " -Wl,-rpath=$(libdir)"))
- (("libgcj(_bc)?_la_LDFLAGS =" ldflags _)
- (string-append ldflags " -Wl,-rpath=$(libdir)")))))
- (add-after
- 'install 'install-javac-and-javap-wrappers
- (lambda _
- (let* ((javac (assoc-ref %build-inputs "javac.in"))
- (ecj (assoc-ref %build-inputs "ecj-bootstrap"))
- (gcj (assoc-ref %outputs "out"))
- (gcjbin (string-append gcj "/bin/"))
- (jvm (string-append gcj "/lib/jvm/"))
- (target (string-append jvm "/bin/javac")))
-
- (symlink (string-append gcjbin "jcf-dump")
- (string-append jvm "/bin/javap"))
-
- (copy-file ecj (string-append gcj "/share/java/ecj.jar"))
-
- ;; Create javac wrapper from the template javac.in by
- ;; replacing the @VARIABLES@ with paths.
- (copy-file javac target)
- (patch-shebang target)
- (substitute* target
- (("@JAVA@")
- (string-append jvm "/bin/java"))
- (("@ECJ_JAR@")
- (string-append gcj "/share/java/ecj.jar"))
- (("@RT_JAR@")
- (string-append jvm "/jre/lib/rt.jar"))
- (("@TOOLS_JAR@")
- (string-append jvm "/lib/tools.jar")))
- (chmod target #o755)
- #t)))
- (add-after
- 'install 'remove-broken-or-conflicting-files
- (lambda _
- (let ((out (assoc-ref %outputs "out")))
- (for-each
- delete-file
- (append (find-files (string-append out "/lib/jvm/jre/lib")
- "libjawt.so")
- (find-files (string-append out "/bin")
- ".*(c\\+\\+|cpp|g\\+\\+|gcc.*)"))))
- #t))))))))
+ `(#:test-target "check-target-libjava"
+ ,@(substitute-keyword-arguments `(#:modules ((guix build
gnu-build-system)
+ (guix build utils)
+ (ice-9 regex)
+ (srfi srfi-1)
+ (srfi srfi-26))
+ ,@(package-arguments gcc))
+ ((#:tests? _) #t)
+ ((#:configure-flags flags)
+ `(let ((ecj (assoc-ref %build-inputs "ecj-bootstrap")))
+ `("--enable-java-home"
+ "--enable-gjdoc"
+ ,(string-append "--with-ecj-jar=" ecj)
+ "--enable-languages=java"
+ ,@(remove (cut string-match "--enable-languages.*" <>)
+ ,flags))))
+ ((#:phases phases)
+ `(modify-phases ,phases
+ (add-after
+ 'unpack 'add-lib-output-to-rpath
+ (lambda _
+ (substitute* "libjava/Makefile.in"
+ (("libgcj_bc_dummy_LINK = .* -shared" line)
+ (string-append line " -Wl,-rpath=$(libdir)"))
+ (("libgcj(_bc)?_la_LDFLAGS =" ldflags _)
+ (string-append ldflags " -Wl,-rpath=$(libdir)")))))
+ (add-after
+ 'install 'install-javac-and-javap-wrappers
+ (lambda _
+ (let* ((javac (assoc-ref %build-inputs "javac.in"))
+ (ecj (assoc-ref %build-inputs "ecj-bootstrap"))
+ (gcj (assoc-ref %outputs "out"))
+ (gcjbin (string-append gcj "/bin/"))
+ (jvm (string-append gcj "/lib/jvm/"))
+ (target (string-append jvm "/bin/javac")))
+
+ (symlink (string-append gcjbin "jcf-dump")
+ (string-append jvm "/bin/javap"))
+
+ (copy-file ecj (string-append gcj "/share/java/ecj.jar"))
+
+ ;; Create javac wrapper from the template javac.in by
+ ;; replacing the @VARIABLES@ with paths.
+ (copy-file javac target)
+ (patch-shebang target)
+ (substitute* target
+ (("@JAVA@")
+ (string-append jvm "/bin/java"))
+ (("@ECJ_JAR@")
+ (string-append gcj "/share/java/ecj.jar"))
+ (("@RT_JAR@")
+ (string-append jvm "/jre/lib/rt.jar"))
+ (("@TOOLS_JAR@")
+ (string-append jvm "/lib/tools.jar")))
+ (chmod target #o755)
+ #t)))
+ (add-after
+ 'install 'remove-broken-or-conflicting-files
+ (lambda _
+ (let ((out (assoc-ref %outputs "out")))
+ (for-each
+ delete-file
+ (append (find-files (string-append out "/lib/jvm/jre/lib")
+ "libjawt.so")
+ (find-files (string-append out "/bin")
+ ".*(c\\+\\+|cpp|g\\+\\+|gcc.*)"))))
+ #t)))))))))
(define ecj-bootstrap
(origin
--
2.1.0
- [PATCH] GCJ: run libjava tests., Ricardo Wurmus, 2015/10/22
- Re: [PATCH] GCJ: run libjava tests., Andreas Enge, 2015/10/22
- Re: [PATCH] GCJ: run libjava tests., Ricardo Wurmus, 2015/10/22
- Re: [PATCH] GCJ: run libjava tests., Ricardo Wurmus, 2015/10/22
- Re: [PATCH] GCJ: run libjava tests., Andreas Enge, 2015/10/23
- Re: [PATCH] GCJ: run libjava tests., Ludovic Courtès, 2015/10/25
- Re: [PATCH] GCJ: run libjava tests.,
Ricardo Wurmus <=
- Re: [PATCH] GCJ: run libjava tests., Ludovic Courtès, 2015/10/27
- Re: [PATCH] GCJ: run libjava tests., Ricardo Wurmus, 2015/10/27