From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id WHuOOYN/qmWaewAAe85BDQ:P1 (envelope-from ) for ; Fri, 19 Jan 2024 14:56:20 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id WHuOOYN/qmWaewAAe85BDQ (envelope-from ) for ; Fri, 19 Jan 2024 14:56:20 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=foundationdevices.com header.s=google header.b=A5f5fkE2; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1705672579; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=at124O61Kdi5F8ekMPWejJ1/EkTdIOq5CCKZdSQOvxQ=; b=B5jWJZ2L1E2KLWTi99tw/W+ksF9aHYuJVhCEzO1Lw9uiqWRM+k36MbBOAELYGdz9X1qzXS MXCvxJ6ZaQ45ul3nghiX0l1A0L83C5F8/wQfhmKAjTKsT3vklGcsyZxm+YUQ2hLK4K+UNK pgW0s5j94yyI/eeqVUNzKWFbtIxIG3g1Ufabbnr7y7VtcIzvfObv9gSXzee48P8WgbsleJ O971akwt8+BPypSNpivfJ5muhtfWP34q9s1O5mfo4QWa7SWmjmHESxw0YUcCGOxY/6mcix PPQpbLCTfCzov99nqltKAnlF/uh7syp9cO4cPZ6Tt+Rx+5R5RCliaFTUdnI/ew== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1705672579; a=rsa-sha256; cv=none; b=uuQYpasSNdjZPkH3AYVcU8fWLJBgp4wBUpCJjDQDVux5JSDcpBA27izPW96PDc+Wv5zqgt HJsrT5OTrkSqVAETYgjsllFsXwwbaL24JjyY0SHOspx5wcMLWqH5Yz5WHJarb8QcgrB08m YovXJaYJz/wjsVZs2/H+aSJ0GkCxTukFZLKFWUPuovyYDBXTW3mKyfAIeUN63fOlb7aTRT 1u0Vbutdi8ddUwLod1vSKwTV1wGkpI272Fu0oFti4HrYValiKpGvJhmVJbhL6X/7jIh7HS EX9U1EFRpo8/CeTFKrDFkxz8jQP/80Wr3qdAcFMzx/rE+3VU4ZI/qVaOR159lA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=foundationdevices.com header.s=google header.b=A5f5fkE2; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 7F2758921 for ; Fri, 19 Jan 2024 14:56:19 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rQpLt-0003Sp-Jr; Fri, 19 Jan 2024 08:56:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rQpLm-0003RG-Cs for guix-patches@gnu.org; Fri, 19 Jan 2024 08:56:02 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rQpLm-0007xD-1M for guix-patches@gnu.org; Fri, 19 Jan 2024 08:56:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rQpLn-0001w5-Ug; Fri, 19 Jan 2024 08:56:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68355] [PATCH v2 5/9] gnu: make-crust-package: Memoize. Resent-From: Jean-Pierre De Jesus DIAZ Original-Sender: "Debbugs-submit" Resent-CC: efraim@flashner.co.il, vagrant@debian.org, guix-patches@gnu.org Resent-Date: Fri, 19 Jan 2024 13:56:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68355 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 68355@debbugs.gnu.org Cc: othacehe@gnu.org, Jean-Pierre De Jesus DIAZ , Efraim Flashner , Vagrant Cascadian X-Debbugs-Original-Xcc: Efraim Flashner , Vagrant Cascadian Received: via spool by 68355-submit@debbugs.gnu.org id=B68355.17056725347330 (code B ref 68355); Fri, 19 Jan 2024 13:56:03 +0000 Received: (at 68355) by debbugs.gnu.org; 19 Jan 2024 13:55:34 +0000 Received: from localhost ([127.0.0.1]:57874 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rQpLJ-0001u7-2q for submit@debbugs.gnu.org; Fri, 19 Jan 2024 08:55:34 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:45179) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rQpLF-0001tV-44 for 68355@debbugs.gnu.org; Fri, 19 Jan 2024 08:55:29 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-40e86a9fc4bso9889045e9.2 for <68355@debbugs.gnu.org>; Fri, 19 Jan 2024 05:55:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foundationdevices.com; s=google; t=1705672521; x=1706277321; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=at124O61Kdi5F8ekMPWejJ1/EkTdIOq5CCKZdSQOvxQ=; b=A5f5fkE2LA2rCqkkmacZ1d5iPdoLu5gR3Fvwzkdatgmbv04UVPwF9uXBaGkC/7SaqZ Ryj+QflallzxAQzMPQKYKrAx47oImO5kiAnJHHsshXl8eo52XGR1vzJYmITu5sWssfB8 DSqwaK/rZVKFo6e+oTcSl7wgEReA+npnEOaQ7zgVtyExtky1janAJfO5IAglFwJ0TNTq kpy7EpgnWTpOhhp6G7Mj+lEc7oPxdmwkWd7NusgYnkJVvHguE6PMxkKn5MPuNdcDgTtb kjs3yu8KA3TfmS/C/4ZPU7N8RhjIcWjEh6p8VFULfGnS5o1Yip4vkTcGrrbyrLNrBoEs pgHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705672521; x=1706277321; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=at124O61Kdi5F8ekMPWejJ1/EkTdIOq5CCKZdSQOvxQ=; b=Xc42Flw+t1U81d4p49BBo3ctQoXaPQr923V5rDUsgU4D4LCX1FEtqTI4TSkEs6NVSp geMIyrmlC0TvpH35a7fo2OonP9kjFUNiI2kISsze2EPgWiQrFNww16yrB5TKDuBwUbuW n+sMxxbf5li8bsgqKK0sFDBpdNUeGearmJyLyIUrOrtLHgMFDi0izWbcS5YAGZzpqbon t7+yPf5rgYIW1cAgIr1f7BGdGbOXQjr+Prt0fXF7cUkRZImSVMDijWH+7+FVn9lKfIRP Yy5pEQYX8YRMT1TkG02LKCzP/NeFo2JaYT7aVuRX0Fj1Tj9+aPHTOb3Tv9uC7E7auV7L 2hpg== X-Gm-Message-State: AOJu0YymCRmiArTRpILHiCdiMmzVxbc5sPNJbe61w37kcx+50wg67Zs0 tLK10liF+sx5/5H6tzWBvAO4g2RVTu0mgjj5in+uAXgQygZKlTrWcKfp5JaabGsi9HmZ6yDHJ4a /xkk= X-Google-Smtp-Source: AGHT+IHfwAnt2O4j4KD99V7tHEaSMYrBImk45Tgfi4efN2SMn6lCXvoPfEjnEGYBsTSinLY4vp8ehw== X-Received: by 2002:a05:600c:4686:b0:40e:52d8:c0c8 with SMTP id p6-20020a05600c468600b0040e52d8c0c8mr1503110wmo.129.1705672521001; Fri, 19 Jan 2024 05:55:21 -0800 (PST) Received: from jeandudey.home ([89.131.29.87]) by smtp.gmail.com with ESMTPSA id s8-20020a05600c45c800b0040e527602c8sm33314846wmo.9.2024.01.19.05.55.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 05:55:20 -0800 (PST) Date: Fri, 19 Jan 2024 14:54:44 +0100 Message-ID: <43f09e1afdcc3cb1dbaf44fb7e6cdea24c41bd1d.1705672190.git.jean@foundationdevices.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <4e6b129a26d38305073c392c04707498a2ddfe69.1705672190.git.jean@foundationdevices.com> References: <4e6b129a26d38305073c392c04707498a2ddfe69.1705672190.git.jean@foundationdevices.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Jean-Pierre De Jesus DIAZ X-ACL-Warn: , Jean-Pierre De Jesus DIAZ via Guix-patches From: Jean-Pierre De Jesus DIAZ via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -6.69 X-Spam-Score: -6.69 X-Migadu-Queue-Id: 7F2758921 X-TUID: hnBKK7XW1Myv * gnu/packages/firmware.scm (make-crust-package): Use mlambda. Change-Id: I2d916b96bc650f3731a69505e086cf8f8f470809 --- gnu/packages/firmware.scm | 155 +++++++++++++++++++------------------- 1 file changed, 78 insertions(+), 77 deletions(-) diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm index 533cbca550..eb5251de5e 100644 --- a/gnu/packages/firmware.scm +++ b/gnu/packages/firmware.scm @@ -1197,81 +1197,82 @@ (define-public arm-trusted-firmware-imx8mq ;; Adding debug symbols causes the size to exceed limits. #~(delete "DEBUG=1" #$flags))))))) -(define (make-crust-package platform) - (package - (name (string-append "crust-" - (string-replace-substring platform "_" "-"))) - (version "0.5") - (source - (origin - (method git-fetch) - (uri (git-reference - ;; There are only GitHub generated release snapshots. - (url "https://github.com/crust-firmware/crust") - (commit (string-append "v" version)))) - (file-name (git-file-name "crust" version)) - (sha256 - (base32 - "0xgbbhifg3miwd3yp6jq9kp7nqgz5gzy00w95vba45j8jk5vjvvz")))) - (build-system gnu-build-system) - (arguments - (list - #:tests? #f ;no test suite - #:make-flags - (let ((triplet-without-vendor - (and (%current-target-system) - ;; TODO: Is there a use case for allowing this? - (not (target-avr?)) - (match (string-split (nix-system->gnu-triplet - (%current-target-system)) #\-) - ((arch vendor os ..1) - (string-join `(,arch ,@os) "-")))))) - #~(list "CROSS_COMPILE=or1k-elf-" - "V=1" - #$@(if triplet-without-vendor - ;; We are cross-compiling the tools, intended to be - ;; executable for the target system. - (list (string-append "HOSTAR=" triplet-without-vendor - "-ar") - (string-append "HOSTCC=" triplet-without-vendor - "-gcc")) - ;; Not cross-compiling. - (list "HOSTAR=ar" - "HOSTCC=gcc")) - "LEX=flex")) - #:phases - #~(modify-phases %standard-phases - (add-after 'unpack 'do-not-build-tests - (lambda _ - ;; Attempting to build the tools test binary on a non-aarch64 - ;; architecture fails with: "No cache cleaning implementation - ;; available for this architecture". Avoid building it (see: - ;; https://github.com/crust-firmware/crust/issues/182). - (substitute* "tools/Makefile" - (("tools-y \\+= test") "")))) - (delete 'configure) - (add-before 'build 'defconfig - (lambda* (#:key make-flags #:allow-other-keys) - (let ((config-name (string-append #$platform "_defconfig"))) - (apply invoke "make" (cons config-name make-flags))))) - (replace 'install - (lambda _ - (for-each (lambda (file) - (install-file file (string-append #$output - "/libexec"))) - (find-files "." "(scp\\.bin|\\.config)$")) - (install-file "build/tools/load" - (string-append #$output "/bin"))))))) - ;; The firmware is cross-compiled using a "bare bones" compiler (no libc). - ;; Use our own tool chain for that. - (native-inputs - (list bison - (cross-gcc "or1k-elf") - (cross-binutils "or1k-elf") - flex)) - (home-page "https://github.com/crust-firmware/crust") - (synopsis "Firmware for Allwinner sunxi SoCs") - (description "Crust improves battery life and thermal performance by +(define make-crust-package + (mlambda (platform) + (package + (name (string-append "crust-" + (string-replace-substring platform "_" "-"))) + (version "0.5") + (source + (origin + (method git-fetch) + (uri (git-reference + ;; There are only GitHub generated release snapshots. + (url "https://github.com/crust-firmware/crust") + (commit (string-append "v" version)))) + (file-name (git-file-name "crust" version)) + (sha256 + (base32 + "0xgbbhifg3miwd3yp6jq9kp7nqgz5gzy00w95vba45j8jk5vjvvz")))) + (build-system gnu-build-system) + (arguments + (list + #:tests? #f ;no test suite + #:make-flags + (let ((triplet-without-vendor + (and (%current-target-system) + ;; TODO: Is there a use case for allowing this? + (not (target-avr?)) + (match (string-split (nix-system->gnu-triplet + (%current-target-system)) #\-) + ((arch vendor os ..1) + (string-join `(,arch ,@os) "-")))))) + #~(list "CROSS_COMPILE=or1k-elf-" + "V=1" + #$@(if triplet-without-vendor + ;; We are cross-compiling the tools, intended to be + ;; executable for the target system. + (list (string-append "HOSTAR=" triplet-without-vendor + "-ar") + (string-append "HOSTCC=" triplet-without-vendor + "-gcc")) + ;; Not cross-compiling. + (list "HOSTAR=ar" + "HOSTCC=gcc")) + "LEX=flex")) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'do-not-build-tests + (lambda _ + ;; Attempting to build the tools test binary on a non-aarch64 + ;; architecture fails with: "No cache cleaning implementation + ;; available for this architecture". Avoid building it (see: + ;; https://github.com/crust-firmware/crust/issues/182). + (substitute* "tools/Makefile" + (("tools-y \\+= test") "")))) + (delete 'configure) + (add-before 'build 'defconfig + (lambda* (#:key make-flags #:allow-other-keys) + (let ((config-name (string-append #$platform "_defconfig"))) + (apply invoke "make" (cons config-name make-flags))))) + (replace 'install + (lambda _ + (for-each (lambda (file) + (install-file file (string-append #$output + "/libexec"))) + (find-files "." "(scp\\.bin|\\.config)$")) + (install-file "build/tools/load" + (string-append #$output "/bin"))))))) + ;; The firmware is cross-compiled using a "bare bones" compiler (no libc). + ;; Use our own tool chain for that. + (native-inputs + (list bison + (cross-gcc "or1k-elf") + (cross-binutils "or1k-elf") + flex)) + (home-page "https://github.com/crust-firmware/crust") + (synopsis "Firmware for Allwinner sunxi SoCs") + (description "Crust improves battery life and thermal performance by implementing a deep sleep state. During deep sleep, the CPU cores, the DRAM controller, and most onboard peripherals are powered down, reducing power consumption by 80% or more compared to an idle device. On boards without a @@ -1280,8 +1281,8 @@ (define (make-crust-package platform) dedicated always-on microprocessor called a System Control Processor (SCP). Crust is designed to run on a specific SCP implementation, Allwinner's AR100.") - ;; Most files are dual-licensed "BSD-3 OR GPL2", a few are GPL2 only. - (license (list license:bsd-3 license:gpl2)))) + ;; Most files are dual-licensed "BSD-3 OR GPL2", a few are GPL2 only. + (license (list license:bsd-3 license:gpl2))))) (define-public crust-pinebook (make-crust-package "pinebook")) -- 2.41.0