From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hartmut Goebel Subject: Re: Using a function as build-step? (w/ attachement) Date: Sun, 4 Sep 2016 13:43:30 +0200 Message-ID: <71b4f428-e04e-4577-c6b9-dbf0d7105df0@goebel-consult.de> References: <0b8f97f5-d931-a344-1000-8ab64233f026@goebel-consult.de> <6c7fa110-6639-b89e-f13c-e1a676199284@goebel-consult.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------C8CB68C707EF31C409C08E05" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48257) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bgVpp-0002JV-HM for guix-devel@gnu.org; Sun, 04 Sep 2016 07:43:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bgVpl-0006im-AX for guix-devel@gnu.org; Sun, 04 Sep 2016 07:43:36 -0400 Received: from mail-out.m-online.net ([212.18.0.9]:40624) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bgVpk-0006ii-W6 for guix-devel@gnu.org; Sun, 04 Sep 2016 07:43:33 -0400 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 3sRrbS3YYWz3hjYX for ; Sun, 4 Sep 2016 13:43:32 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.68]) by mail.m-online.net (Postfix) with ESMTP id 3sRrbS3SfHzvkY1 for ; Sun, 4 Sep 2016 13:43:32 +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 w5NLjpti7bnd for ; Sun, 4 Sep 2016 13:43:30 +0200 (CEST) Received: from hermia.goebel-consult.de (ppp-188-174-153-243.dynamic.mnet-online.de [188.174.153.243]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS for ; Sun, 4 Sep 2016 13:43:30 +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 12C4860BD5 for ; Sun, 4 Sep 2016 13:43:30 +0200 (CEST) In-Reply-To: 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@gnu.org This is a multi-part message in MIME format. --------------C8CB68C707EF31C409C08E05 Content-Type: multipart/alternative; boundary="------------1D6173BD87C9E4E1E096C827" --------------1D6173BD87C9E4E1E096C827 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Am 04.09.2016 um 13:29 schrieb David Craven:( > Mmh. Maybe you could post a patch so that we can test it? Or maybe > someone more knowledgeable has an answer... > Enclosed. I assume for someone knowledgeable in guile this is a no-brainer. -- 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/get-current-locale-with-ansible Kolumne: http://www.cissp-gefluester.de/2010-08-scheingefechte-um-rim --------------1D6173BD87C9E4E1E096C827 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit
Am 04.09.2016 um 13:29 schrieb David Craven:(
Mmh. Maybe you could post a patch so that we can test it? Or maybe
someone more knowledgeable has an answer...


Enclosed. I assume for someone knowledgeable in guile this is a no-brainer.

--
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/get-current-locale-with-ansible
Kolumne: http://www.cissp-gefluester.de/2010-08-scheingefechte-um-rim

--------------1D6173BD87C9E4E1E096C827-- --------------C8CB68C707EF31C409C08E05 Content-Type: text/x-scheme; name="commons.scm" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="commons.scm" (use-modules (guix) (guix build-system ant) (guix licenses) (gnu packages base) (gnu packages java) (gnu packages zip) ) (define* (apache-commons-url projname version #:optional (basename (string-append "commons-" projname))) (string-append "https://archive.apache.org/dist/commons/" projname "/source/" basename "-" version "-src.tar.gz")) ; todo: how to use these as a phase, like ; (replace 'install install-jars) ; (add-after 'build build-javadoc) (define* (symlink-junit-jar #:key outputs #:allow-other-keys) ; Put a symlink to the acutal junit.jar into lib/jsunit-VERSION.jar (let ((junit (assoc-ref inputs "java-junit")) (junit-version "4.12")) ; from build.xml (mkdir-p "lib") (symlink (string-append junit "/share/java/junit.jar") (string-append "lib/junit-" junit-version ".jar")))) (define* (install-jars #:key outputs #:allow-other-keys) (let ((share (string-append (assoc-ref outputs "out") "/share/java"))) (for-each (λ (f) (install-file f share)) (find-files "." "\\.jar2$")))) (define* (build-javadoc #:key (make-flags '()) #:allow-other-keys) ; build command for calling the ant task "javadoc" (zero? (apply system* `("ant" "javadoc" ,@make-flags)))) (define* (install-javadoc #:key outputs #:allow-other-keys) ; build command for installing the javs docs into ; DOC/share/doc/NAME-VERSION (let ((docs (string-append (assoc-ref outputs "doc") "/share/doc/" name "-" version "/"))) (mkdir-p docs) (copy-recursively "target/apidocs" docs))) (define-public java-commons-io (package (name "java-commons-io") (version "2.5") (source (origin (method url-fetch) (uri (apache-commons-url "io" version)) (sha256 (base32 "0q5y41jrcjvx9hzs47x5kdhnasdy6rm4bzqd2jxl02w717m7a7v3")))) (build-system ant-build-system) (outputs '("out" "doc")) (arguments `(#:test-target "test" #:phases (modify-phases %standard-phases (add-after 'unpack 'symlink-junit.jar ;symlink-junit-jar) (lambda* (#:key inputs #:allow-other-keys) (let ((junit (assoc-ref inputs "java-junit")) (junit-version "4.12")) ; from build.xml (mkdir-p "lib") (symlink (string-append junit "/share/java/junit.jar") (string-append "lib/junit-" junit-version ".jar"))) )) (add-after 'build 'build-javadoc ;`build-javadoc) (lambda* (#:key (make-flags '()) #:allow-other-keys) (zero? (apply system* `("ant" "javadoc" ,@make-flags))))) (replace 'install ;`install-jars) (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$"))))) (add-after 'install 'install-doc ;install-javadoc) (lambda* (#:key outputs #:allow-other-keys) ; (`install-javadoc outputs ,name ,version) (let ((docs (string-append (assoc-ref outputs "doc") "/share/doc/" ,name "-" ,version "/"))) (mkdir-p docs) (copy-recursively "target/apidocs" docs) ))) ))) (native-inputs `(("java-junit" ,java-junit) ("(java-hamcrest-core" ,java-hamcrest-core))) (home-page "http://commons.apache.org/io/") (synopsis "Common useful IO related classes") (description "Commons-IO contains utility classes, stream implementations, file filters and endian classes.") (license asl2.0) )) java-commons-io --------------C8CB68C707EF31C409C08E05--