GNU bug report logs - #26803
Java things

Previous Next

Package: guix-patches;

Reported by: Ricardo Wurmus <rekado <at> elephly.net>

Date: Sat, 6 May 2017 14:02:02 UTC

Severity: normal

Done: Ricardo Wurmus <rekado <at> elephly.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ricardo Wurmus <rekado <at> elephly.net>
To: Roel Janssen <roel <at> gnu.org>
Cc: 26803 <at> debbugs.gnu.org
Subject: bug#26803: [PATCH 27/36] gnu: Add java-mockito-1.
Date: Thu, 11 May 2017 10:22:14 +0200
Roel Janssen <roel <at> gnu.org> writes:

> Ricardo Wurmus writes:
>
>> * gnu/packages/java.scm (java-mockito): New variable.
>> ---
>>  gnu/packages/java.scm | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 60 insertions(+)
>>
>> diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
>> index 859f9934a..2cf2821c0 100644
>> --- a/gnu/packages/java.scm
>> +++ b/gnu/packages/java.scm
>> @@ -1977,6 +1977,66 @@ logging implementations.  A library that uses the commons-logging API can be
>>  used with any logging implementation at runtime.")
>>      (license license:asl2.0)))
>>  
>> +;; This is the last release of the 1.x series.
>> +(define-public java-mockito-1
>> +  (package
>> +    (name "java-mockito")
>> +    (version "1.10.19")
>> +    (source (origin
>> +              (method url-fetch)
>> +              (uri (string-append "http://repo1.maven.org/maven2/"
>> +                                  "org/mockito/mockito-core/" version
>> +                                  "/mockito-core-" version "-sources.jar"))
>> +              (sha256
>> +               (base32
>> +                "0vmiwnwpf83g2q7kj1rislmja8fpvqkixjhawh7nxnygx6pq11kc"))))
>> +    (build-system ant-build-system)
>> +    (arguments
>> +     `(#:jar-name "mockito.jar"
>> +       #:tests? #f ; no tests included
>> +       ;; FIXME: patch-and-repack does not support jars, so we have to apply
>> +       ;; patches in build phases.
>> +       #:phases
>> +       (modify-phases %standard-phases
>> +         ;; Mockito fails to build with our verson of hamcrest without this
>> +         ;; definition.
>> +         (add-after 'unpack 'fix-hamcrest-build-error
>> +           (lambda _
>> +             (substitute* "src/org/mockito/internal/matchers/LocalizedMatcher.java"
>> +               (("public Matcher getActualMatcher\\(\\) .*" line)
>> +                (string-append "
>> +    public void describeMismatch(Object item, Description description) {
>> +        actualMatcher.describeMismatch(item, description);
>> +    }"
>> +                               line)))
>> +             #t))
>
> I understand this is easier and possibly less error-prone than creating
> a patch file instead, but how far are we going with adding/removing code
> inside the package recipes?

There’s a FIXME comment above the #:phases.  I would like to use a patch
in this case, but patch-and-repack does not support jars.  We usually
unpack the sources, apply the patches, and then repack the sources, but
this currently doesn’t work for jars.

This is why I must do this in build phases.

> As far as the actual code addition goes, it is pretty straightforward:
> It adds a function that hamcrest expects is available.  Maybe add a
> comment describing this?  Then it's OK to me.

Okay, I’ll add a better comment here.

Thanks!

-- 
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
https://elephly.net





This bug report was last modified 8 years and 94 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.