summaryrefslogtreecommitdiff
path: root/guix/profiles.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2018-04-28 22:20:36 +0200
committerLudovic Courtès <ludo@gnu.org>2018-05-10 14:53:57 +0200
commite00ade3fb81f89cd7c030f998ccd3e07ef2628f0 (patch)
tree13978a5a0a893f1faf1476f9f42d33511a7c72e1 /guix/profiles.scm
parentdac1c97d131d297134fa878ac240d9ec0127044b (diff)
downloadgnu-guix-e00ade3fb81f89cd7c030f998ccd3e07ef2628f0.tar
gnu-guix-e00ade3fb81f89cd7c030f998ccd3e07ef2628f0.tar.gz
profiles: Optionally use relative file names for symlink targets.
* guix/build/union.scm (symlink-relative): New procedure. * guix/build/profiles.scm: Re-export it. (build-profile): Add #:symlink and pass it to 'union-build'. * guix/profiles.scm (profile-derivation): Add #:relative-symlinks?. Pass #:symlink to 'build-profile'. * tests/profiles.scm ("profile-derivation relative symlinks, one entry") ("profile-derivation relative symlinks, two entries"): New tests.
Diffstat (limited to 'guix/profiles.scm')
-rw-r--r--guix/profiles.scm7
1 files changed, 7 insertions, 0 deletions
diff --git a/guix/profiles.scm b/guix/profiles.scm
index 95dc9746bd..c17961c987 100644
--- a/guix/profiles.scm
+++ b/guix/profiles.scm
@@ -1202,6 +1202,7 @@ the entries in MANIFEST."
(hooks %default-profile-hooks)
(locales? #t)
(allow-collisions? #f)
+ (relative-symlinks? #f)
system target)
"Return a derivation that builds a profile (aka. 'user environment') with
the given MANIFEST. The profile includes additional derivations returned by
@@ -1213,6 +1214,9 @@ with a different version number.)
When LOCALES? is true, the build is performed under a UTF-8 locale; this adds
a dependency on the 'glibc-utf8-locales' package.
+When RELATIVE-SYMLINKS? is true, use relative file names for symlink targets.
+This is one of the things to do for the result to be relocatable.
+
When TARGET is true, it must be a GNU triplet, and the packages in MANIFEST
are cross-built for TARGET."
(mlet* %store-monad ((system (if system
@@ -1275,6 +1279,9 @@ are cross-built for TARGET."
(manifest-entries manifest))))))
(build-profile #$output '#$inputs
+ #:symlink #$(if relative-symlinks?
+ #~symlink-relative
+ #~symlink)
#:manifest '#$(manifest->gexp manifest)
#:search-paths search-paths))))