aboutsummaryrefslogtreecommitdiff
#!/bin/sh

# GNU Guix --- Functional package management for GNU
# Copyright © 2012, 2013, 2014, 2015, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
# Copyright © 2017 Eric Bavier <bavier@cray.com>
#
# This file is part of GNU Guix.
#
# GNU Guix is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or (at
# your option) any later version.
#
# GNU Guix is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

# Usage: ./pre-inst-env COMMAND ARG...
#
# Run COMMAND in a pre-installation environment.  Typical use is
# "./pre-inst-env guix build hello".

# By default we may end up with absolute directory names that contain '..',
# which get into $GUILE_LOAD_PATH, leading to '..' in the module file names
# recorded by Guile.  To avoid that, make sure we get a real absolute
# directory name.  Additionally, use '-P' to get the canonical directory name
# so that Guile's 'relative' %file-port-name-canonicalization can actually
# work (see <http://bugs.gnu.org/17935>.)
abs_top_srcdir="`cd "@abs_top_srcdir@" > /dev/null; pwd -P`"
abs_top_builddir="`cd "@abs_top_builddir@" > /dev/null; pwd -P`"

GUILE_LOAD_COMPILED_PATH="$abs_top_builddir${GUILE_LOAD_COMPILED_PATH:+:}$GUILE_LOAD_COMPILED_PATH"
GUILE_LOAD_PATH="$abs_top_builddir:$abs_top_srcdir${GUILE_LOAD_PATH:+:}$GUILE_LOAD_PATH"
export GUILE_LOAD_COMPILED_PATH GUILE_LOAD_PATH

# Define $PATH so that `guix' and friends are easily found.

PATH="$abs_top_builddir/scripts:$abs_top_builddir:$PATH"
export PATH

# The daemon invokes 'guix'; tell it which one to use.
GUIX="$abs_top_builddir/scripts/guix"
export GUIX

# Define $GUIX_UNINSTALLED to prevent `guix' from
# prepending @guilemoduledir@ to the Guile load paths.

GUIX_UNINSTALLED=1
export GUIX_UNINSTALLED

exec "$@"
5:54:20 +0100'>2019-11-29tests: Fix race condition in profile locking test....Ludovic Courtès 2019-11-22package: Allow multiple '--manifest' options....Ludovic Courtès 2019-11-08guix: package: lock profiles when processing them....Julien Lepiller 2019-09-26guix package: Add '--list-profiles'....Ludovic Courtès 2019-09-18guix package: "guix package -f FILE" ensures FILE returns a package....Ludovic Courtès 2019-05-26discovery: 'all-modules' returns modules in path order....Robert Vollmert 2019-05-13tests: Fix guix-package.sh....Maxim Cournoyer 2019-05-09ui: Make package outputs searchable....Chris Marusich 2019-02-07profiles: Raise an error for unmatched patterns....Ludovic Courtès 2018-11-11guix package: '--show' errors when asked for a non-existent package....Ludovic Courtès 2018-09-21profiles: 'packages->manifest' now accepts inferior packages....Ludovic Courtès 2018-07-13guix package: Use relative symlinks to generations....Ludovic Courtès 2018-06-06tests: Adjust 'guix package' test to "python2" name....Ludovic Courtès 2018-03-31guix package: Add '--allow-collisions'....Ludovic Courtès 2018-02-27guix package: '--search' no longer shows superseded packages....Ludovic Courtès 2017-11-11tests: Adjust to new unbound-variable error message....Ludovic Courtès 2017-06-26guix package: 'guix package -r PKG -u' does not upgrade PKG....Ludovic Courtès 2017-01-11guix package: Fix version and output for 'guix package -i /gnu/store/…'....Ludovic Courtès 2016-05-27guix package: Inherit the transformed version number....Ludovic Courtès