From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hartmut Goebel Subject: [PATCH 01/12] guix: ant-bulild-sytem: allow specifying the source directory. Date: Fri, 9 Sep 2016 16:51:01 +0200 Message-ID: <1473432672-21007-2-git-send-email-h.goebel@crazy-compilers.com> References: <1473432672-21007-1-git-send-email-h.goebel@crazy-compilers.com> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56547) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1biN9H-00076S-5a for guix-devel@gnu.org; Fri, 09 Sep 2016 10:51:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1biN9D-0002va-1S for guix-devel@gnu.org; Fri, 09 Sep 2016 10:51:22 -0400 Received: from mail-out.m-online.net ([212.18.0.9]:50914) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1biN9C-0002vH-Mb for guix-devel@gnu.org; Fri, 09 Sep 2016 10:51:18 -0400 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 3sW0Wn3Bx4z3hjTH for ; Fri, 9 Sep 2016 16:51:17 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.68]) by mail.m-online.net (Postfix) with ESMTP id 3sW0Wn26bhzvlQ9 for ; Fri, 9 Sep 2016 16:51:17 +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 qZGffTl-w4uq for ; Fri, 9 Sep 2016 16:51:16 +0200 (CEST) Received: from hermia.goebel-consult.de (ppp-188-174-128-63.dynamic.mnet-online.de [188.174.128.63]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS for ; Fri, 9 Sep 2016 16:51:16 +0200 (CEST) Received: from thisbe.goebel-consult.de.de (hermia.goebel-consult.de [192.168.110.7]) by hermia.goebel-consult.de (Postfix) with ESMTP id 516DB60BA7 for ; Fri, 9 Sep 2016 16:51:14 +0200 (CEST) In-Reply-To: <1473432672-21007-1-git-send-email-h.goebel@crazy-compilers.com> 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 * guix/build-system/ant.scm (ant-build) Add parameter src-dir. * guix/build/ant-build-system.scm (default-build.xml): New parameter src-dir. (configure): pass src-dir on to default-build.xml. * doc/guix.texi (Build Systems): Add description. --- doc/guix.texi | 3 ++- guix/build-system/ant.scm | 2 ++ guix/build/ant-build-system.scm | 8 ++++---- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index b6ca34a..19c70ad 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -2956,7 +2956,8 @@ parameters, respectively. When the original package does not provide a suitable Ant build file, the parameter @code{#:jar-name} can be used to generate a minimal Ant build file @file{build.xml} with tasks to build the specified jar -archive. +archive. In this case the parameter @code{#:src-dir} can be used to +specify the source sub-directory, defaulting to ``src''. The parameter @code{#:build-target} can be used to specify the Ant task that should be run during the @code{build} phase. By default the diff --git a/guix/build-system/ant.scm b/guix/build-system/ant.scm index 550f92b..cd544ad 100644 --- a/guix/build-system/ant.scm +++ b/guix/build-system/ant.scm @@ -98,6 +98,7 @@ (make-flags ''()) (build-target "jar") (jar-name #f) + (src-dir "src") (phases '(@ (guix build ant-build-system) %standard-phases)) (outputs '("out")) @@ -126,6 +127,7 @@ #:test-target ,test-target #:build-target ,build-target #:jar-name ,jar-name + #:src-dir ,src-dir #:phases ,phases #:outputs %outputs #:search-paths ',(map search-path-specification->sexp diff --git a/guix/build/ant-build-system.scm b/guix/build/ant-build-system.scm index 2cc6bb9..651150d 100644 --- a/guix/build/ant-build-system.scm +++ b/guix/build/ant-build-system.scm @@ -35,7 +35,7 @@ ;; ;; Code: -(define (default-build.xml jar-name prefix) +(define (default-build.xml src-dir jar-name prefix) "Create a simple build.xml with standard targets for Ant." (call-with-output-file "build.xml" (lambda (port) @@ -59,7 +59,7 @@ (target (@ (name "compile")) (mkdir (@ (dir "${classes.dir}"))) (javac (@ (includeantruntime "false") - (srcdir "src") + (srcdir ,src-dir) (destdir "${classes.dir}") (classpath (@ (refid "classpath")))))) @@ -100,9 +100,9 @@ to the default GNU unpack strategy." ((assq-ref gnu:%standard-phases 'unpack) #:source source))) (define* (configure #:key inputs outputs (jar-name #f) - #:allow-other-keys) + (src-dir "src") #:allow-other-keys) (when jar-name - (default-build.xml jar-name + (default-build.xml src-dir jar-name (string-append (assoc-ref outputs "out") "/share/java"))) (setenv "JAVA_HOME" (assoc-ref inputs "jdk")) -- 2.7.4