unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] packages: Add zip archive support to 'patch-and-repack'.
@ 2015-03-24 15:56 Eric Bavier
  2015-03-24 20:50 ` Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Bavier @ 2015-03-24 15:56 UTC (permalink / raw)
  To: guix-devel

* 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

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

* Re: [PATCH] packages: Add zip archive support to 'patch-and-repack'.
  2015-03-24 15:56 [PATCH] packages: Add zip archive support to 'patch-and-repack' Eric Bavier
@ 2015-03-24 20:50 ` Ludovic Courtès
  2015-03-25 13:03   ` Mark H Weaver
  0 siblings, 1 reply; 4+ messages in thread
From: Ludovic Courtès @ 2015-03-24 20:50 UTC (permalink / raw)
  To: Eric Bavier; +Cc: guix-devel

Eric Bavier <bavier@member.fsf.org> skribis:

> * guix/packages.scm (%standard-patch-inputs): Add "unzip".
>   (patch-and-repack)[decompression-type]: Detect zip archive.
>   [build]: Invoke "unzip" when appropriate.

Please add “Fixes <http://bugs.gnu.org/19830>.” right above, and email
19830-close@debbugs.gnu.org with the commit id afterwards.

> -                   (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)))))

Simply:

  #$(if (string=? decompression-type "unzip")
        #~(zero? (system* "unzip" #$source))
        #~(zero? (system* (string-append #$tar "/bin/tar") ...)))

OK to push with these changes!

Thank you,
Ludo’.

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

* Re: [PATCH] packages: Add zip archive support to 'patch-and-repack'.
  2015-03-24 20:50 ` Ludovic Courtès
@ 2015-03-25 13:03   ` Mark H Weaver
  2015-03-25 15:06     ` Eric Bavier
  0 siblings, 1 reply; 4+ messages in thread
From: Mark H Weaver @ 2015-03-25 13:03 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

ludo@gnu.org (Ludovic Courtès) writes:

> Eric Bavier <bavier@member.fsf.org> skribis:
>
>> * guix/packages.scm (%standard-patch-inputs): Add "unzip".
>>   (patch-and-repack)[decompression-type]: Detect zip archive.
>>   [build]: Invoke "unzip" when appropriate.
>
> Please add “Fixes <http://bugs.gnu.org/19830>.” right above, and email
> 19830-close@debbugs.gnu.org with the commit id afterwards.
>
>> -                   (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)))))
>
> Simply:
>
>   #$(if (string=? decompression-type "unzip")
>         #~(zero? (system* "unzip" #$source))
>         #~(zero? (system* (string-append #$tar "/bin/tar") ...)))
>
> OK to push with these changes!

This is for core-updates, right?

       Mark

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

* Re: [PATCH] packages: Add zip archive support to 'patch-and-repack'.
  2015-03-25 13:03   ` Mark H Weaver
@ 2015-03-25 15:06     ` Eric Bavier
  0 siblings, 0 replies; 4+ messages in thread
From: Eric Bavier @ 2015-03-25 15:06 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: guix-devel

On 2015-03-25 08:03, Mark H Weaver wrote:
> ludo@gnu.org (Ludovic Courtès) writes:
> 
>> Eric Bavier <bavier@member.fsf.org> skribis:
>> 
>>> * guix/packages.scm (%standard-patch-inputs): Add "unzip".
>>>   (patch-and-repack)[decompression-type]: Detect zip archive.
>>>   [build]: Invoke "unzip" when appropriate.
[...]
>> 
>> OK to push with these changes!
> 
> This is for core-updates, right?

Yes, I pushed it on core-updates.  Mostly because it uses the 
gexp-rewrite that Ludo did on core-updates.

`~Eric

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

end of thread, other threads:[~2015-03-25 15:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-24 15:56 [PATCH] packages: Add zip archive support to 'patch-and-repack' Eric Bavier
2015-03-24 20:50 ` Ludovic Courtès
2015-03-25 13:03   ` Mark H Weaver
2015-03-25 15:06     ` Eric Bavier

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).