mirror of
https://github.com/fosslinux/live-bootstrap.git
synced 2026-03-23 11:36:32 +01:00
fix(guix-hash-compat): generate runtime config and invoke guix hash via guile without pre-inst-env
This commit is contained in:
parent
c90d9da159
commit
af44f12d30
1 changed files with 36 additions and 5 deletions
|
|
@ -15,24 +15,55 @@ src_compile() {
|
|||
src_install() {
|
||||
local compat_src
|
||||
local compat_bin
|
||||
local compat_config
|
||||
local src_system
|
||||
compat_src="${DESTDIR}/usr/libexec/guix-hash-compat/guix-1.5.0"
|
||||
compat_bin="${DESTDIR}/usr/bin/guix-hash-compat"
|
||||
compat_config="${compat_src}/guix/config.scm"
|
||||
src_system="$(uname -m)-linux"
|
||||
case "${src_system}" in
|
||||
x86_64-linux|i686-linux)
|
||||
;;
|
||||
*)
|
||||
src_system="x86_64-linux"
|
||||
;;
|
||||
esac
|
||||
|
||||
mkdir -p "${compat_src}"
|
||||
cp -a . "${compat_src}/"
|
||||
mkdir -p "$(dirname "${compat_bin}")"
|
||||
sed \
|
||||
-e 's|@PACKAGE_NAME@|guix|g' \
|
||||
-e 's|@PACKAGE_VERSION@|1.5.0|g' \
|
||||
-e 's|@PACKAGE_BUGREPORT@|bug-guix@gnu.org|g' \
|
||||
-e 's|@PACKAGE_URL@|https://guix.gnu.org|g' \
|
||||
-e 's|@GUIX_CHANNEL_URL@|#f|g' \
|
||||
-e 's|@GUIX_CHANNEL_COMMIT@|#f|g' \
|
||||
-e 's|@GUIX_CHANNEL_INTRODUCTION@|#f|g' \
|
||||
-e 's|@storedir@|/gnu/store|g' \
|
||||
-e 's|@guix_localstatedir@|/var|g' \
|
||||
-e 's|@guix_sysconfdir@|/etc|g' \
|
||||
-e "s|@guix_system@|${src_system}|g" \
|
||||
-e 's|@GIT@|/usr/bin/git|g' \
|
||||
-e 's|@GZIP@|/usr/bin/gzip|g' \
|
||||
-e 's|@BZIP2@|/usr/bin/bzip2|g' \
|
||||
-e 's|@XZ@|/usr/bin/xz|g' \
|
||||
"${compat_src}/guix/config.scm.in" > "${compat_config}"
|
||||
|
||||
cat > "${compat_bin}" <<'EOS'
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
src_dir="/usr/libexec/guix-hash-compat/guix-1.5.0"
|
||||
if [ -d /tmp/guix-1.5.0 ]; then
|
||||
src_dir="/tmp/guix-1.5.0"
|
||||
fi
|
||||
|
||||
cd "${src_dir}"
|
||||
exec ./pre-inst-env guix hash "$@"
|
||||
export GUIX_UNINSTALLED=1
|
||||
export GUILE_LOAD_PATH="${src_dir}${GUILE_LOAD_PATH:+:}${GUILE_LOAD_PATH}"
|
||||
export GUILE_LOAD_COMPILED_PATH="${src_dir}${GUILE_LOAD_COMPILED_PATH:+:}${GUILE_LOAD_COMPILED_PATH}"
|
||||
exec /usr/bin/guile --no-auto-compile \
|
||||
-L "${src_dir}" \
|
||||
-C "${src_dir}" \
|
||||
-c '(use-modules (guix scripts hash)) (apply guix-hash (cdr (command-line)))' \
|
||||
guix-hash-compat "$@"
|
||||
EOS
|
||||
chmod 0755 "${compat_bin}"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue