From 7eaa2f24ea77cddbb4bbc2d6a6905673a36f8f99 Mon Sep 17 00:00:00 2001 From: John Doe Date: Tue, 15 Dec 2020 10:24:11 +0100 Subject: gnu: libffi: Add unreleased patch to fix float128 on powerpc64le. Fixes . * gnu/packages/patches/libffi-float128-powerpc64le.patch: Import patch file from . * gnu/packages/libffi.scm (libffi)[arguments]: Apply patch conditionally for powerpc64le-* systems in a phase. [inputs]: Add patch as input conditionally for powerpc64le-* systems. * gnu/local.mk (dist_patch_DATA): Add patch file to build system. Signed-off-by: Chris Marusich --- gnu/packages/libffi.scm | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'gnu/packages/libffi.scm') diff --git a/gnu/packages/libffi.scm b/gnu/packages/libffi.scm index d324892330..66239e0363 100644 --- a/gnu/packages/libffi.scm +++ b/gnu/packages/libffi.scm @@ -7,6 +7,7 @@ ;;; Copyright © 2017, 2019, 2020 Marius Bakke ;;; Copyright © 2018 Tobias Geerinckx-Rice ;;; Copyright © 2019 Maxim Cournoyer +;;; Copyright © 2020 John Doe ;;; ;;; This file is part of GNU Guix. ;;; @@ -57,7 +58,7 @@ (define-public libffi ;; compiler. See "ax_cc_maxopt.m4" and "ax_gcc_archflag.m4". #:configure-flags '("--enable-portable-binary" "--without-gcc-arch") - ;; TODO: Inline patch on next rebuild cycle. + ;; TODO: Inline patches on next rebuild cycle. ,@(if (string-prefix? "powerpc-" (or (%current-target-system) (%current-system))) '(#:phases (modify-phases %standard-phases @@ -67,13 +68,28 @@ (define-public libffi "powerpc-patch"))) (invoke "patch" "--batch" "-p1" "-i" patch)))))) + '()) + ,@(if (string-prefix? "powerpc64le-" (or (%current-target-system) + (%current-system))) + '(#:phases (modify-phases %standard-phases + (add-after 'unpack 'apply-patch2 + (lambda* (#:key inputs #:allow-other-keys) + (let ((patch (assoc-ref inputs + "powerpc64le-patch"))) + (invoke "patch" "--batch" "-p1" + "-i" patch)))))) '()))) (inputs - (if (string-prefix? "powerpc-" (or (%current-target-system) + (cond + ((string-prefix? "powerpc-" (or (%current-target-system) (%current-system))) - `(("powerpc-patch" ,@(search-patches - "libffi-3.3-powerpc-fixes.patch"))) - '())) + `(("powerpc-patch" ,@(search-patches + "libffi-3.3-powerpc-fixes.patch")))) + ((string-prefix? "powerpc64le-" (or (%current-target-system) + (%current-system))) + `(("powerpc64le-patch" ,@(search-patches + "libffi-float128-powerpc64le.patch")))) + (else '()))) (outputs '("out" "debug")) (synopsis "Foreign function call interface library") (description -- cgit v1.2.3