From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:55185) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hkQRh-0005ja-5Q for guix-patches@gnu.org; Mon, 08 Jul 2019 06:00:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hkQRe-0003Nh-W4 for guix-patches@gnu.org; Mon, 08 Jul 2019 06:00:29 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:49076) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hkQRe-0003N3-H9 for guix-patches@gnu.org; Mon, 08 Jul 2019 06:00:26 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hkQRe-0004xB-Ej for guix-patches@gnu.org; Mon, 08 Jul 2019 06:00:26 -0400 Subject: [bug#36477] [PATCH 30/31] gnu: icu4c: Fix cross-compilation. Resent-Message-ID: From: Mathieu Othacehe Date: Mon, 8 Jul 2019 11:59:12 +0200 Message-Id: <20190708095913.3460-31-m.othacehe@gmail.com> In-Reply-To: <20190708095913.3460-1-m.othacehe@gmail.com> References: <20190708095913.3460-1-m.othacehe@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 36477@debbugs.gnu.org Cc: Mathieu Othacehe * 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 6e93d6aed9..4d90b31c1c 100644 --- a/gnu/packages/icu4c.scm +++ b/gnu/packages/icu4c.scm @@ -4,6 +4,7 @@ ;;; Copyright © 2016, 2017 Efraim Flashner ;;; Copyright © 2017 Clément Lassieur ;;; Copyright © 2017 Ricardo Wurmus +;;; Copyright © 2019 Mathieu Othacehe ;;; ;;; 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") -- 2.17.1