distro: Search bootstrap binaries and patches in %LOAD-PATH.
[jackhill/guix/guix.git] / pre-inst-env.in
1 #!/bin/sh
2
3 # Guix --- Nix package management from Guile. -*- coding: utf-8 -*-
4 # Copyright (C) 2012 Ludovic Courtès <ludo@gnu.org>
5 #
6 # This file is part of Guix.
7 #
8 # 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 # 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 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-build' and friends are easily found.
31
32 PATH="@abs_top_builddir@:$PATH"
33 export PATH
34
35 # The following variables need only be defined when compiling Guix
36 # modules, but we define them to be on the safe side in case of
37 # auto-compilation.
38
39 NIX_HASH="@NIX_HASH@"
40
41 export NIX_HASH
42
43 exec "$@"