minimal AppImage-like portable packaging system
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tarinstall/posix/preload

19 lines
478 B

#!/bin/sh -e
# TODO: verify checksum before extracting
# SUM
# TODO: extract self without resolving to $0 because it doesn't resolve links
tail -c +"$(expr BYTES + 1)" $0 | lz4 -dc | tar -x
# TODO: remove hardcoded directory
# TODO: use a different extraction path
cd ID
export ORIGIN="$(pwd)"
export LD_LIBRARY_PATH="$ORIGIN/lib"
export PATH="$ORIGIN/bin":$PATH
#export LD_DEBUG='libs'
# TODO: use $0 instead
# FIXME: uses the system's basename
exec bin/"$(basename "$1")"