diff mbox

[1/4] gnu: Add ruby-tzinfo-data.

Message ID 1465131653-28176-2-git-send-email-donttrustben@gmail.com
State New
Headers show

Commit Message

Ben Woodcroft June 5, 2016, 1 p.m. UTC
* gnu/packages/ruby.scm (ruby-tzinfo-data): New variable.
---
 gnu/packages/ruby.scm | 41 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

Comments

David Thompson June 5, 2016, 1:54 p.m. UTC | #1
On Sun, Jun 5, 2016 at 9:00 AM, Ben Woodcroft <donttrustben@gmail.com> wrote:
> * gnu/packages/ruby.scm (ruby-tzinfo-data): New variable.
> ---
>  gnu/packages/ruby.scm | 41 +++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 41 insertions(+)
>
> diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
> index c6b6eed..fa550cb 100644
> --- a/gnu/packages/ruby.scm
> +++ b/gnu/packages/ruby.scm
> @@ -2101,6 +2101,47 @@ aware transformations between times in different time zones.")
>      (home-page "http://tzinfo.github.io")
>      (license license:expat)))
>
> +(define-public ruby-tzinfo-data
> +  (package
> +    (name "ruby-tzinfo-data")
> +    (version "1.2016.4")
> +    (source
> +     (origin
> +       (method url-fetch)
> +       ;; Download from GitHub because the rubygems version does not contain
> +       ;; Rakefile or tests.
> +       (uri (string-append
> +             "https://github.com/tzinfo/tzinfo-data/archive/v"
> +             version
> +             ".tar.gz"))
> +       (file-name (string-append name "-" version ".tar.gz"))
> +       (sha256
> +        (base32
> +         "0jnm8i379hn48cq5n39j7wzm08i0mw73kqzx3cqbxpiwlb1hnz80"))))
> +    (build-system ruby-build-system)
> +    (arguments
> +     `(#:phases
> +       (modify-phases %standard-phases
> +         ;; Remove the known test failure.
> +         ;; https://github.com/tzinfo/tzinfo-data/issues/10
> +         ;; https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1587128
> +         (add-before 'check 'remove-broken-test
> +           (lambda _
> +             (substitute* "test/tc_definitions.rb"
> +               (("if utc && local")
> +                (string-append
> +                 "if utc && local && !line.match(/Sun Oct 25 01:59:59 2037 UT"
> +                 " = Sun Oct 25 02:59:59 2037 WEST isdst=1 gmtoff=3600/)"))
> +               #t))))))

Since this isn't a dynamic Guix-specific modification, could you
transform this into a patch file to apply to the origin record?

> +    (propagated-inputs
> +     `(("ruby-tzinfo" ,ruby-tzinfo)))
> +    (synopsis "Data from the IANA Time Zone database")
> +    (description
> +     "This library provides @code{TZInfo::Data}, which contains data from the
> +IANA Time Zone database packaged as Ruby modules for use with @code{TZInfo}.")
> +    (home-page "http://tzinfo.github.io")
> +    (license license:expat)))
> +
>  (define-public ruby-rb-inotify
>    (package
>      (name "ruby-rb-inotify")
> --
> 2.7.4

LGTM otherwise!

- Dave
diff mbox

Patch

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index c6b6eed..fa550cb 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -2101,6 +2101,47 @@  aware transformations between times in different time zones.")
     (home-page "http://tzinfo.github.io")
     (license license:expat)))
 
+(define-public ruby-tzinfo-data
+  (package
+    (name "ruby-tzinfo-data")
+    (version "1.2016.4")
+    (source
+     (origin
+       (method url-fetch)
+       ;; Download from GitHub because the rubygems version does not contain
+       ;; Rakefile or tests.
+       (uri (string-append
+             "https://github.com/tzinfo/tzinfo-data/archive/v"
+             version
+             ".tar.gz"))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32
+         "0jnm8i379hn48cq5n39j7wzm08i0mw73kqzx3cqbxpiwlb1hnz80"))))
+    (build-system ruby-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         ;; Remove the known test failure.
+         ;; https://github.com/tzinfo/tzinfo-data/issues/10
+         ;; https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1587128
+         (add-before 'check 'remove-broken-test
+           (lambda _
+             (substitute* "test/tc_definitions.rb"
+               (("if utc && local")
+                (string-append
+                 "if utc && local && !line.match(/Sun Oct 25 01:59:59 2037 UT"
+                 " = Sun Oct 25 02:59:59 2037 WEST isdst=1 gmtoff=3600/)"))
+               #t))))))
+    (propagated-inputs
+     `(("ruby-tzinfo" ,ruby-tzinfo)))
+    (synopsis "Data from the IANA Time Zone database")
+    (description
+     "This library provides @code{TZInfo::Data}, which contains data from the
+IANA Time Zone database packaged as Ruby modules for use with @code{TZInfo}.")
+    (home-page "http://tzinfo.github.io")
+    (license license:expat)))
+
 (define-public ruby-rb-inotify
   (package
     (name "ruby-rb-inotify")