From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55743) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d77Qr-0004dx-G1 for guix-patches@gnu.org; Sat, 06 May 2017 17:40:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d77Qo-0007xS-Cw for guix-patches@gnu.org; Sat, 06 May 2017 17:40:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:60495) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d77Qo-0007x3-A7 for guix-patches@gnu.org; Sat, 06 May 2017 17:40:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1d77Qo-0004ms-1G for guix-patches@gnu.org; Sat, 06 May 2017 17:40:02 -0400 Subject: bug#26803: [PATCH 11/36] gnu: java-hamcrest-core: Install all jars without version suffix. Resent-Message-ID: References: <20170506153617.3074-1-rekado@elephly.net> <20170506153617.3074-11-rekado@elephly.net> From: Roel Janssen In-reply-to: <20170506153617.3074-11-rekado@elephly.net> Date: Sat, 06 May 2017 23:39:10 +0200 Message-ID: <87bmr5k6m9.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Ricardo Wurmus Cc: 26803@debbugs.gnu.org Ricardo Wurmus writes: > * gnu/packages/java.scm (java-hamcrest-core)[arguments]: Install all three > jars and strip the version suffix. > --- > gnu/packages/java.scm | 26 +++++++++++++++++++++----- > 1 file changed, 21 insertions(+), 5 deletions(-) > > diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm > index 3dc71e4bc..57ef65336 100644 > --- a/gnu/packages/java.scm > +++ b/gnu/packages/java.scm > @@ -1081,7 +1081,10 @@ an Ant task that extends the built-in @code{jar} task.") > #t)))) > (build-system ant-build-system) > (arguments > - `(#:tests? #f ; Tests require junit > + `(#:tests? #f ; Tests require junit Is this intended? > + #:modules ((guix build ant-build-system) > + (guix build utils) > + (srfi srfi-1)) > #:make-flags (list (string-append "-Dversion=" ,version)) > #:build-target "core" > #:phases > @@ -1133,10 +1136,23 @@ private Method[] allMethods = getSortedMethods();"))))) > #t)) > (replace 'install > (lambda* (#:key outputs #:allow-other-keys) > - (install-file (string-append "build/hamcrest-core-" > - ,version ".jar") > - (string-append (assoc-ref outputs "out") > - "/share/java"))))))) > + (let* ((target (string-append (assoc-ref outputs "out") > + "/share/java/")) > + (version-suffix ,(string-append "-" version ".jar")) > + (install-without-version-suffix > + (lambda (jar) > + (copy-file jar > + (string-append target > + (basename jar version-suffix) > + ".jar"))))) > + (mkdir-p target) > + (for-each > + install-without-version-suffix > + (find-files "build" > + (lambda (name _) > + (and (string-suffix? ".jar" name) > + (not (string-suffix? "-sources.jar" name))))))) > + #t))))) > (native-inputs > `(("java-qdox-1.12" ,java-qdox-1.12) > ("java-jarjar" ,java-jarjar))) Otherwise LGTM! Kind regards, Roel Janssen