From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: Re: [PATCH] gnu: java-swt: Use other archive on 64-bit systems. Date: Mon, 09 May 2016 22:03:38 +0200 Message-ID: <87mvnzq9r9.fsf@elephly.net> References: <1462803393-7913-1-git-send-email-rekado@elephly.net> <20160509180342.GA16597@debian-netbook> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47061) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azrPK-0001Me-FN for guix-devel@gnu.org; Mon, 09 May 2016 16:04:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1azrPD-0004xU-82 for guix-devel@gnu.org; Mon, 09 May 2016 16:03:57 -0400 Received: from sender163-mail.zoho.com ([74.201.84.163]:24852) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azrPC-0004w1-SV for guix-devel@gnu.org; Mon, 09 May 2016 16:03:51 -0400 In-reply-to: <20160509180342.GA16597@debian-netbook> 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: Efraim Flashner Cc: guix-devel@gnu.org Efraim Flashner writes: >> - "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))))) > > If the catch-all is for 32-bit then you could leave out i686 and armhf. > With the values being x86 or x86_64, will it build on arm or mips? I only have a catch-all here, because I wouldn’t know what else I could do here. Practically speaking we only have Icedtea packages for i686 and x86_64 right now, so we could just handle those cases. The only difference between the different source archives is that the 32-bit version uses “int /*long*/”, whereas the other uses “/*int*/ long” in type declarations. This is important in at least one place where the size of the “int” type is used at runtime to check whether we are on a 32-bit or 64-bit system. It’s all a bit messy and since we have no way of testing this on architectures other than i686 and x86_64 I cannot say what a good default would be. Maybe it would be better to only handle the two cases we are sure of, and add others later. What do you think? ~~ Ricardo