summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build-aux/pre-inst-env.in2
-rw-r--r--nix/libstore/builtins.cc10
-rw-r--r--nix/libstore/gc.cc2
-rw-r--r--nix/libstore/local-store.cc10
-rw-r--r--nix/local.mk2
-rw-r--r--nix/nix-daemon/guix-daemon.cc14
6 files changed, 10 insertions, 30 deletions
diff --git a/build-aux/pre-inst-env.in b/build-aux/pre-inst-env.in
index 050b1b80078..3efab69e7d8 100644
--- a/build-aux/pre-inst-env.in
+++ b/build-aux/pre-inst-env.in
@@ -45,7 +45,7 @@ export PATH
45# Daemon helpers. 45# Daemon helpers.
46 46
47NIX_ROOT_FINDER="$abs_top_builddir/nix/scripts/list-runtime-roots" 47NIX_ROOT_FINDER="$abs_top_builddir/nix/scripts/list-runtime-roots"
48NIX_LIBEXEC_DIR="@abs_top_builddir@/nix/scripts" # for 'guix-authenticate' 48NIX_LIBEXEC_DIR="@abs_top_builddir@/nix/scripts" # for 'authenticate', etc.
49 49
50export NIX_ROOT_FINDER NIX_LIBEXEC_DIR 50export NIX_ROOT_FINDER NIX_LIBEXEC_DIR
51 51
diff --git a/nix/libstore/builtins.cc b/nix/libstore/builtins.cc
index 1f52511c809..f7c7d424847 100644
--- a/nix/libstore/builtins.cc
+++ b/nix/libstore/builtins.cc
@@ -1,5 +1,5 @@
1/* GNU Guix --- Functional package management for GNU 1/* GNU Guix --- Functional package management for GNU
2 Copyright (C) 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org> 2 Copyright (C) 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
3 3
4 This file is part of GNU Guix. 4 This file is part of GNU Guix.
5 5
@@ -50,13 +50,7 @@ static void builtinDownload(const Derivation &drv,
50 /* Tell it about options such as "print-extended-build-trace". */ 50 /* Tell it about options such as "print-extended-build-trace". */
51 setenv("_NIX_OPTIONS", settings.pack().c_str(), 1); 51 setenv("_NIX_OPTIONS", settings.pack().c_str(), 1);
52 52
53 /* XXX: Hack our way to use the 'download' script from 'LIBEXECDIR/guix' 53 const string program = settings.nixLibexecDir + "/download";
54 or just 'LIBEXECDIR', depending on whether we're running uninstalled or
55 not. */
56 const string subdir = getenv("GUIX_UNINSTALLED") != NULL
57 ? "" : "/guix";
58
59 const string program = settings.nixLibexecDir + subdir + "/download";
60 execv(program.c_str(), (char *const *) argv); 54 execv(program.c_str(), (char *const *) argv);
61 55
62 throw SysError(format("failed to run download program '%1%'") % program); 56 throw SysError(format("failed to run download program '%1%'") % program);
diff --git a/nix/libstore/gc.cc b/nix/libstore/gc.cc
index 125f2428149..310b8792fe3 100644
--- a/nix/libstore/gc.cc
+++ b/nix/libstore/gc.cc
@@ -340,7 +340,7 @@ Roots LocalStore::findRoots()
340static void addAdditionalRoots(StoreAPI & store, PathSet & roots) 340static void addAdditionalRoots(StoreAPI & store, PathSet & roots)
341{ 341{
342 Path rootFinder = getEnv("NIX_ROOT_FINDER", 342 Path rootFinder = getEnv("NIX_ROOT_FINDER",
343 settings.nixLibexecDir + "/guix/list-runtime-roots"); 343 settings.nixLibexecDir + "/list-runtime-roots");
344 344
345 if (rootFinder.empty()) return; 345 if (rootFinder.empty()) return;
346 346
diff --git a/nix/libstore/local-store.cc b/nix/libstore/local-store.cc
index eb8a51cc239..892d9300b15 100644
--- a/nix/libstore/local-store.cc
+++ b/nix/libstore/local-store.cc
@@ -1224,14 +1224,8 @@ static void checkSecrecy(const Path & path)
1224 1224
1225static std::string runAuthenticationProgram(const Strings & args) 1225static std::string runAuthenticationProgram(const Strings & args)
1226{ 1226{
1227 /* Use the 'authenticate' script from 'LIBEXECDIR/guix' or just 1227 return runProgram(settings.nixLibexecDir + "/authenticate",
1228 'LIBEXECDIR', depending on whether we're uninstalled or not. */ 1228 false, args);
1229 const bool installed = getenv("GUIX_UNINSTALLED") == NULL;
1230 const string program = settings.nixLibexecDir
1231 + (installed ? "/guix" : "")
1232 + "/authenticate";
1233
1234 return runProgram(program, false, args);
1235} 1229}
1236 1230
1237void LocalStore::exportPath(const Path & path, bool sign, 1231void LocalStore::exportPath(const Path & path, bool sign,
diff --git a/nix/local.mk b/nix/local.mk
index ca958ff500f..6d7e60e9fb2 100644
--- a/nix/local.mk
+++ b/nix/local.mk
@@ -110,7 +110,7 @@ libstore_a_CPPFLAGS = \
110 -DNIX_STATE_DIR=\"$(localstatedir)/guix\" \ 110 -DNIX_STATE_DIR=\"$(localstatedir)/guix\" \
111 -DNIX_LOG_DIR=\"$(localstatedir)/log/guix\" \ 111 -DNIX_LOG_DIR=\"$(localstatedir)/log/guix\" \
112 -DGUIX_CONFIGURATION_DIRECTORY=\"$(sysconfdir)/guix\" \ 112 -DGUIX_CONFIGURATION_DIRECTORY=\"$(sysconfdir)/guix\" \
113 -DNIX_LIBEXEC_DIR=\"$(libexecdir)\" \ 113 -DNIX_LIBEXEC_DIR=\"$(libexecdir)/guix\" \
114 -DNIX_BIN_DIR=\"$(bindir)\" \ 114 -DNIX_BIN_DIR=\"$(bindir)\" \
115 -DDEFAULT_CHROOT_DIRS="\"\"" 115 -DDEFAULT_CHROOT_DIRS="\"\""
116 116
diff --git a/nix/nix-daemon/guix-daemon.cc b/nix/nix-daemon/guix-daemon.cc
index 23ef46ef8c0..f47d1426128 100644
--- a/nix/nix-daemon/guix-daemon.cc
+++ b/nix/nix-daemon/guix-daemon.cc
@@ -480,7 +480,7 @@ main (int argc, char *argv[])
480 { 480 {
481 std::string build_hook; 481 std::string build_hook;
482 482
483 build_hook = settings.nixLibexecDir + "/guix/offload"; 483 build_hook = settings.nixLibexecDir + "/offload";
484 setenv ("NIX_BUILD_HOOK", build_hook.c_str (), 1); 484 setenv ("NIX_BUILD_HOOK", build_hook.c_str (), 1);
485 } 485 }
486#else 486#else
@@ -498,16 +498,8 @@ main (int argc, char *argv[])
498 format ("build log compression: %1%") % settings.logCompression); 498 format ("build log compression: %1%") % settings.logCompression);
499 499
500 if (settings.useSubstitutes) 500 if (settings.useSubstitutes)
501 { 501 settings.substituters.push_back (settings.nixLibexecDir
502 /* XXX: Hack our way to use the 'substitute' script from 502 + "/substitute");
503 'LIBEXECDIR/guix' or just 'LIBEXECDIR', depending on whether
504 we're running uninstalled or not. */
505 const string subdir = getenv("GUIX_UNINSTALLED") != NULL
506 ? "" : "/guix";
507
508 settings.substituters.push_back (settings.nixLibexecDir
509 + subdir + "/substitute");
510 }
511 else 503 else
512 /* Clear the substituter list to make sure nothing ever gets 504 /* Clear the substituter list to make sure nothing ever gets
513 substituted, regardless of the client's settings. */ 505 substituted, regardless of the client's settings. */