Patchwork [2/2] gnu: tzdata: Use modify-phases

login
register
mail settings
Submitter John Darrington
Date Oct. 6, 2016, 6:18 p.m.
Message ID <1475777887-6628-2-git-send-email-jmd@gnu.org>
Download mbox | patch
Permalink /patch/16313/
State New
Headers show

Comments

John Darrington - Oct. 6, 2016, 6:18 p.m.
* gnu/packages/base.scm (tzdata)[arguments]: Replace alist- procedures
with modify-phases
---
 gnu/packages/base.scm | 35 ++++++++++++++++++-----------------
 1 file changed, 18 insertions(+), 17 deletions(-)
Ludovic Courtès - Oct. 6, 2016, 7:36 p.m.
John Darrington <jmd@gnu.org> skribis:

> * gnu/packages/base.scm (tzdata)[arguments]: Replace alist- procedures
> with modify-phases

OK for core-updates!
Leo Famulari - Oct. 6, 2016, 9:46 p.m.
On Thu, Oct 06, 2016 at 09:36:37PM +0200, Ludovic Courtès wrote:
> John Darrington <jmd@gnu.org> skribis:
> 
> > * gnu/packages/base.scm (tzdata)[arguments]: Replace alist- procedures
> > with modify-phases
> 
> OK for core-updates!

I took the opportunity to update tzdata to the latest release, 2016g.

Patch

diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 52d8de3..0760c11 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -936,23 +936,24 @@  command.")
                   (guix build gnu-build-system)
                   (srfi srfi-1))
        #:phases
-       (alist-replace
-        'unpack
-        (lambda* (#:key source inputs #:allow-other-keys)
-          (and (zero? (system* "tar" "xvf" source))
-               (zero? (system* "tar" "xvf" (assoc-ref inputs "tzcode")))))
-        (alist-cons-after
-         'install 'post-install
-         (lambda* (#:key outputs #:allow-other-keys)
-           ;; Move data in the right place.
-           (let ((out (assoc-ref outputs "out")))
-             (symlink (string-append out "/share/zoneinfo")
-                      (string-append out "/share/zoneinfo/posix"))
-             (delete-file-recursively (string-append out "/share/zoneinfo-posix"))
-             (copy-recursively (string-append out "/share/zoneinfo-leaps")
-                               (string-append out "/share/zoneinfo/right"))
-             (delete-file-recursively (string-append out "/share/zoneinfo-leaps"))))
-         (alist-delete 'configure %standard-phases)))))
+       (modify-phases %standard-phases
+         (replace 'unpack
+           (lambda* (#:key source inputs #:allow-other-keys)
+             (and (zero? (system* "tar" "xvf" source))
+                  (zero? (system* "tar" "xvf" (assoc-ref inputs "tzcode"))))))
+         (add-after 'install 'post-install
+           (lambda* (#:key outputs #:allow-other-keys)
+             ;; Move data in the right place.
+             (let ((out (assoc-ref outputs "out")))
+               (symlink (string-append out "/share/zoneinfo")
+                        (string-append out "/share/zoneinfo/posix"))
+               (delete-file-recursively
+                (string-append out "/share/zoneinfo-posix"))
+               (copy-recursively (string-append out "/share/zoneinfo-leaps")
+                                 (string-append out "/share/zoneinfo/right"))
+               (delete-file-recursively
+                (string-append out "/share/zoneinfo-leaps")))))
+         (delete 'configure))))
     (inputs `(("tzcode" ,(origin
                           (method url-fetch)
                           (uri (string-append