From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hartmut Goebel Subject: Using a function as build-step? Date: Sat, 3 Sep 2016 20:22:37 +0200 Message-ID: <0b8f97f5-d931-a344-1000-8ab64233f026@goebel-consult.de> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------2A9FB8EAF4851897719D544A" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36666) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bgFaY-00028b-MX for guix-devel@gnu.org; Sat, 03 Sep 2016 14:22:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bgFaU-0006vl-Ek for guix-devel@gnu.org; Sat, 03 Sep 2016 14:22:45 -0400 Received: from mail-out.m-online.net ([212.18.0.10]:47640) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bgFaU-0006vX-5F for guix-devel@gnu.org; Sat, 03 Sep 2016 14:22:42 -0400 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 3sRPVS1SDyz3hlwB for ; Sat, 3 Sep 2016 20:22:39 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.68]) by mail.m-online.net (Postfix) with ESMTP id 3sRPVR7182zvlKW for ; Sat, 3 Sep 2016 20:22:39 +0200 (CEST) Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.68]) (amavisd-new, port 10024) with ESMTP id UrH1NmFGawRV for ; Sat, 3 Sep 2016 20:22:38 +0200 (CEST) Received: from hermia.goebel-consult.de (ppp-188-174-145-37.dynamic.mnet-online.de [188.174.145.37]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS for ; Sat, 3 Sep 2016 20:22:37 +0200 (CEST) Received: from thisbe.goebel-consult.de (hermia.goebel-consult.de [192.168.110.7]) by hermia.goebel-consult.de (Postfix) with ESMTP id 17BE6604CE for ; Sat, 3 Sep 2016 20:22:37 +0200 (CEST) List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Guix-devel This is a multi-part message in MIME format. --------------2A9FB8EAF4851897719D544A Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 (=CE=BB (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? --=20 Sch=C3=B6nen Gru=C3=9F 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= --------------2A9FB8EAF4851897719D544A Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable

Hi,

while packaging some java apache common packages, I found myself adding some build steps over and over again, like this one:

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (replace 'install=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (lambd= a* (#:key outputs #:allow-other-keys)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 (let ((share (string-append (assoc-ref outputs "out")
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 "/share/java")))
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 (for-each (=CE=BB (f) (install-file f share))
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= (find-files "target" "\\.jar$")))))

Now I tried replacing this by a simple line like

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (add-after 'insta= ll 'install-javadocs install-javadocs)

and of course some function:

=C2=A0 (define* (install-javadoc #:key outputs #:allow-other-keys)=
=C2=A0=C2=A0=C2=A0 (let ((docs (string-append (assoc-ref outputs "d= oc")
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 "/share/doc/" ,name "-" ,version "/")))
=C2=A0=C2=A0 =C2=A0=C2=A0 (mkdir-p docs)
=C2=A0 =C2=A0 =C2=A0 (copy-recursively "target/apidocs" docs)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ))

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=C3=B6nen Gru=C3=9F
Hartmut Goebel
Dipl.-Informatiker (univ), CISSP, CSSLP, ISO 27001 Lead Implementer
Information Security Management, Security Governance, Secure Software Development

Goebel Consult, Landshut
ht= tp://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

--------------2A9FB8EAF4851897719D544A--