summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--guix/build/copy-build-system.scm8
1 files changed, 7 insertions, 1 deletions
diff --git a/guix/build/copy-build-system.scm b/guix/build/copy-build-system.scm
index 6d9dc8f93b..a86f0cde29 100644
--- a/guix/build/copy-build-system.scm
+++ b/guix/build/copy-build-system.scm
@@ -91,7 +91,13 @@ if TARGET ends with a '/', the source is installed underneath."
                                    file))))
       (format (current-output-port) "`~a' -> `~a'~%" file dest)
       (mkdir-p (dirname dest))
-      (copy-file file dest)))
+      (let ((stat (lstat file)))
+        (case (stat:type stat)
+          ((symlink)
+           (let ((target (readlink file)))
+             (symlink target dest)))
+          (else
+           (copy-file file dest))))))
 
   (define* (make-file-predicate suffixes matches-regexp #:optional (default-value #t))
     "Return a predicate that returns #t if its file argument matches the