-
Notifications
You must be signed in to change notification settings - Fork 0
/
starcraft.sif
83 lines (60 loc) · 3.18 KB
/
starcraft.sif
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
BootStrap: debootstrap
OSVersion: buster
MirrorURL: http://ftp.us.debian.org/debian/
%environment
LANG=C.UTF-8
LC_ALL=C.UTF-8
WINEDLLOVERRIDES="mscoree,mshtml="
%labels
name starcraft
maintainer jchassoul
version 0.4.0
%post
apt update
apt -y install --install-recommends vim git apt-transport-https\
gnupg2 software-properties-common sudo curl build-essential\
gfortran pkg-config wget make cmake libyaml-0-2 libyaml-dev
dpkg --add-architecture i386
apt-add-repository contrib
apt-add-repository non-free
# add statix fix for wine 5.13
wget -nc https://dl.winehq.org/wine-builds/winehq.key
apt-key add winehq.key
apt-add-repository 'deb https://dl.winehq.org/wine-builds/debian/ buster main'
apt update && rm winehq.key
apt -y install --install-recommends libgnutls30:i386 libldap-2.4-2:i386\
libgpg-error0:i386 libxml2:i386 libasound2-plugins:i386 libsdl2-2.0-0:i386\
libsdl2-2.0-0 libavutil56 libavcodec58 libavutil56:i386 libavcodec58:i386\
libfreetype6:i386 libdbus-1-3:i386 libsqlite3-0:i386 libgl1-mesa-glx:i386\
libgl1-mesa-dri:i386 libstb0 libstb0:i386 mesa-vulkan-drivers xvfb libc-bin\
mesa-vulkan-drivers:i386
sleep 3 && Xvfb :1 -screen 0 640x480x24&
wget -nc https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/Debian_10/amd64/libfaudio0_20.01-0~buster_amd64.deb
wget -nc https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/Debian_10/i386/libfaudio0_20.01-0~buster_i386.deb
dpkg -i libfaudio0_20.01-0~buster_amd64.deb
dpkg -i libfaudio0_20.01-0~buster_i386.deb
apt -y install --install-recommends winehq-staging winetricks
apt -y install --install-recommends torch-core-free python3-pip libzmq3-dev
git clone https://github.com/spacebeam/starcraft-sif.git /usr/src/starcraft-sif
cat /usr/src/starcraft-sif/include/core/core* > /opt/StarCraft.tar.gz
tar -zxvf /opt/StarCraft.tar.gz -C /opt/
git clone https://github.com/jchassoul/TorchCraft.git /usr/src/TorchCraft --recursive
cd /usr/src/TorchCraft && luarocks make *.rockspec
pip3 install pybind11 && pip3 install /usr/src/TorchCraft
luarocks install lyaml YAML_LIBDIR=/usr/lib/x86_64-linux-gnu/
luarocks install luasec OPENSSL_LIBDIR=/usr/lib/x86_64-linux-gnu/
git clone https://github.com/spacebeam/bw.git /opt/bw
cd /opt/bw && luarocks make *.rockspec
adduser --disabled-login --gecos "" --shell /forbid/login wine
usermod --append --groups audio wine
chown wine:wine -R /home/wine
xvfb-run sudo -u wine env DISPLAY=:1 HOME=/home/wine USER=wine USERNAME=wine LOGNAME=wine WINEARCH=win32 wineboot
xvfb-run sudo -u wine env DISPLAY=:1 HOME=/home/wine USER=wine USERNAME=wine LOGNAME=wine winetricks -q vcrun2012
xvfb-run sudo -u wine env DISPLAY=:1 HOME=/home/wine USER=wine USERNAME=wine LOGNAME=wine winetricks -q vcrun2013
xvfb-run sudo -u wine env DISPLAY=:1 HOME=/home/wine USER=wine USERNAME=wine LOGNAME=wine winetricks -q dxvk
bash /usr/src/starcraft-scif/include/install_java.sh
apt-get clean
rm /opt/StarCraft.tar.gz
echo 'Go ahead HQ.'
%runscript
Xvfb :1 -screen 0 640x480x24& sleep 3 && xvfb-run sudo -u wine echo $*