Subject: [PATCH v3 05/48] gnu: libpaper: Fix aarch64 cross-compilation.

From: Mathieu Othacehe <[email-masked]>
Date: Mon, 2 Sep 2019 17:32:50 +0200

The packaged config.sub and config.guess do not have aarch64 support. Replace
them by the ones from automake.

* gnu/packages/ghostscript.scm (libpaper)[arguments]: Replace outdated config.sub and
config.guess, taken from ...
[native-inputs]: ... here, by adding automake.
---
 gnu/packages/ghostscript.scm | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/gnu/packages/ghostscript.scm b/gnu/packages/ghostscript.scm
index 817104cde1..e6879eada9 100644
--- a/gnu/packages/ghostscript.scm
+++ b/gnu/packages/ghostscript.scm
@@ -8,6 +8,7 @@
 ;;; Copyright © 2017 Leo Famulari <[email-masked]>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <[email-masked]>
 ;;; Copyright © 2018 Marius Bakke <[email-masked]>
+;;; Copyright © 2019 Mathieu Othacehe <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -84,6 +85,24 @@ Consortium standard (ICC), approved as ISO 15076-1.")
             (sha256 (base32
                      "0zhcx67afb6b5r936w5jmaydj3ks8zh83n9rm5sv3m3k8q8jib1q"))))
    (build-system gnu-build-system)
+   (native-inputs
+    `(("automake" ,automake))) ; For up to date 'config.guess' and 'config.sub'.
+   (arguments
+    `(#:phases
+      (modify-phases %standard-phases
+        (add-after 'unpack 'fix-configure
+          (lambda* (#:key inputs native-inputs #:allow-other-keys)
+            ;; Replace outdated config.sub and config.guess:
+            (for-each (lambda (file)
+                        (install-file
+                         (string-append (assoc-ref
+                                         (or native-inputs inputs) "automake")
+                                        "/share/automake-"
+                                        ,(version-major+minor
+                                          (package-version automake))
+                                        "/" file) "."))
+                      '("config.sub" "config.guess"))
+            #t)))))
    (synopsis "Library for handling paper sizes")
    (description
     "The paper library and accompanying files are intended to provide a simple
-- 
2.20.1