Ludovic Courtès <l...@gnu.org> writes: > Hi! > > Hartmut Goebel <h.goe...@goebel-consult.de> skribis: > >> while packaging some java apache common packages, I found myself adding >> some build steps over and over again, like this one: >> >> (replace 'install >> (lambda* (#:key outputs #:allow-other-keys) >> (let ((share (string-append (assoc-ref outputs "out") >> "/share/java"))) >> (for-each (λ (f) (install-file f share)) >> (find-files "target" "\\.jar$"))))) >> >> Now I tried replacing this by a simple line like >> >> (add-after 'install 'install-javadocs install-javadocs) >> >> and of course some function: >> >> (define* (install-javadoc #:key outputs #:allow-other-keys) >> (let ((docs (string-append (assoc-ref outputs "doc") >> "/share/doc/" ,name "-" ,version "/"))) >> (mkdir-p docs) >> (copy-recursively "target/apidocs" docs) >> )) > > Note that the commas here (aka. “unquote”) mean that this expression > must be enclosed in a ` (aka. “quasiquote”). See > <https://www.gnu.org/software/guile/manual/html_node/Expression-Syntax.html#Expression-Syntax>. > >> I did not manage this - not even if not using "name" and "version" and >> not using any function parameters. >> >> What is the correct code? > > Like David, I would suggest creating a build-side module, say, (guix > build java-utils), or maybe augmenting (guix build ant-build-system), > and putting ‘install-javadoc’ in there (Ricardo?).
I agree. The “ant-build-system” was designed around the packages that I started with. It does not claim to be complete. Having a configurable “install-javadoc” phase in the “ant-build-system” seems useful. ~~ Ricardo