From fa63939acba69e11df44073a7eb687bd2ba48349 Mon Sep 17 00:00:00 2001
From: Marius Bakke <mbakke@fastmail.com>
Date: Wed, 29 Mar 2017 16:15:23 +0200
Subject: [PATCH] gnu: chez-scheme: Fix build failure in
 'reset-gzip-timestamps' phase.

* gnu/packages/chez.scm (chez-scheme)[arguments]: Add 'make-manpages-writable'
phase.
---
 gnu/packages/chez.scm | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm
index 6b2b70f19e..b532057605 100644
--- a/gnu/packages/chez.scm
+++ b/gnu/packages/chez.scm
@@ -190,7 +190,15 @@
                       (symlink file (string-append (dirname file)
                                                    "/" name ".boot")))
                     (find-files lib "scheme.boot"))
-               #t))))))
+               #t)))
+         (add-before 'reset-gzip-timestamps 'make-manpages-writable
+           (lambda* (#:key outputs #:allow-other-keys)
+             (map (lambda (file)
+                    (make-file-writable file))
+                  (find-files (string-append (assoc-ref outputs "out")
+                                             "/share/man")
+                              ".*\\.gz$"))
+             #t)))))
     ;; According to the documentation MIPS is not supported.
     ;; Cross-compiling for the Raspberry Pi is supported, but not native ARM.
     (supported-systems (fold delete %supported-systems