unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eric Bavier <bavier@member.fsf.org>
To: guix-devel@gnu.org
Subject: [PATCH] packages: Add zip archive support to 'patch-and-repack'.
Date: Tue, 24 Mar 2015 10:56:52 -0500	[thread overview]
Message-ID: <1427212612-24293-1-git-send-email-bavier@member.fsf.org> (raw)

* guix/packages.scm (%standard-patch-inputs): Add "unzip".
  (patch-and-repack)[decompression-type]: Detect zip archive.
  [build]: Invoke "unzip" when appropriate.
---
 guix/packages.scm |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/guix/packages.scm b/guix/packages.scm
index ca9d3a9..03adf89 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -335,6 +335,7 @@ corresponds to the arguments expected by `set-path-environment-variable'."
       ("bzip2" ,(ref '(gnu packages compression) 'bzip2))
       ("gzip"  ,(ref '(gnu packages compression) 'gzip))
       ("lzip"  ,(ref '(gnu packages compression) 'lzip))
+      ("unzip" ,(ref '(gnu packages zip) 'unzip))
       ("patch" ,(ref '(gnu packages base) 'patch))
       ("locales" ,(ref '(gnu packages commencement)
                        'glibc-utf8-locales-final)))))
@@ -384,6 +385,7 @@ IMPORTED-MODULES specify modules to use/import for use by SNIPPET."
     (cond ((string-suffix? "gz" source-file-name)  "gzip")
           ((string-suffix? "bz2" source-file-name) "bzip2")
           ((string-suffix? "lz" source-file-name)  "lzip")
+          ((string-suffix? "zip" source-file-name) "unzip")
           (else "xz")))
 
   (define original-file-name
@@ -464,8 +466,10 @@ IMPORTED-MODULES specify modules to use/import for use by SNIPPET."
                      (mkdir directory)
                      (copy-recursively #$source directory)
                      #t)
-                   (zero? (system* (string-append #$tar "/bin/tar")
-                                   "xvf" #$source)))
+                   #$@(if (string=? decompression-type "unzip")
+                          #~((zero? (system* "unzip" #$source)))
+                          #~((zero? (system* (string-append #$tar "/bin/tar")
+                                             "xvf" #$source)))))
                (let ((directory (first-file ".")))
                  (format (current-error-port)
                          "source is under '~a'~%" directory)
-- 
1.7.9.5

             reply	other threads:[~2015-03-24 15:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-24 15:56 Eric Bavier [this message]
2015-03-24 20:50 ` [PATCH] packages: Add zip archive support to 'patch-and-repack' Ludovic Courtès
2015-03-25 13:03   ` Mark H Weaver
2015-03-25 15:06     ` Eric Bavier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1427212612-24293-1-git-send-email-bavier@member.fsf.org \
    --to=bavier@member.fsf.org \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).