From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: Re: [PATCH] GCJ: run libjava tests. Date: Tue, 27 Oct 2015 11:59:07 +0100 Message-ID: References: <20151022123345.GA7846@debian> <871tcik4b0.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45868) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zr1yJ-0007S3-2z for guix-devel@gnu.org; Tue, 27 Oct 2015 06:59:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zr1yF-0005mU-Rz for guix-devel@gnu.org; Tue, 27 Oct 2015 06:59:19 -0400 In-Reply-To: <871tcik4b0.fsf@gnu.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel --=-=-= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s writes: > =E2=80=98substitute-keyword-arguments=E2=80=99 only works if the given = keyword appears > in the input: > > (substitute-keyword-arguments '() > ((#:foo _) 'bar)) > > =3D> () > > It might be what=E2=80=99s happening here? You are right, this exactly what happened here. Attached is a new patch that pulls the =E2=80=98#:test-target=E2=80=99 li= ne out of the =E2=80=98substitute-keyword-arguments=E2=80=99 expression. The indentati= on of many lines changes because of this. =E2=80=98git diff -w=E2=80=99 shows that = the actual change is pretty small. --=-=-= Content-Type: text/x-patch; charset="utf-8" Content-Disposition: inline; filename="0001-gnu-gcj-Run-libjava-tests.patch" Content-Transfer-Encoding: quoted-printable >From 95609455bbdaa43699a66efe9a5508c06e0bf9ad Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus 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 =C2=A9 2012, 2013, 2014, 2015 Ludovic Court=C3=A8s ;;; Copyright =C2=A9 2014, 2015 Mark H Weaver -;;; Copyright =C2=A9 2014 Ricardo Wurmus +;;; Copyright =C2=A9 2014, 2015 Ricardo Wurmus ;;; Copyright =C2=A9 2015 Andreas Enge ;;; ;;; 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. (outputs (delete "lib" (package-outputs gcc))) (arguments - (substitute-keyword-arguments `(#:modules ((guix build gnu-build-sy= stem) - (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=3D" ecj) - "--enable-languages=3Djava" - ,@(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 =3D .* -shared" line) - (string-append line " -Wl,-rpath=3D$(libdir)")) - (("libgcj(_bc)?_la_LDFLAGS =3D" ldflags _) - (string-append ldflags " -Wl,-rpath=3D$(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/li= b") - "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-buil= d-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=3D" ecj) + "--enable-languages=3Djava" + ,@(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 =3D .* -shared" line) + (string-append line " -Wl,-rpath=3D$(libdir)")) + (("libgcj(_bc)?_la_LDFLAGS =3D" ldflags _) + (string-append ldflags " -Wl,-rpath=3D$(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.j= ar")) + + ;; Create javac wrapper from the template javac.in b= y + ;; 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/jr= e/lib") + "libjawt.so") + (find-files (string-append out "/bin") + ".*(c\\+\\+|cpp|g\\+\\+|gcc.*)"= )))) + #t))))))))) =20 (define ecj-bootstrap (origin --=20 2.1.0 --=-=-=--