summary refs log tree commit diff
path: root/gnu/packages/perl.scm
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-04-19 11:39:38 +0100
committerChristopher Baines <mail@cbaines.net>2019-04-19 11:42:30 +0100
commit35259437a7b13f8573f407c39e8c2c0308123a37 (patch)
tree139a909dc7d8a3d054b53465dd77f53fddd1fb6b /gnu/packages/perl.scm
parentf32164abd3d9c307959cf60393cdc9027b8703ca (diff)
downloadguix-35259437a7b13f8573f407c39e8c2c0308123a37.tar.gz
gnu: perl-datetime-timezone: Fix missing timezone data.
I noticed this when using Sqitch, on systems without /usr/share/zoneinfo,
actions like deploy fail.

* gnu/packages/perl.scm (perl-datetime-timezone)[arguments]: Add 'patch-tzdata
phase to replace /usr/share/zoneinfo with a reference to the tzdata package.
[inputs]: Add the tzdata package.
Diffstat (limited to 'gnu/packages/perl.scm')
-rw-r--r--gnu/packages/perl.scm13
1 files changed, 13 insertions, 0 deletions
diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
index 86d07c3ccc..cde75bc06e 100644
--- a/gnu/packages/perl.scm
+++ b/gnu/packages/perl.scm
@@ -2541,9 +2541,22 @@ the DateTime.pm class.")
         (base32
          "0kz5kz47awf2bhb85xx5rbajkr093ipm2d2vkhqs8lqq0f305r3a"))))
     (build-system perl-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-tzdata
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "lib/DateTime/TimeZone/Local/Unix.pm"
+               (("our \\$ZoneinfoDir = '\\/usr\\/share\\/zoneinfo';")
+                (string-append "our $ZoneinfoDir = '"
+                               (assoc-ref inputs "tzdata") "/share/zoneinfo"
+                               "';")))
+             #t)))))
     (native-inputs
      `(("perl-test-fatal" ,perl-test-fatal)
        ("perl-test-requires" ,perl-test-requires)))
+    (inputs
+     `(("tzdata" ,tzdata)))
     (propagated-inputs
      `(("perl-class-singleton" ,perl-class-singleton)
        ("perl-list-allutils" ,perl-list-allutils)