guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Canonical-packages restoration.


From: Mathieu Othacehe
Subject: Canonical-packages restoration.
Date: Tue, 09 Jun 2020 12:22:09 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]