build: Unset 'NIX_BUILD_HOOK' when offloading support is missing.

* build-aux/pre-inst-env.in: Export 'NIX_BUILD_HOOK' only when
nix/scripts/offload is executable; unset it otherwise.
This commit is contained in:
Ludovic Courtès 2017-03-08 14:45:55 +01:00
parent 1099988904
commit 19c1ac8d88
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
# GNU Guix --- Functional package management for GNU # GNU Guix --- Functional package management for GNU
# Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> # Copyright © 2012, 2013, 2014, 2015, 2017 Ludovic Courtès <ludo@gnu.org>
# #
# This file is part of GNU Guix. # This file is part of GNU Guix.
# #
@ -45,11 +45,18 @@ export PATH
NIX_ROOT_FINDER="$abs_top_builddir/nix/scripts/list-runtime-roots" NIX_ROOT_FINDER="$abs_top_builddir/nix/scripts/list-runtime-roots"
NIX_SUBSTITUTERS="$abs_top_builddir/nix/scripts/substitute" NIX_SUBSTITUTERS="$abs_top_builddir/nix/scripts/substitute"
NIX_BUILD_HOOK="$abs_top_builddir/nix/scripts/offload"
NIX_LIBEXEC_DIR="@abs_top_builddir@/nix/scripts" # for 'guix-authenticate' NIX_LIBEXEC_DIR="@abs_top_builddir@/nix/scripts" # for 'guix-authenticate'
export NIX_ROOT_FINDER NIX_SUBSTITUTERS \ export NIX_ROOT_FINDER NIX_SUBSTITUTERS NIX_LIBEXEC_DIR
NIX_BUILD_HOOK NIX_LIBEXEC_DIR
NIX_BUILD_HOOK="$abs_top_builddir/nix/scripts/offload"
if [ -x "$NIX_BUILD_HOOK" ]
then
export NIX_BUILD_HOOK
else
# No offloading support.
unset NIX_BUILD_HOOK
fi
# The 'guix-register' program. # The 'guix-register' program.
GUIX_REGISTER="$abs_top_builddir/guix-register" GUIX_REGISTER="$abs_top_builddir/guix-register"