Subject: [bug#29359] [PATCH 22/31] gnu: Add java-dom4j.

From: julien lepiller <[email-masked]>
Date: Mon, 20 Nov 2017 10:07:16 +0100

Le 2017-11-20 09:58, Ricardo Wurmus a écrit :
> Julien Lepiller <[email-masked]> writes:
> 
>> * gnu/packages/java.scm (java-dom4j): New variable.
> 
> Better: (gnu packages xml).
> 
> […]
>> +    (arguments
>> +     `(#:jar-name "dom4j.jar"
>> +       #:jdk ,icedtea-8
>> +       #:source-dir "src/main/java"
>> +       #:tests? #f; Requires xalan, but xalan -> java-cup -> jflex -> 
>> java-cup...
> 
> So java-cup has a dependency on itself via jflex?
> Please add FIXME here, so that we can fix this once xalan is packaged.
> 
>> +       #:phases
>> +       (modify-phases %standard-phases
>> +         (add-before 'build 'copy-jaxen-sources
>> +           ;; jaxen-no-rec-deps is not enough. These files have a 
>> circular
>> +           ;; dependency and there is no subset of dom4j that would 
>> allow
>> +           ;; breaking the circle.
> 
> I still don’t know where “jaxen-no-rec-deps” comes from.

It's part of the java-xom patch, but I will rename it and make two 
patches instead.

> 
>> +         (add-before 'build 'fix-old-xpp2
>> +           (lambda _
>> +             ;; This package normally depends on xpp2 2.0, but we can 
>> only package
>> +             ;; version 2.1.10.
> 
> Why?

It's the only version I could find the source code of. I will add a 
comment.

> 
>> +             (substitute* 
>> "src/main/java/org/dom4j/xpp/ProxyXmlStartTag.java"
>> +               (("public void resetStartTag")
>> +                (string-append
>> +                  "public boolean removeAttributeByRawName(String 
>> name) {\n"
>> +                  "  return false;\n"
>> +                  "}\n"
>> +                  "public boolean removeAttributeByName(String name, 
>> String name2) {\n"
>> +                  "  return false;\n"
>> +                  "}\n"
>> +                  "\n"
> 
> I prefer not to use string-append here.  You can split strings and let
> them span multiple lines by escaping the line break.

Sure. I fixed some of these and forgot about this one. I'll make sure 
not to push such a thing
in other packages either. I agree that's ugly.

> 
>> +    (inputs
>> +     `(("java-jaxen-no-rec-deps" ,java-jaxen-no-rec-deps)
>> +       ("java-jaxen-sources" ,(package-source
>> java-jaxen-no-rec-deps))
> 
> Please remember to rename this when renaming “java-jaxen-no-rec-deps” 
> to
> “java-jaxen-bootstrap”.
> 
>> +    (home-page "https://dom4j.github.io/")
>> +    (synopsis "Flexible XML framework for Java")
>> +    (description "Dom4j is a flexible XML framework for Java.")
> 
> That’s a bit short.  Could you elaborate?
> 
>> +    ;; some BSD-like 5-clause license
>> +    (license (license:non-copyleft "file://LICENSE"))))
> 
> Weird license :)

Thanks for your review :)

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