unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] ant-build-system: Add unpack phase.
@ 2016-05-19  8:24 Ricardo Wurmus
  2016-05-20 11:44 ` Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: Ricardo Wurmus @ 2016-05-19  8:24 UTC (permalink / raw)
  To: guix-devel

From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>

* guix/build/ant-build-system.scm (unpack): New procedure.
(%standard-phases): Use it.
---
 guix/build/ant-build-system.scm | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/guix/build/ant-build-system.scm b/guix/build/ant-build-system.scm
index 27277af..6dc19ff 100644
--- a/guix/build/ant-build-system.scm
+++ b/guix/build/ant-build-system.scm
@@ -86,6 +86,17 @@ INPUTS."
                          (find-files dir "\\.*jar$")))
                       inputs)) ":"))
 
+(define* (unpack #:key source #:allow-other-keys)
+  "Unpack the jar archive SOURCE.  When SOURCE is not a jar archive fall back
+to the default GNU unpack strategy."
+  (if (string-suffix? ".jar" source)
+      (begin
+        (mkdir "src")
+        (with-directory-excursion "src"
+          (zero? (system* "jar" "-xf" source))))
+      ;; Use GNU unpack strategy for things that aren't jar archives.
+      ((assq-ref gnu:%standard-phases 'unpack) #:source source)))
+
 (define* (configure #:key inputs outputs (jar-name #f)
                     #:allow-other-keys)
   (when jar-name
@@ -151,6 +162,7 @@ repack them.  This is necessary to ensure that archives are reproducible."
 
 (define %standard-phases
   (modify-phases gnu:%standard-phases
+    (replace 'unpack unpack)
     (replace 'configure configure)
     (replace 'build build)
     (replace 'check check)
-- 
2.7.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ant-build-system: Add unpack phase.
  2016-05-19  8:24 [PATCH] ant-build-system: Add unpack phase Ricardo Wurmus
@ 2016-05-20 11:44 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2016-05-20 11:44 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

Ricardo Wurmus <rekado@elephly.net> skribis:

> From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
>
> * guix/build/ant-build-system.scm (unpack): New procedure.
> (%standard-phases): Use it.

LGTM!

Ludo'.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-05-20 11:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-19  8:24 [PATCH] ant-build-system: Add unpack phase Ricardo Wurmus
2016-05-20 11:44 ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).