guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using a function as build-step?


From: Hartmut Goebel
Subject: Using a function as build-step?
Date: Sat, 3 Sep 2016 20:22:37 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0

Hi,

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)
      ))

I did not manage this - not even if not using "name" and "version" and not using any function parameters.

What is the correct code?

--
Schönen Gruß
Hartmut Goebel
Dipl.-Informatiker (univ), CISSP, CSSLP, ISO 27001 Lead Implementer
Information Security Management, Security Governance, Secure Software Development

Goebel Consult, Landshut
http://www.goebel-consult.de

Blog: http://www.goebel-consult.de/blog/feiertagsarbeit-bei-teletrust
Kolumne: http://www.cissp-gefluester.de/2010-06-adobe-und-der-maiszunsler


reply via email to

[Prev in Thread] Current Thread [Next in Thread]