From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: [PATCH] gnu: java-swt: Use other archive on 64-bit systems. Date: Mon, 9 May 2016 16:16:33 +0200 Message-ID: <1462803393-7913-1-git-send-email-rekado@elephly.net> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38026) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azlzP-0005SG-62 for guix-devel@gnu.org; Mon, 09 May 2016 10:16:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1azlzL-00064w-Sb for guix-devel@gnu.org; Mon, 09 May 2016 10:16:51 -0400 Received: from sender163-mail.zoho.com ([74.201.84.163]:24917) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azlzL-00064C-JR for guix-devel@gnu.org; Mon, 09 May 2016 10:16:47 -0400 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/java.scm (java-swt)[source]: Use separate source archive for 64-bit systems. --- gnu/packages/java.scm | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index 45e5683..d2a93bc 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -51,21 +51,38 @@ #:use-module (gnu packages xorg) #:use-module (gnu packages zip) #:use-module (gnu packages texinfo) - #:use-module ((srfi srfi-1) #:select (fold alist-delete))) + #:use-module ((srfi srfi-1) #:select (fold alist-delete)) + #:use-module (srfi srfi-11) + #:use-module (ice-9 match)) (define-public java-swt (package (name "java-swt") (version "4.5") - (source (origin - (method url-fetch) - (uri (string-append - "http://ftp-stud.fht-esslingen.de/pub/Mirrors/" - "eclipse/eclipse/downloads/drops4/R-" version - "-201506032000/swt-" version "-gtk-linux-x86.zip")) - (sha256 - (base32 - "03mhzraikcs4fsz7d3h5af9pw1bbcfd6dglsvbk2ciwimy9zj30q")))) + (source + ;; The types of many variables and procedures differ in the sources + ;; dependent on whether the target architecture is a 32-bit system or a + ;; 64-bit system. Instead of patching the sources on demand in a build + ;; phase we download either the 32-bit archive (which mostly uses "int" + ;; types) or the 64-bit archive (which mostly uses "long" types). + (let ((hash32 "03mhzraikcs4fsz7d3h5af9pw1bbcfd6dglsvbk2ciwimy9zj30q") + (hash64 "1qq0pjll6030v4ml0hifcaaik7sx3fl7ghybfdw95vsvxafwp2ff") + (file32 "x86") + (file64 "x86_64")) + (let-values (((hash file) + (match (or (%current-target-system) (%current-system)) + ("i686-linux" (values hash32 file32)) + ("x86_64-linux" (values hash64 file64)) + ("armhf-linux" (values hash32 file32)) + ("mips64el-linux" (values hash64 file64)) + (_ (values hash32 file32))))) + (origin + (method url-fetch) + (uri (string-append + "http://ftp-stud.fht-esslingen.de/pub/Mirrors/" + "eclipse/eclipse/downloads/drops4/R-" version + "-201506032000/swt-" version "-gtk-linux-" file ".zip")) + (sha256 (base32 hash)))))) (build-system ant-build-system) (arguments `(#:jar-name "swt.jar" -- 2.7.3