From 7fef609df1a61898764623f5cd4d4a930e5f19ea Mon Sep 17 00:00:00 2001 From: Sergey Trofimov Date: Sun, 5 Nov 2023 19:31:03 +0100 Subject: [PATCH] build: Require scripts/guix in pre-inst-env. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Makefile.am: Make scripts/guix depend on local guile. * build-aux/pre-inst-env.in: Require scripts/guix. Change-Id: Ib248da80a1e8215c4c5e6c485ade41a893ac0fd5 Signed-off-by: Ludovic Courtès --- Makefile.am | 2 +- build-aux/pre-inst-env.in | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index f4155f01b63..595a7c02e92 100644 --- a/Makefile.am +++ b/Makefile.am @@ -48,7 +48,7 @@ do_subst = $(SED) \ -e 's,[@]abs_top_builddir[@],$(abs_top_builddir),g' \ -e 's,[@]localedir[@],$(localedir),g' -scripts/guix: scripts/guix.in Makefile +scripts/guix: scripts/guix.in Makefile guile$(EXEEXT) $(AM_V_at)rm -f $@ $@-t $(AM_V_at)$(MKDIR_P) "$(@D)" $(AM_V_GEN)$(do_subst) < "$(srcdir)/$@.in" > "$@-t" diff --git a/build-aux/pre-inst-env.in b/build-aux/pre-inst-env.in index cd90a06cbc7..c18d3723354 100644 --- a/build-aux/pre-inst-env.in +++ b/build-aux/pre-inst-env.in @@ -46,6 +46,12 @@ export PATH GUIX="$abs_top_builddir/scripts/guix" export GUIX +# Sanity check. +if [ "$1" = "guix" ] && [ ! -f "$GUIX" ]; then + echo "$GUIX is not built. Please run 'make scripts/guix'." + exit 1 +fi + # Define $GUIX_UNINSTALLED to prevent `guix' from # prepending @guilemoduledir@ to the Guile load paths.