-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathspack
executable file
·36 lines (28 loc) · 1.13 KB
/
spack
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/sh
SELF=$(readlink -f "$0")
HERE=${SELF%/*}
# ugh, this is so annoying
unset SPACK_LD_LIBRARY_PATH
if [ -z ${SSL_CERT_DIR+x} ] && [ -z ${SSL_CERT_FILE+x} ]; then
export SSL_CERT_FILE="$HERE/view/share/cacert.pem"
fi
if [ -z ${GIT_SSL_CAPATH+x} ] && [ -z ${GIT_SSL_CAINFO+x} ]; then
export GIT_SSL_CAINFO="$HERE/view/share/cacert.pem"
fi
# make our binaries and libs important
export PATH="$HERE/view/bin/:$HERE/view/sbin/:$PATH:$HERE/spack_src/bin"
export LD_LIBRARY_PATH="$HERE/view/lib/:$HERE/view/lib64/:$LD_LIBRARY_PATH"
export PYTHONPATH="$HERE/view/lib/python3.8/site-packages:$PYTHONPATH"
export SPACK_ROOT="$HERE/spack_src"
export GIT_EXEC_PATH="$HERE/view/libexec/git-core"
export GIT_TEMPLATE_DIR="$HERE/view/share/git-core/templates/"
export TERMINFO="$HERE/view/share/terminfo"
# rpm has MANY macros to be configured, not sure what the odds are that
# they will actually work with spack.x
export RPM_CONFIGDIR="$HERE/view/lib/rpm"
# By default run spack $@, but if NO_ENTRYPOINT=... run the command directly
if [ -z ${NO_ENTRYPOINT+x} ]; then
$HERE/view/bin/python3 $HERE/spack_src/bin/spack "$@"
else
"$@"
fi