-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathdocker-dpp-run
37 lines (33 loc) · 899 Bytes
/
docker-dpp-run
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
#!/bin/bash
# ##################################################
# NAME:
# docker-run-dpp
# DESCRIPTION:
# Runs Decoder++ within a container
# AUTHOR:
# bytebutcher
# ##################################################
if [ $# -eq 0 ] ; then
echo "usage: $(basename $0) qtlib=qt5|qt6" >&2
exit 1
fi
qtlib="${1}"
shift
if [[ "${qtlib}" != "qt5" ]] && [[ "${qtlib}" != "qt6" ]] ; then
echo "ERROR: Invalid qtlib argument! Valid options are: qt5|qt6" >&2
exit 1
fi
if ! [ -f "../setup.py" ] ; then
echo "ERROR: Missing required setup.py in source code repository!" >&2
exit 1
fi
device="/dev/null"
if [ -f /dev/dri ] ; then
device="/dev/dri/"
fi
version="$(python3 ../setup.py --version)"
docker run -it --rm \
--device "${device}" \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-e DISPLAY="${DISPLAY}" \
bytebutcher/decoder-plus-plus-${qtlib}:${version} $@