unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#32624] [PATCH] gnu: perl: Add support for cross-compilation
@ 2018-09-03 14:10 Raphaël Mélotte
  2018-09-03 21:48 ` Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: Raphaël Mélotte @ 2018-09-03 14:10 UTC (permalink / raw)
  To: 32624

[-- Attachment #1: Type: text/plain, Size: 306 bytes --]

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



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-perl-Add-support-for-cross-compilation.patch --]
[-- Type: text/x-diff, Size: 1887 bytes --]

From 1aa61436c6c85ebfdea9aceeb3949ac97fdbe289 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rapha=C3=ABl=20M=C3=A9lotte?= <raphael.melotte@posteo.net>
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


[-- Attachment #3: Type: text/plain, Size: 26 bytes --]


-- 
Raphaël Mélotte

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-09-07 14:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-03 14:10 [bug#32624] [PATCH] gnu: perl: Add support for cross-compilation Raphaël Mélotte
2018-09-03 21:48 ` Ludovic Courtès
2018-09-04 10:13   ` Raphaël Mélotte
2018-09-05  9:57     ` Ludovic Courtès
2018-09-07 12:58       ` Raphaël Mélotte
2018-09-07 14:17         ` bug#32624: " Raphaël Mélotte

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).