guix-devel
[Top][All Lists]
Advanced

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

Re: create a symlink


From: Rene
Subject: Re: create a symlink
Date: Thu, 07 Mar 2019 16:11:50 -0600

Hello Danny, sorry for delay.

I have updated my repository with commit
dc7d6d4ece30c7ab25e9f1927d64f2b409ab896c(version 14).

Danny Milosavljevic <address@hidden> writes:

> are you sure you put the call into guix/scripts/system.scm ?
>
> There are a lot of #$ things there already - should work.
>
> In gnu/build/install.scm it's not going to work.
>
> The Guix high-level packaging stuff is not available build-side, only host=
> -side.
>
> Can you provide a patch of what you did?
>

When doing `make` shows the error message:
--8<---------------cut here---------------start------------->8---
Backtrace:
          14 (primitive-load "/home/jin/guix/./build-aux/compile-all…")
In guix/build/compile.scm:
    158:6 13 (compile-files _ _ ("guix/scripts/system.scm" "gnu/b…") …)
   107:11 12 (load-files "." _ #:report-load _ #:debug-port _)
In ice-9/boot-9.scm:
  2800:17 11 (resolve-interface (guix scripts system) #:select _ # _ …)
In ice-9/threads.scm:
    390:8 10 (_ _)
In ice-9/boot-9.scm:
  2726:13  9 (_)
In ice-9/threads.scm:
    390:8  8 (_ _)
In ice-9/boot-9.scm:
  2994:20  7 (_)
   2312:4  6 (save-module-excursion _)
  3014:26  5 (_)
In unknown file:
           4 (primitive-load-path "guix/scripts/system" #<procedure …>)
In ice-9/eval.scm:
   191:35  3 (_ #f)
   191:27  2 (_ #f)
   223:20  1 (proc #<directory (guix scripts system) e2f050>)
In unknown file:
           0 (%resolve-variable (7 . ungexp) #<directory (guix scrip…>)

ERROR: In procedure %resolve-variable:
ungexp: unbound variable
Makefile:5463: recipe for target 'make-go' failed
make[2]: *** [make-go] Error 1
make[2]: Leaving directory '/home/jin/guix'
Makefile:4536: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/jin/guix'
Makefile:3078: recipe for target 'all' failed
make: *** [all] Error 2
--8<---------------cut here---------------end--------------->8---

Attached patch.

>From c0756c7dd90c038f5daddcf4893f57e9701ab033 Mon Sep 17 00:00:00 2001
From: Rene <address@hidden>
Date: Thu, 7 Mar 2019 20:46:59 -0800
Subject: [PATCH] Add symlink.

---
 gnu/build/install.scm   | 19 +++++++++++++++++++
 guix/scripts/system.scm |  2 ++
 2 files changed, 21 insertions(+)

diff --git a/gnu/build/install.scm b/gnu/build/install.scm
index 9e30c0d23..202a9672d 100644
--- a/gnu/build/install.scm
+++ b/gnu/build/install.scm
@@ -27,6 +27,7 @@
             populate-root-file-system
             reset-timestamps
             register-closure
+            install-hurd
             populate-single-profile-directory))
 
 ;;; Commentary:
@@ -144,6 +145,24 @@ includes /etc, /var, /run, /bin/sh, etc., and all the 
symlinks to SYSTEM."
                 (try))
               (apply throw args)))))))
 
+(define (install-hurd pkg)
+  "Create a link to /gnu/store/..hurd-1.9 with the name /hurd."
+
+  ;; Add /hurd link.
+  (let ((link-1 (string-append target
+                                     "/hurd")))
+    (let try ()
+      (catch 'system-error
+        (lambda ()
+          (symlink pkg link-1))
+        (lambda args
+          ;; If /hurd already exists, overwrite it.
+          (if (= EEXIST (system-error-errno args))
+              (begin
+                (delete-file link-1)
+                (try))
+              (apply throw args)))))))
+
 (define (reset-timestamps directory)
   "Reset the timestamps of all the files under DIRECTORY, so that they appear
 as created and modified at the Epoch."
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index b688bb68c..be8e639b7 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -1151,3 +1151,5 @@ argument list and OPTS is the option alist."
 ;;; End:
 
 ;;; system.scm ends here
+
+(install-hurd #$hurd)
-- 
2.17.1

-- 

Rene

reply via email to

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