From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: [PATCH] gnu: gcj: Conditionally apply patch for armhf. Date: Tue, 29 Nov 2016 22:55:31 +0100 Message-ID: <20161129215531.21074-1-rekado@elephly.net> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57536) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cBqNP-0003mq-0a for guix-devel@gnu.org; Tue, 29 Nov 2016 16:55:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cBqNL-0005cX-Qj for guix-devel@gnu.org; Tue, 29 Nov 2016 16:55:47 -0500 Received: from sender163-mail.zoho.com ([74.201.84.163]:21328) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cBqNL-0005cC-HN for guix-devel@gnu.org; Tue, 29 Nov 2016 16:55:43 -0500 List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org * gnu/packages/gcc.scm (gcj)[source]: Inherit from "gcc" package. [native-inputs]: Conditionally add arm-patch. [arguments]: Conditionally add phase "apply-arm-patch". --- gnu/packages/gcc.scm | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index 4d93317..72e2309 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -522,9 +522,6 @@ as the 'native-search-paths' field." (package (inherit gcc) (name "gcj") (version (package-version gcc)) - (source (origin (inherit (package-source gcc)) - (patches (cons (search-patch "gcj-arm-mode.patch") - (origin-patches (package-source gcc)))))) (inputs `(("fastjar" ,fastjar) ("perl" ,perl) @@ -533,6 +530,15 @@ as the 'native-search-paths' field." ,@(package-inputs gcc))) (native-inputs `(("dejagnu" ,dejagnu) + ,@(if (string-prefix? "armhf" (or (%current-system) + (%current-target-system))) + `(("arm-patch" ,(origin + (method url-fetch) + (uri (search-patch "gcj-arm-mode.patch")) + (sha256 + (base32 + "1z15xs5yx6qinnb572swzxrn9f668sw7ga5280q3gznj1jyrynfn"))))) + '()) ,@(package-native-inputs gcc))) (native-search-paths %generic-search-paths) @@ -560,6 +566,14 @@ as the 'native-search-paths' field." ,flags)))) ((#:phases phases) `(modify-phases ,phases + ;; Conditionally add phase to apply patch + ,@(if (string-prefix? "armhf" (or (%current-system) + (%current-target-system))) + `((add-after 'unpack 'apply-arm-patch + (lambda* (#:key inputs #:allow-other-keys) + (zero? (system* "patch" "-p1" + "-i" (assoc-ref inputs "arm-patch")))))) + '()) (add-after 'unpack 'add-lib-output-to-rpath (lambda _ -- 2.10.2