From bfdb138010294fc14e6200502466d7c92d04e8ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Tue, 4 Oct 2011 20:53:47 +0000 Subject: [PATCH] configure: Allow `nix-store' to be run within a build chroot. --- configure.ac | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/configure.ac b/configure.ac index 6bb758d6..4fb5d2e1 100644 --- a/configure.ac +++ b/configure.ac @@ -44,6 +44,14 @@ export PATH NEED_PROG([NIX_STORE_PROGRAM], [nix-store]) AC_MSG_CHECKING([whether $NIX_STORE_PROGRAM is recent enough]) +if test -n "$NIX_STORE" -a test -n "$TMPDIR" +then + # This may be executed from within a build chroot, so pacify + # `nix-store' instead of letting it choke while trying to mkdir + # /nix/var. + NIX_STATE_DIR="$TMPDIR" + export NIX_STATE_DIR +fi if "$NIX_STORE_PROGRAM" --timeout 123 -q > /dev/null 2>&1 then AC_MSG_RESULT([yes])