From 76f3ba42fd5516b46c07b8a7cc56f6ef8138f7cc Mon Sep 17 00:00:00 2001 From: Jude Taylor Date: Wed, 21 Oct 2015 14:39:08 -0700 Subject: move preBuildHook defaulting to globals.cc --- src/libstore/build.cc | 7 ------- src/libstore/globals.cc | 5 +++++ 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/libstore/build.cc b/src/libstore/build.cc index 19250fe24a..2211191fb6 100644 --- a/src/libstore/build.cc +++ b/src/libstore/build.cc @@ -59,12 +59,10 @@ /* chroot-like behavior from Apple's sandbox */ #if __APPLE__ #define SANDBOX_ENABLED 1 - #define DARWIN_PREBUILD 1 #define DEFAULT_ALLOWED_IMPURE_PREFIXES "/System/Library /usr/lib /dev /bin/sh" #else #define SANDBOX_ENABLED 0 #define DEFAULT_ALLOWED_IMPURE_PREFIXES "/bin" "/usr/bin" - #define DARWIN_PREBUILD 0 #endif #if CHROOT_ENABLED @@ -2047,11 +2045,6 @@ void DerivationGoal::startBuilder() } } -#if DARWIN_PREBUILD - if (settings.preBuildHook == "") - settings.preBuildHook = settings.nixLibexecDir + "/nix/resolve-system-dependencies.pl"; -#endif - if (settings.preBuildHook != "") { printMsg(lvlChatty, format("executing pre-build hook ‘%1%’") % settings.preBuildHook); diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc index 73f8489438..e704837e87 100644 --- a/src/libstore/globals.cc +++ b/src/libstore/globals.cc @@ -77,6 +77,11 @@ void Settings::processEnvironment() nixLibexecDir = canonPath(getEnv("NIX_LIBEXEC_DIR", NIX_LIBEXEC_DIR)); nixBinDir = canonPath(getEnv("NIX_BIN_DIR", NIX_BIN_DIR)); nixDaemonSocketFile = canonPath(nixStateDir + DEFAULT_SOCKET_PATH); + + // should be set with the other config options, but depends on nixLibexecDir +#ifdef __APPLE__ + preBuildHook = nixLibexecDir + "/nix/resolve-system-dependencies.pl"; +#endif } -- cgit 1.4.1