unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Canonical-packages restoration.
@ 2020-06-09 10:22 Mathieu Othacehe
  2020-06-09 11:18 ` Jan Nieuwenhuizen
  2020-06-09 16:34 ` Ludovic Courtès
  0 siblings, 2 replies; 6+ messages in thread
From: Mathieu Othacehe @ 2020-06-09 10:22 UTC (permalink / raw)
  To: guix-devel


Hello,

With f30d84d32db0f4f6cb84e139868e1727a7dc0a51 and
dfc8ccbf5da96a67eb1cade499f0def21e7fdb02, I did remove most of the
"canonical-package" calls because they were breaking system
cross-compilation.

Now, I'd like to somehow restore them, using the new "let-system". My
idea is to define something like:

--8<---------------cut here---------------start------------->8---
(define (canonical-package* package)
  (let ((canonical
         (module-ref (resolve-interface '(gnu packages base))
                     'canonical-package)))
    (let-system (system target)
      (if target
          package
          (canonical package)))))
--8<---------------cut here---------------end--------------->8---

And then use for instance this way:

--8<---------------cut here---------------start------------->8---
diff --git a/gnu/system/locale.scm b/gnu/system/locale.scm
index 689d238d1a..fd50538e9a 100644
--- a/gnu/system/locale.scm
+++ b/gnu/system/locale.scm
@@ -106,7 +106,8 @@ of LIBC."
 
          ;; 'localedef' executes 'gzip' to access compressed locale sources.
          (setenv "PATH"
-                 (string-append #+gzip "/bin:" #+libc "/bin"))
+                 (string-append #+gzip "/bin:"
+                                #+(canonical-package* libc) "/bin"))
--8<---------------cut here---------------end--------------->8---

However, it seems that nesting a "let-system" inside "file-append" does
not work:

--8<---------------cut here---------------start------------->8---
(use-modules (guix))
(use-modules (gnu))

(run-with-store (open-connection)
  (mlet* %store-monad
      ((drv (lower-object
             (computed-file "computed"
                            #~(begin
                                (mkdir #$output)
                                (symlink #$(file-append
                                            (let-system (s t) glibc) "/bin")
                                         (string-append #$output "/ref"))))))
       (output -> (derivation->output-path drv)))
    (mbegin %store-monad
      (built-derivations (list drv))
      (return (format #t "~a~%" output)))))
--8<---------------cut here---------------end--------------->8---

and it prevents me from going further. Does this stuff make any sense?
If yes I can try to fix it, but I just want to be sure first :)

Thanks,

Mathieu


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-06-10 15:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-09 10:22 Canonical-packages restoration Mathieu Othacehe
2020-06-09 11:18 ` Jan Nieuwenhuizen
2020-06-09 11:30   ` Mathieu Othacehe
2020-06-09 16:34 ` Ludovic Courtès
2020-06-10  9:35   ` Mathieu Othacehe
2020-06-10 15:24     ` Ludovic Courtès

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).