-
Notifications
You must be signed in to change notification settings - Fork 1
/
install-vice-3.5-raspi-4-oldoldold.sh
124 lines (91 loc) · 4.18 KB
/
install-vice-3.5-raspi-4-oldoldold.sh
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#! /bin/bash
# This script does a rough install of VICE 3.5 on the RasPi 4.
# You can download and execute it directly via:
# wget -O - https://raw.githubusercontent.com/erkrystof/vice/master/install-vice-3.5-raspi-4.sh | bash
# or download manually:
# wget https://raw.githubusercontent.com/erkrystof/vice/master/install-vice-3.5-raspi-4.sh
# chmod +x install-vice-3.5-raspi-4.sh
# ./install-vice-3.5-raspi-4.sh
set -e
log () {
echo ""
echo "****************************************"
echo "* $1"
echo "****************************************"
echo ""
}
log "Installing VICE 3.5 on RasPi 4"
#log "Normal Raspi update/upgrade path"
#sudo apt update
#sudo apt full-upgrade
log "SDL2 Dependencies (for kmsdrm)"
#install dependencies for how we'll compile SDL2 and install the output package
sudo apt update -y
sudo apt upgrade -y
sudo apt-get install -y lsb-release git dialog wget gcc g++ build-essential unzip xmlstarlet \
python3-pyudev ca-certificates libasound2-dev libudev-dev libibus-1.0-dev libdbus-1-dev \
fcitx-libs-dev libsndio-dev libx11-dev libxcursor-dev libxext-dev libxi-dev libxinerama-dev \
libxkbcommon-dev libxrandr-dev libxss-dev libxt-dev libxv-dev libxxf86vm-dev libgl1-mesa-dev \
libegl1-mesa-dev libgles2-mesa-dev libgl1-mesa-dev libglu1-mesa-dev libdrm-dev libgbm-dev \
devscripts debhelper dh-autoreconf libraspberrypi-dev libpulse-dev
if [ -d ~/sdl-work ]
then
echo "Directory sdl-work exists already. Heading on in."
else
mkdir ~/sdl-work
fi
cd ~/sdl-work
log "Download SDL 2.0.14"
rm -rf ./SDL-mirror
git clone --single-branch --branch retropie-2.0.14 https://github.com/erkrystof/SDL-mirror
cd SDL-mirror
log "Config and Compile SDL 2.0.14"
#update debian package rules and control files, which update dependencies specific
#to the raspberry pi and enables kmsdrm
conf_depends="libasound2-dev, libudev-dev, libibus-1.0-dev, libdbus-1-dev, fcitx-libs-dev, libsndio-dev, libx11-dev, libxcursor-dev, libxext-dev, libxi-dev, libxinerama-dev, libxkbcommon-dev, libxrandr-dev, libxss-dev, libxt-dev, libxv-dev, libxxf86vm-dev, libgl1-mesa-dev, libegl1-mesa-dev, libgles2-mesa-dev, libgl1-mesa-dev, libglu1-mesa-dev, libdrm-dev, libgbm-dev,"
sed -i 's/libgl1-mesa-dev,/libgl1-mesa-dev, '"${conf_depends[*]}"'/' ./debian/control
conf_flags="--disable-video-vulkan --enable-video-rpi --enable-video-kmsdrm"
sed -i 's/confflags =/confflags = '"${conf_flags[*]}"' \\\n/' ./debian/rules
# move proprietary videocore headers
sed -i -e 's/\"EGL/\"brcmEGL/g' -e 's/\"GLES/\"brcmGLES/g' ./src/video/raspberry/SDL_rpivideo.h
sudo mv /opt/vc/include/EGL /opt/vc/include/brcmEGL
sudo mv /opt/vc/include/GLES /opt/vc/include/brcmGLES
sudo mv /opt/vc/include/GLES2 /opt/vc/include/brcmGLES2
#perform the build via dpkg-buildpackage
PKG_CONFIG_PATH= dpkg-buildpackage -b
# restore proprietary headers
sudo mv /opt/vc/include/brcmEGL /opt/vc/include/EGL
sudo mv /opt/vc/include/brcmGLES /opt/vc/include/GLES
sudo mv /opt/vc/include/brcmGLES2 /opt/vc/include/GLES2
#remove any old installed library
sudo dpkg --remove libsdl2 libsdl2-dev
#move to where those .deb packages are (right above us)
cd ~/sdl-work
log "Install our custom SDL 2.0.14"
if ! sudo dpkg -i libsdl2-2.0-0_2.0.14_armhf.deb libsdl2-dev_2.0.14_armhf.deb ; then
sudo apt-get -y -f --no-install-recommends install
fi
echo "libsdl2-dev hold" | sudo dpkg --set-selections
log "Download VICE dependencies"
#vice dependencies
sudo apt install libmpg123-dev libpng-dev zlib1g-dev libasound2-dev libvorbis-dev libflac-dev \
libpcap-dev automake bison flex subversion libjpeg-dev portaudio19-dev texinfo xa65 dos2unix \
libsdl2-image-dev -y
if [ -d ~/vice-src ]
then
echo "Directory vice-src exists already. Heading on in."
else
mkdir ~/vice-src
fi
cd ~/vice-src
log "Download VICE 3.5"
wget -O vice-3.5.tar.gz https://sourceforge.net/projects/vice-emu/files/releases/vice-3.5.tar.gz/download
tar xvfz vice-3.5.tar.gz
log "Build VICE 3.5"
cd vice-3.5
./autogen.sh
#change --prefix=<dir> if you want the binaries elsewhere
./configure --prefix=/home/pi/vice-3.5 --enable-sdlui2 --without-oss --enable-ethernet \
--disable-catweasel --without-pulse --enable-x64 --disable-pdf-docs --with-fastsid
make -j $(nproc)
make install