Skip to content

Commit 7ef8c72

Browse files
authored
Merge pull request #3399 from joolswills/uqm_upstream
uqm - rework module to build from source (and update to 0.8.0)
2 parents a4e74b0 + ef9e85b commit 7ef8c72

File tree

1 file changed

+22
-51
lines changed

1 file changed

+22
-51
lines changed

scriptmodules/ports/uqm.sh

Lines changed: 22 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -11,80 +11,51 @@
1111

1212
rp_module_id="uqm"
1313
rp_module_desc="The Ur-Quan Masters (Port of DOS game Star Control 2)"
14-
rp_module_licence="NONCOM https://raw.githubusercontent.com/davidben/uqm/nacl/COPYING"
15-
rp_module_section="opt"
16-
rp_module_flags="!mali"
14+
rp_module_licence="GPL https://sourceforce.net/p/sc2/uqm/ci/master/tree/sc2/COPYING?format=raw"
15+
rp_module_repo="file :_get_archive_uqm"
16+
rp_module_section="exp"
1717

1818
function _get_ver_uqm() {
19-
echo "0.6.2.dfsg-9.5"
19+
echo "0.8.0"
2020
}
2121

2222
function _update_hook_uqm() {
2323
# to show as installed in retropie-setup 4.x
2424
hasPackage uqm && mkdir -p "$md_inst"
2525
}
2626

27-
function depends_uqm() {
28-
[[ "$__os_id" != "Raspbian" ]] && return 0
29-
local depends=(debhelper devscripts libmikmod-dev libsdl1.2-dev libopenal-dev libsdl-image1.2-dev libogg-dev libvorbis-dev)
30-
isPlatform "gl" || isPlatform "mesa" && depends+=(libgl1-mesa-dev)
31-
isPlatform "kms" && depends+=(xorg)
27+
function _get_archive_uqm() {
28+
echo "$__archive_url/uqm-$(_get_ver_uqm)-src.tgz"
29+
}
3230

33-
getDepends "${depends[@]}"
31+
function depends_uqm() {
32+
getDepends libsdl2-dev libogg-dev libvorbis-dev libpng-dev zlib1g-dev
3433
}
3534

3635
function sources_uqm() {
37-
[[ "$__os_id" != "Raspbian" ]] && return 0
36+
downloadAndExtract "$(rp_resolveRepoParam "$md_repo_url")" "$md_build" --strip-components 1
37+
local packages="$md_build/content/packages"
38+
mkdir -p "$packages"
3839
local ver="$(_get_ver_uqm)"
39-
local url="http://http.debian.net/debian/pool/contrib/u/uqm"
40-
for file in uqm_$ver.dsc uqm_0.6.2.dfsg.orig.tar.gz uqm_$ver.debian.tar.xz; do
41-
download "$url/$file"
42-
done
40+
download "$__archive_url/uqm-${ver}-content.uqm" "$packages"
41+
download "$__archive_url/uqm-${ver}-voice.uqm" "$packages"
42+
download "$__archive_url/uqm-${ver}-3domusic.uqm" "$packages"
4343
}
4444

4545
function build_uqm() {
46-
[[ "$__os_id" != "Raspbian" ]] && return 0
47-
dpkg-source -x uqm_$(_get_ver_uqm).dsc
48-
cd uqm-0.6.2.dfsg
49-
dpkg-buildpackage -us -uc
46+
./build.sh uqm clean
47+
echo "\n" | CHOICE_debug_VALUE="nodebug" INPUT_install_prefix_VALUE="$md_inst" ./build.sh uqm config
48+
./build.sh uqm
5049
}
5150

5251
function install_uqm() {
53-
# uqm is missing on raspbian
54-
if [[ "$__os_id" == "Raspbian" ]]; then
55-
cp -v *.deb "$md_inst"
56-
dpkg -i *.deb
57-
aptInstall uqm-content uqm-music uqm-voice
58-
else
59-
aptInstall uqm uqm-content uqm-music uqm-voice
60-
fi
52+
./build.sh uqm install
6153
}
6254

63-
function install_bin_uqm() {
64-
rp_installBin
65-
# uqm is missing on raspbian
66-
if hasPackage raspberrypi-bootloader; then
67-
cd "$md_inst"
68-
dpkg -i *.deb
69-
aptInstall uqm-content uqm-music uqm-voice
70-
else
71-
aptInstall uqm uqm-content uqm-music uqm-voice
72-
fi
73-
}
55+
function configure_uqm() {
56+
addPort "$md_id" "uqm" "Ur-quan Masters" "$md_inst/bin/uqm -f"
7457

75-
function remove_uqm() {
76-
aptRemove uqm uqm-content uqm-music uqm-voice
77-
}
58+
[[ "$md_mode" == "remove" ]] && return
7859

79-
function configure_uqm() {
80-
local binary="uqm"
81-
local params=("-f")
82-
if isPlatform "kms"; then
83-
# SDL1 needs xinit, and does not have /usr/games in $PATH
84-
binary="XINIT:/usr/games/$binary"
85-
# OpenGL mode must be also be enabled for high resolution support
86-
params+=("-o" "-r %XRES%x%YRES%")
87-
fi
8860
moveConfigDir "$home/.uqm" "$md_conf_root/uqm"
89-
addPort "$md_id" "uqm" "Ur-quan Masters" "$binary ${params[*]}"
9061
}

0 commit comments

Comments
 (0)