Subject: Re: bug#26803: [PATCH 15/36] gnu: Add java-commons-io.

From: Roel Janssen <[email-masked]>
Date: Wed, 10 May 2017 16:24:02 +0200

Ricardo Wurmus writes:

> Roel Janssen <[email-masked]> writes:
>
>> Ricardo Wurmus writes:
>>
>>> From: Hartmut Goebel <[email-masked]>
>>>
>>> * gnu/packages/java.scm (java-commons-io): New variable.
>>>
>>> Co-authored-by: Ricardo Wurmus <[email-masked]>
>>> ---
> […]
>>> +    (arguments
>>> +     `(#:test-target "test"
>>> +       #:phases
>>> +       (modify-phases %standard-phases
>>> +         (add-after 'unpack 'symlink-junit.jar
>>> +           (lambda* (#:key inputs #:allow-other-keys)
>>> +             ;; TODO: don't do this; use make-flags
>>> +             ;; The existence of this file is taken as indicator whether test
>>> +             ;; dependencies will to be downloaded.
>>> +             (let ((junit (assoc-ref inputs "java-junit"))
>>> +                   (junit-version "4.12")) ; from build.xml
>>> +               (mkdir-p "lib")
>>> +               (symlink (string-append junit "/share/java/junit.jar")
>>> +                        (string-append "lib/junit-" junit-version ".jar"))
>>> +               #t)))
>>
>> I'm not sure how the result of the code here could be achieved
>> using 'make-flags', so is the TODO item referring to an already-removed
>> piece of code?
>
> Oh, I forgot about this.  It’s actually pretty easy to do this with
> make-flags:
>
>        #:make-flags
>        (list (string-append "-Djunit.jar="
>                             (assoc-ref %build-inputs "java-junit")
>                             "/share/java/junit.jar"))
>
> Much nicer than symlinking things!
> I’ll push it with this change.

Yes, definitely.  Very nice!
Is the "lib" directory automatically created this way?

LGTM.

Kind regards,
Roel Janssen