From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Bavier Subject: [PATCH] packages: Add zip archive support to 'patch-and-repack'. Date: Tue, 24 Mar 2015 10:56:52 -0500 Message-ID: <1427212612-24293-1-git-send-email-bavier@member.fsf.org> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57857) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YaRBa-0005ds-JH for guix-devel@gnu.org; Tue, 24 Mar 2015 11:56:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YaRBU-0001mL-U7 for guix-devel@gnu.org; Tue, 24 Mar 2015 11:56:10 -0400 Received: from mail.openmailbox.org ([62.4.1.34]:37867) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YaRBU-0001m6-O8 for guix-devel@gnu.org; Tue, 24 Mar 2015 11:56:04 -0400 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-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel@gnu.org * 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