unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Efraim Flashner <efraim@flashner.co.il>
To: 53503@debbugs.gnu.org
Cc: Efraim Flashner <efraim@flashner.co.il>
Subject: [bug#53503] [PATCH] gnu: Add %final-inputs-riscv64.
Date: Mon, 24 Jan 2022 17:19:26 +0200	[thread overview]
Message-ID: <684a9e686ef9d8d326fefb4de794bd661fab564f.1643037303.git.efraim@flashner.co.il> (raw)

* gnu/packages/commencement.scm (%final-inputs-riscv64): New variable.
* guix/build-system/gnu.scm (standard-inputs): Use %final-inputs-riscv64
when targeting riscv64-linux.
---

This is the final piece needed to make hello (and most other packages)
build on riscv64-linux, when offloading from a non-riscv64 machine or
when built natively. Commit 94c70b5440334c7c844e20350351bd5565aff137
from the wip-riscv branch only worked when building natively on riscv64
since %final-inputs is sourced first, then the actual system it is going
to be built on. I believe this is due to the lazy resolving of
(gnu packages commencement) and %final inputs. Due to the above I was
unable to start from the commit on wip-riscv and use parameterize to
override %current-system, since by the time that part of the code was
reached %final-inputs was already evaluated.

 gnu/packages/commencement.scm | 6 +++++-
 guix/build-system/gnu.scm     | 4 +++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 26769d2626..96d914344d 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -3,7 +3,7 @@
 ;;; Copyright © 2014 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
 ;;; Copyright © 2014, 2015, 2017 Mark H Weaver <mhw@netris.org>
-;;; Copyright © 2017, 2018, 2019, 2021 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2017, 2018, 2019, 2021, 2022 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018, 2019, 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2019, 2020, 2021 Marius Bakke <marius@gnu.org>
@@ -3736,6 +3736,10 @@ (define-public %final-inputs
       ("libc:static" ,glibc-final "static")
       ("locales" ,glibc-utf8-locales-final))))
 
+(define-public %final-inputs-riscv64
+  `(("gcc:lib" ,gcc-final "lib")
+    ,@%final-inputs))
+
 (define-public canonical-package
   (let ((name->package (fold (lambda (input result)
                                (match input
diff --git a/guix/build-system/gnu.scm b/guix/build-system/gnu.scm
index 651415098e..2f74000eef 100644
--- a/guix/build-system/gnu.scm
+++ b/guix/build-system/gnu.scm
@@ -273,7 +273,9 @@ (define (standard-packages)
 
   ;; Resolve (gnu packages commencement) lazily to hide circular dependency.
   (let ((distro (resolve-module '(gnu packages commencement))))
-    (module-ref distro '%final-inputs)))
+    (if (target-riscv64?)
+      (module-ref distro '%final-inputs-riscv64)
+      (module-ref distro '%final-inputs))))
 
 (define* (lower name
                 #:key source inputs native-inputs outputs target

base-commit: 1bfd634e335702d0b9b0189d685d14ec79f1cbf6
-- 
2.34.0





             reply	other threads:[~2022-01-24 15:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-24 15:19 Efraim Flashner [this message]
     [not found] ` <handler.53503.B.16430376137788.ack@debbugs.gnu.org>
2022-01-27  7:55   ` bug#53503: Acknowledgement ([PATCH] gnu: Add %final-inputs-riscv64.) Efraim Flashner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=684a9e686ef9d8d326fefb4de794bd661fab564f.1643037303.git.efraim@flashner.co.il \
    --to=efraim@flashner.co.il \
    --cc=53503@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).