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

From: Ricardo Wurmus <[email-masked]>
Date: Mon, 20 Nov 2017 09:58:19 +0100

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.

> +         (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?

> +             (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.

> +    (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 :)

--
Ricardo

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