aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pre-inst-env.in53
1 files changed, 29 insertions, 24 deletions
diff --git a/pre-inst-env.in b/pre-inst-env.in
index 4e73d75..7b58d09 100644
--- a/pre-inst-env.in
+++ b/pre-inst-env.in
@@ -1,28 +1,33 @@
-#! /bin/sh
+#! @GUILE@ -s
+-*- scheme -*-
+!#
+;;; ccwl --- Concise Common Workflow Language
+;;; Copyright © 2021 Arun Isaac <arunisaac@systemreboot.net>
+;;;
+;;; This file is part of ccwl.
+;;;
+;;; ccwl 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.
+;;;
+;;; ccwl 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 ccwl. If not, see <https://www.gnu.org/licenses/>.
-# ccwl --- Concise Common Workflow Language
-# Copyright © 2021 Arun Isaac <arunisaac@systemreboot.net>
-#
-# This file is part of ccwl.
-#
-# ccwl 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.
-#
-# ccwl 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 ccwl. If not, see <https://www.gnu.org/licenses/>.
+(import (ice-9 match))
-abs_top_srcdir="`cd "@abs_top_srcdir@" > /dev/null; pwd -P`"
-abs_top_builddir="`cd "@abs_top_builddir@" > /dev/null; pwd -P`"
+(define (prepend-path-env! name . values)
+ (setenv name (string-append (string-join values ":" 'suffix)
+ (getenv name))))
-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
+(prepend-path-env! "GUILE_LOAD_PATH" "@abs_top_builddir@" "@abs_top_srcdir@")
+(prepend-path-env! "GUILE_LOAD_COMPILED_PATH" "@abs_top_builddir@")
-exec "$@"
+(match (command-line)
+ ((pre-inst-env command args ...)
+ (apply execlp command command args)))