-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathenv.sh
More file actions
executable file
·40 lines (31 loc) · 881 Bytes
/
env.sh
File metadata and controls
executable file
·40 lines (31 loc) · 881 Bytes
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
36
37
38
39
40
#!/bin/sh
##
# A basic script which either configures the current shell
# or starts docker.
#
# See https://github.com/blitz3d-ng/docker-images for info on docker.
# if no params, export needed variables for the compiler.
if [ "$1" = "" ]
then
dir=$(cd "$(dirname "$0")"; pwd -P)
export blitzpath=$dir/_release
export PATH=$blitzpath/bin:$PATH
return 0
fi
# otherwise, try docker
set -e
export PLATFORM=$1
shift
VERSION="${VERSION:-v20241218}"
VOLUME=blitz3d-ng-gems-$PLATFORM
IMAGE=ghcr.io/blitz3d-ng/env:$PLATFORM-$VERSION
OPTIONS="--cap-add=SYS_PTRACE --security-opt seccomp=unconfined --rm -w /b3d -v $(pwd):/b3d -v $VOLUME:/bundle -e LLVM_ROOT=/opt/llvm -e blitzpath=/b3d/_release -e BUNDLE_PATH=/bundle"
if [ -d /dev/snd ]
then
OPTIONS="--device /dev/snd $OPTIONS"
fi
if [ -t 1 ]
then
OPTIONS="--rm -it $OPTIONS"
fi
docker run $OPTIONS $IMAGE $@