guix-commits
[Top][All Lists]
Advanced

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

30/31: gnu: icu4c: Fix cross-compilation.


From: guix-commits
Subject: 30/31: gnu: icu4c: Fix cross-compilation.
Date: Mon, 8 Jul 2019 05:43:43 -0400 (EDT)

mothacehe pushed a commit to branch wip-cross-system
in repository guix.

commit 1d0886927641cf03a638687bfad6c102637afc82
Author: Mathieu Othacehe <address@hidden>
Date:   Fri Jul 5 17:10:31 2019 +0200

    gnu: icu4c: Fix cross-compilation.
    
    * gnu/packages/icu4c.scm (icu4c-build-root): New variable.
    (icu4c)[native-inputs]: Add it.
    [arguments]: Pass it as a configure-flag.
---
 gnu/packages/icu4c.scm | 33 ++++++++++++++++++++++++++++++++-
 1 file changed, 32 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/icu4c.scm b/gnu/packages/icu4c.scm
index 6e93d6a..4d90b31 100644
--- a/gnu/packages/icu4c.scm
+++ b/gnu/packages/icu4c.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2016, 2017 Efraim Flashner <address@hidden>
 ;;; Copyright © 2017 Clément Lassieur <address@hidden>
 ;;; Copyright © 2017 Ricardo Wurmus <address@hidden>
+;;; Copyright © 2019 Mathieu Othacehe <address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -25,6 +26,7 @@
   #:use-module (gnu packages perl)
   #:use-module (guix licenses)
   #:use-module (guix packages)
+  #:use-module (guix utils)
   #:use-module (guix download)
   #:use-module (guix build-system ant)
   #:use-module (guix build-system gnu))
@@ -44,11 +46,21 @@
             (sha256
              (base32 "17fbk0lm2clsxbmjzvyp245ayx0n4chji3ky1f3fbz2ljjv91i05"))))
    (build-system gnu-build-system)
+   ;; When cross-compiling, this package needs a source directory of a
+   ;; native-build of itself.
+   (native-inputs (if (%current-target-system)
+                      `(("icu4c-build-root" ,icu4c-build-root))
+                      '()))
    (inputs
     `(("perl" ,perl)))
    (arguments
     `(#:configure-flags
-      '("--enable-rpath"
+      (list
+       "--enable-rpath"
+        ,@(if (%current-target-system)
+              '((string-append "--with-cross-build="
+                                (assoc-ref %build-inputs "icu4c-build-root")))
+              '())
         ,@(if (let ((s (or (%current-target-system)
                            (%current-system))))
                 (or (string-prefix? "arm" s)
@@ -81,6 +93,25 @@ C/C++ part.")
    (license x11)
    (home-page "http://site.icu-project.org/";)))
 
+(define-public icu4c-build-root
+  (package
+    (inherit icu4c)
+    (name "icu4c-build-root")
+    (arguments
+     (substitute-keyword-arguments (package-arguments icu4c)
+       ((#:tests? _ '())
+        #f)
+       ((#:out-of-source? _ '())
+        #t)
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (replace 'install
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let ((out (assoc-ref outputs "out")))
+                 (copy-recursively "../build" out)
+                 #t)))))))
+    (native-inputs '())))
+
 (define-public java-icu4j
   (package
     (name "java-icu4j")



reply via email to

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