From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH 3/5] gnu: linux-libre: Use system->architecture. Date: Mon, 05 Sep 2016 10:27:51 +0200 Message-ID: <87twdupx88.fsf@gnu.org> References: <20160902160928.9458-1-david@craven.ch> <20160902160928.9458-4-david@craven.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47749) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bgpG3-00069r-S0 for guix-devel@gnu.org; Mon, 05 Sep 2016 04:28:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bgpFy-0002rg-UK for guix-devel@gnu.org; Mon, 05 Sep 2016 04:27:58 -0400 In-Reply-To: <20160902160928.9458-4-david@craven.ch> (David Craven's message of "Fri, 2 Sep 2016 18:09:26 +0200") 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: David Craven Cc: guix-devel@gnu.org David Craven skribis: > * gnu/packages/linux.scm (linux-libre): Use system->architecture. > --- > gnu/packages/linux.scm | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) > > diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm > index dc7ea78..19851d2 100644 > --- a/gnu/packages/linux.scm > +++ b/gnu/packages/linux.scm > @@ -286,7 +286,7 @@ for SYSTEM and optionally VARIANT, or #f if there is = no such configuration." > (modify-phases %standard-phases > (delete 'configure) > (replace 'build > - (lambda* (#:key system inputs #:allow-other-keys #:rest args) > + (lambda* (#:key inputs #:allow-other-keys #:rest args) > ;; Avoid introducing timestamps > (setenv "KCONFIG_NOTIMESTAMP" "1") > (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH= ")) > @@ -295,12 +295,12 @@ for SYSTEM and optionally VARIANT, or #f if there i= s no such configuration." > (system* "patch" "-p1" "--force" > "-i" (assoc-ref inputs "patch/freedo+gnu")) >=20=20 > - (let ((arch (car (string-split system #\-)))) > - (setenv "ARCH" > - (cond ((string=3D? arch "i686") "i386") > - ((string=3D? arch "mips64el") "mips") > - (else arch))) > - (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))) > + (let ((arch ,(system->linux-architecture > + (or (%current-target-system) > + (%current-system))))) > + (setenv "ARCH" arch)) Important note: (%current-target-system) returns a GNU triplet such as =E2=80=9Carm-linux-gnueabihf=E2=80=9D, whereas (%current-system) returns a = =E2=80=9Csystem type=E2=80=9D such as =E2=80=9Carmhf-linux=E2=80=9D. In practice it works here, and =E2=80=98linux-libre-headers=E2=80=99 alread= y does that, so this patch is OK (can go to master). However, we should augment the docstring of =E2=80=98system->linux-architec= ture=E2=80=99 to clarify that it accepts both a triplet and a system string. Could you do that? Thanks, Ludo=E2=80=99.