Add TODO item.
[jackhill/guix/guix.git] / pre-inst-env.in
1 #!/bin/sh
2
3 # GNU Guix --- Functional package management for GNU
4 # Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org>
5 #
6 # This file is part of GNU Guix.
7 #
8 # GNU Guix is free software; you can redistribute it and/or modify it
9 # under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 3 of the License, or (at
11 # your option) any later version.
12 #
13 # GNU Guix is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License
19 # along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21 # Usage: ./pre-inst-env COMMAND ARG...
22 #
23 # Run COMMAND in a pre-installation environment. Typical use is
24 # "./pre-inst-env guix-build hello".
25
26 GUILE_LOAD_COMPILED_PATH="@abs_top_builddir@${GUILE_LOAD_COMPILED_PATH:+:}$GUILE_LOAD_COMPILED_PATH"
27 GUILE_LOAD_PATH="@abs_top_builddir@:@abs_top_srcdir@${GUILE_LOAD_PATH:+:}:$GUILE_LOAD_PATH"
28 export GUILE_LOAD_COMPILED_PATH GUILE_LOAD_PATH
29
30 # Define $PATH so that `guix' and friends are easily found.
31
32 PATH="@abs_top_builddir@/scripts:@abs_top_builddir@:$PATH"
33 export PATH
34
35 # Daemon helpers.
36
37 NIX_ROOT_FINDER="@abs_top_builddir@/nix/scripts/list-runtime-roots"
38 NIX_SUBSTITUTERS="@abs_top_builddir@/nix/scripts/substitute-binary"
39 NIX_SETUID_HELPER="@abs_top_builddir@/nix-setuid-helper"
40 export NIX_ROOT_FINDER NIX_SETUID_HELPER NIX_SUBSTITUTERS
41
42 # The following variables need only be defined when compiling Guix
43 # modules, but we define them to be on the safe side in case of
44 # auto-compilation.
45
46 NIX_HASH="@NIX_HASH@"
47 export NIX_HASH
48
49 # Define $GUIX_UNINSTALLED to prevent `guix' from
50 # prepending @guilemoduledir@ to the Guile load paths.
51
52 GUIX_UNINSTALLED=1
53 export GUIX_UNINSTALLED
54
55 exec "$@"