guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#32624] [PATCH] gnu: perl: Add support for cross-compilation


From: Raphaël Mélotte
Subject: [bug#32624] [PATCH] gnu: perl: Add support for cross-compilation
Date: Mon, 03 Sep 2018 16:10:44 +0200
User-agent: mu4e 1.0; emacs 26.1

This patch adds support for cross-compilation for perl.
I only applied the suggestion made by Chris here:
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=31221

I tested it by running the following command, which builds perl successfully:

sudo -E ./pre-inst-env guix build --target=i686-pc-linux-gnu perl


>From 1aa61436c6c85ebfdea9aceeb3949ac97fdbe289 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rapha=C3=ABl=20M=C3=A9lotte?= <address@hidden>
Date: Mon, 3 Sep 2018 10:20:06 +0200
Subject: [PATCH] gnu: perl: Add support for cross-compilation

* gnu/packages/perl.scm (perl): use cross-libc when cross-compiling
---
 gnu/packages/perl.scm | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
index 4d70e019b..b10be9567 100644
--- a/gnu/packages/perl.scm
+++ b/gnu/packages/perl.scm
@@ -48,6 +48,7 @@
   #:use-module (guix utils) ;substitute-keyword-arguments for perl-5.26.2
   #:use-module (gnu packages base)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages cross-base)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages perl-check)
   #:use-module (gnu packages perl-web)
@@ -79,7 +80,7 @@
                        "perl-reproducible-build-date.patch"))))
     (build-system gnu-build-system)
     (arguments
-     '(#:tests? #f
+     `(#:tests? #f
        #:configure-flags
        (let ((out  (assoc-ref %outputs "out"))
              (libc (assoc-ref %build-inputs "libc")))
@@ -128,7 +129,10 @@
          (add-after 'install 'remove-extra-references
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (let* ((out     (assoc-ref outputs "out"))
-                    (libc    (assoc-ref inputs "libc"))
+                    (libc (assoc-ref inputs
+                             (if ,(%current-target-system)
+                                  "cross-libc"
+                                  "libc")))
                     (config1 (car (find-files (string-append out "/lib/perl5")
                                               "^Config_heavy\\.pl$")))
                     (config2 (find-files (string-append out "/lib/perl5")
-- 
2.11.0

-- 
Raphaël Mélotte

reply via email to

[Prev in Thread] Current Thread [Next in Thread]