/
scummvm.sh
100 lines (87 loc) · 3.09 KB
/
scummvm.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
#!/usr/bin/env bash
# This file is part of The RetroPie Project
#
# The RetroPie Project is the legal property of its developers, whose names are
# too numerous to list here. Please refer to the COPYRIGHT.md file distributed with this source.
#
# See the LICENSE.md file at the top-level directory of this distribution and
# at https://raw.githubusercontent.com/RetroPie/RetroPie-Setup/master/LICENSE.md
#
rp_module_id="scummvm"
rp_module_desc="ScummVM"
rp_module_help="Copy your ScummVM games to $romdir/scummvm"
rp_module_licence="GPL2 https://raw.githubusercontent.com/scummvm/scummvm/master/COPYING"
rp_module_repo="git https://github.com/scummvm/scummvm.git v2.5.0"
rp_module_section="opt"
rp_module_flags="sdl2"
function depends_scummvm() {
local depends=(
liba52-0.7.4-dev libmpeg2-4-dev libogg-dev libvorbis-dev libflac-dev libgif-dev libmad0-dev libpng-dev
libtheora-dev libfaad-dev libfluidsynth-dev libfreetype6-dev zlib1g-dev
libjpeg-dev libasound2-dev libcurl4-openssl-dev
)
if isPlatform "vero4k"; then
depends+=(vero3-userland-dev-osmc)
fi
if [[ "$md_id" == "scummvm-sdl1" ]]; then
depends+=(libsdl1.2-dev)
else
depends+=(libsdl2-dev)
fi
getDepends "${depends[@]}"
}
function sources_scummvm() {
gitPullOrClone
}
function build_scummvm() {
local params=(
--enable-release --enable-vkeybd
--disable-debug --disable-eventrecorder --prefix="$md_inst"
)
isPlatform "rpi" && isPlatform "32bit" && params+=(--host=raspberrypi)
isPlatform "gles" && params+=(--opengl-mode=gles2)
# stop scummvm using arm-linux-gnueabihf-g++ which is v4.6 on
# wheezy and doesn't like rpi2 cpu flags
if isPlatform "rpi"; then
CC="gcc" CXX="g++" ./configure "${params[@]}"
else
./configure "${params[@]}"
fi
make clean
make
strip "$md_build/scummvm"
md_ret_require="$md_build/scummvm"
}
function install_scummvm() {
make install
mkdir -p "$md_inst/extra"
cp -v backends/vkeybd/packs/vkeybd_*.zip "$md_inst/extra"
}
function configure_scummvm() {
mkRomDir "scummvm"
local dir
for dir in .config .local/share; do
moveConfigDir "$home/$dir/scummvm" "$md_conf_root/scummvm"
done
# Create startup script
rm -f "$romdir/scummvm/+Launch GUI.sh"
local name="ScummVM"
[[ "$md_id" == "scummvm-sdl1" ]] && name="ScummVM-SDL1"
cat > "$romdir/scummvm/+Start $name.sh" << _EOF_
#!/bin/bash
game="\$1"
pushd "$romdir/scummvm" >/dev/null
# Read game ID from .svm file, if present.
[[ -f "\$game.svm" ]] && game=$(cat "\$game.svm")
$md_inst/bin/scummvm --fullscreen --joystick=0 --extrapath="$md_inst/extra" "\$game"
# Write .svm files.
while read id title; do
echo "\$id" > "/home/pi/RetroPie/roms/scummvm/\$title.svm"
done < <(/opt/retropie/emulators/scummvm/bin/scummvm --list-targets | tail -n +3 | tr '/' ' ')
popd >/dev/null
_EOF_
chown $user:$user "$romdir/scummvm/+Start $name.sh"
chmod u+x "$romdir/scummvm/+Start $name.sh"
addEmulator 1 "$md_id" "scummvm" "bash $romdir/scummvm/+Start\ $name.sh %BASENAME%"
addSystem "scummvm"
}