|
| 1 | +#!/usr/bin/env bash |
| 2 | + |
| 3 | +# This file is part of The RetroPie Project |
| 4 | +# |
| 5 | +# The RetroPie Project is the legal property of its developers, whose names are |
| 6 | +# too numerous to list here. Please refer to the COPYRIGHT.md file distributed with this source. |
| 7 | +# |
| 8 | +# See the LICENSE.md file at the top-level directory of this distribution and |
| 9 | +# at https://raw.githubusercontent.com/RetroPie/RetroPie-Setup/master/LICENSE.md |
| 10 | +# |
| 11 | + |
| 12 | +rp_module_id="dsda-doom" |
| 13 | +rp_module_desc="DOOM source port based on PrBoom+, focused on speedrunning and QoL" |
| 14 | +rp_module_licence="GPL2 https://raw.githubusercontent.com/kraflab/dsda-doom/master/prboom2/COPYING" |
| 15 | +rp_module_repo="git https://github.com/kraflab/dsda-doom master" |
| 16 | +rp_module_section="exp" |
| 17 | +rp_module_flags="sdl2" |
| 18 | + |
| 19 | +function depends_dsda-doom() { |
| 20 | + local depends=(cmake libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libogg-dev libmad0-dev libvorbis-dev libzip-dev zlib1g-dev) |
| 21 | + # we need Fluidsynth 2+, check whether the platform has the older libfluidsynth1 |
| 22 | + [[ -z "$(dpkg-query -W -f '${Version}' libfluidsynth1)" ]] && depends+=(libfluidsynth-dev) |
| 23 | + |
| 24 | + getDepends "${depends[@]}" |
| 25 | +} |
| 26 | + |
| 27 | +function sources_dsda-doom() { |
| 28 | + gitPullOrClone |
| 29 | +} |
| 30 | + |
| 31 | +function build_dsda-doom() { |
| 32 | + rm -rf release && mkdir -p release |
| 33 | + cd release |
| 34 | + local params=(-DCMAKE_INSTALL_PREFIX="$md_inst" -DCMAKE_BUILD_TYPE=Release -DWITH_PORTMIDI=OFF) |
| 35 | + # disable fluidsynth when the v1 is found |
| 36 | + [[ -n "$(dpkg-query -W -f '${Version}' libfluidsynth1)" ]] && params+=(-DWITH_FLUIDSYNTH=OFF) |
| 37 | + cmake "${params[@]}" ../prboom2 |
| 38 | + make |
| 39 | + md_ret_require="$md_build/release/dsda-doom" |
| 40 | +} |
| 41 | + |
| 42 | +function install_dsda-doom() { |
| 43 | + md_ret_files=( |
| 44 | + 'release/dsda-doom' |
| 45 | + 'release/dsda-doom.wad' |
| 46 | + 'README.md' |
| 47 | + 'docs' |
| 48 | + 'prboom2/COPYING' |
| 49 | + 'prboom2/AUTHORS' |
| 50 | + ) |
| 51 | +} |
| 52 | + |
| 53 | +function add_games_dsda-doom() { |
| 54 | + local params=("-fullscreen" "-width %XRES%" "-height %YRES%") |
| 55 | + local launcher_prefix="DOOMWADDIR=$romdir/ports/doom" |
| 56 | + _add_games_lr-prboom "$launcher_prefix $md_inst/$md_id -iwad %ROM% ${params[*]}" |
| 57 | +} |
| 58 | + |
| 59 | +function configure_dsda-doom() { |
| 60 | + mkRomDir "ports/doom" |
| 61 | + |
| 62 | + moveConfigDir "$home/.dsda-doom" "$md_conf_root/doom" |
| 63 | + |
| 64 | + [[ "$md_mode" == "remove" ]] && return |
| 65 | + |
| 66 | + game_data_lr-prboom |
| 67 | + add_games_${md_id} |
| 68 | +} |
| 69 | + |
0 commit comments