Use the Guix logo instead of GuixSD.
[software/mumi.git] / pre-inst-env.in
1 #!/bin/sh
2
3 # Mumi --- Mediocre, uh, mail interface
4 # Copyright © 2012, 2013, 2014, 2015, 2017 Ludovic Courtès <ludo@gnu.org>
5 # Copyright © 2017 Eric Bavier <bavier@cray.com>
6 # Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
7 #
8 # This file was adapted from GNU Guix and is part of Mumi.
9 #
10 # Mumi is free software; you can redistribute it and/or modify it
11 # under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; either version 3 of the License, or (at
13 # your option) any later version.
14 #
15 # GNU Guix is distributed in the hope that it will be useful, but
16 # WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU General Public License for more details.
19 #
20 # You should have received a copy of the GNU General Public License
21 # along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22
23 # Usage: ./pre-inst-env COMMAND ARG...
24 #
25 # Run COMMAND in a pre-installation environment. Typical use is
26 # "./pre-inst-env guix build hello".
27
28 # By default we may end up with absolute directory names that contain '..',
29 # which get into $GUILE_LOAD_PATH, leading to '..' in the module file names
30 # recorded by Guile. To avoid that, make sure we get a real absolute
31 # directory name. Additionally, use '-P' to get the canonical directory name
32 # so that Guile's 'relative' %file-port-name-canonicalization can actually
33 # work (see <http://bugs.gnu.org/17935>.)
34 abs_top_srcdir="`cd "@abs_top_srcdir@" > /dev/null; pwd -P`"
35 abs_top_builddir="`cd "@abs_top_builddir@" > /dev/null; pwd -P`"
36
37 GUILE_LOAD_COMPILED_PATH="$abs_top_builddir${GUILE_LOAD_COMPILED_PATH:+:}$GUILE_LOAD_COMPILED_PATH"
38 GUILE_LOAD_PATH="$abs_top_builddir:$abs_top_srcdir${GUILE_LOAD_PATH:+:}$GUILE_LOAD_PATH"
39 export GUILE_LOAD_COMPILED_PATH GUILE_LOAD_PATH
40
41 # Define $PATH so that `mumi' and friends are easily found.
42
43 PATH="$abs_top_builddir/scripts:$abs_top_builddir:$PATH"
44 export PATH
45
46 # Define $MUMI_UNINSTALLED to prevent `guix' from
47 # prepending @guilemoduledir@ to the Guile load paths.
48
49 MUMI_UNINSTALLED=1
50 export MUMI_UNINSTALLED
51
52 exec "$@"