Subject: Re: [bug#28583] [PATCH 6/7] gnu: Add ruby-rubyzip.

From: Ben Woodcroft <[email-masked]>
Date: Thu, 28 Sep 2017 18:34:30 +1000

Hi,

On 25/09/17 03:17, Christopher Baines wrote:
> * gnu/packages/ruby.scm (ruby-rubyzip): New variable.
I made a few changes, and got the tests to pass - patch attached. WDYT?
ben
>From 8d7bcd94b011a326c3c42802589c7e326c5d09c1 Mon Sep 17 00:00:00 2001
From: Christopher Baines <[email-masked]>
Date: Thu, 28 Sep 2017 18:31:03 +1000
Subject: [PATCH] gnu: Add ruby-rubyzip.

* gnu/packages/ruby.scm (ruby-rubyzip): New variable.

Co-authored by Ben Woodcroft <[email-masked]>.
---
 gnu/packages/ruby.scm | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 5dde022c6..4f2ba6ea7 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -1002,6 +1002,41 @@ Ruby Gems.")
     (home-page "https://github.com/postmodern/rubygems-tasks")
     (license license:expat)))
 
+(define-public ruby-rubyzip
+  (package
+  (name "ruby-rubyzip")
+  (version "1.2.1")
+  (source
+    (origin
+      (method url-fetch)
+      (uri (rubygems-uri "rubyzip" version))
+      (sha256
+        (base32
+          "06js4gznzgh8ac2ldvmjcmg9v1vg9llm357yckkpylaj6z456zqz"))))
+  (build-system ruby-build-system)
+  (arguments
+   '(#:phases
+     (modify-phases %standard-phases
+       (add-before 'check 'patch-tests
+         (lambda* (#:key inputs #:allow-other-keys)
+           (substitute* "test/gentestfiles.rb"
+             (("/usr/bin/zip")
+              (string-append
+               (assoc-ref inputs "zip") "/bin/zip")))
+           (substitute* "test/input_stream_test.rb"
+             (("/usr/bin/env ruby") (which "ruby")))
+           #t)))))
+  (native-inputs
+   `(("bundler" ,bundler)
+     ("ruby-simplecov" ,ruby-simplecov)
+     ("zip" ,zip)
+     ("unzip" ,unzip)))
+  (synopsis "Ruby module is for reading and writing zip files")
+  (description
+    "The rubyzip module provides ways to read from and create zip files.")
+  (home-page "http://github.com/rubyzip/rubyzip")
+  (license license:bsd-2)))
+
 (define-public ruby-ffi
   (package
     (name "ruby-ffi")
-- 
2.14.1