|
#! /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="hoh" |
|
rp_module_desc="Open sourced and enhanced remake of 'Head over Heels'" |
|
rp_module_licence="GPL3 https://github.com/dougmencken/HeadOverHeels/blob/master/LICENSE" |
|
rp_module_repo="git https://github.com/dougmencken/HeadOverHeels.git" |
|
rp_module_help="Batteries included: No extra gamefiles needed." |
|
rp_module_section="exp" |
|
rp_module_flags="!all arm rpi4" |
|
|
|
_hoh_romdir="$romdir/ports/headoverheels" |
|
_hoh_executable="bin/headoverheels" |
|
|
|
function depends_hoh() { |
|
local deb_pkgs=( |
|
autoconf |
|
cmake |
|
liballegro-acodec5-dev |
|
liballegro-audio5-dev |
|
liballegro-image5-dev |
|
liballegro5-dev |
|
libpng-dev |
|
libtinyxml2-dev |
|
libtool |
|
libvorbis-dev |
|
rsync |
|
xorg |
|
) |
|
getDepends ${deb_pkgs[*]} |
|
} |
|
|
|
function sources_hoh() { |
|
gitPullOrClone |
|
applyPatch "$md_data/01-menu-intro-outro.patch" |
|
} |
|
|
|
function build_hoh() { |
|
mkdir -p m4 |
|
[ -f ./configure ] || autoreconf -f -i |
|
|
|
local install_prefix="$md_build"/_rootdir |
|
|
|
./configure --with-allegro5 --prefix="${install_prefix}" #--enable-debug=yes |
|
|
|
make clean |
|
make && make install |
|
md_ret_require="$install_prefix/$_hoh_executable" |
|
} |
|
|
|
function install_hoh() { |
|
for d in bin share ; do |
|
mkUserDir "$_hoh_romdir/$d" |
|
rsync --recursive --owner --group --chown="$user":"$user" \ |
|
"$md_build"/_rootdir/$d/* "$_hoh_romdir/$d" |
|
done |
|
cp -p "$md_build"/LICENSE "$_hoh_romdir" |
|
chown "$user": "$_hoh_romdir"/LICENSE |
|
} |
|
|
|
function configure_hoh() { |
|
|
|
local ports_cfg_dir="headoverheels" |
|
local launcher="$md_inst/launcher.sh" |
|
|
|
addPort "$md_id" "$ports_cfg_dir" "Head over Heels" "XINIT:$launcher" |
|
[[ "$md_mode" != "install" ]] && return |
|
|
|
local pref_dir="$home"/.headoverheels |
|
local pref_file="$pref_dir"/preferences.xml |
|
|
|
mkUserDir "$pref_dir" |
|
moveConfigDir "$pref_dir" "$md_conf_root/$ports_cfg_dir" |
|
|
|
if [[ ! -e "$pref_file" ]] ; then |
|
cat >"$pref_file" << _EOF_ |
|
<preferences> |
|
<language>en_US</language> |
|
<keyboard> |
|
<movenorth>Left</movenorth> |
|
<movesouth>Right</movesouth> |
|
<moveeast>Up</moveeast> |
|
<movewest>Down</movewest> |
|
<jump>Space</jump> |
|
<take>c</take> |
|
<takeandjump>b</takeandjump> |
|
<doughnut>n</doughnut> |
|
<swap>x</swap> |
|
<pause>Esc</pause> |
|
<automap>Tab</automap> |
|
</keyboard> |
|
<audio> |
|
<fx>80</fx> |
|
<music>75</music> |
|
<roomtunes>true</roomtunes> |
|
</audio> |
|
<video> |
|
<fullscreen>true</fullscreen> |
|
<shadows>true</shadows> |
|
<background>true</background> |
|
<graphics>gfx</graphics> |
|
</video> |
|
</preferences> |
|
_EOF_ |
|
chown "$user": "$pref_file" |
|
fi |
|
|
|
cat >"$launcher" << _EOF_ |
|
#! /usr/bin/env bash |
|
xset -dpms s off s noblank |
|
cd "$_hoh_romdir" |
|
bin/headoverheels |
|
killall xinit |
|
_EOF_ |
|
|
|
chown "$user": "$launcher" |
|
chmod a+x "$launcher" |
|
} |