From 8f49834cfeb67bede55eb209faad71401173fe0d Mon Sep 17 00:00:00 2001 From: Jaime Moreira Date: Mon, 13 Nov 2023 00:16:03 -0300 Subject: [PATCH 1/5] Added jfduke3d, lightweight Duke3D source port --- scriptmodules/ports/jfduke3d.sh | 102 ++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 scriptmodules/ports/jfduke3d.sh diff --git a/scriptmodules/ports/jfduke3d.sh b/scriptmodules/ports/jfduke3d.sh new file mode 100644 index 0000000000..cd557f3c6b --- /dev/null +++ b/scriptmodules/ports/jfduke3d.sh @@ -0,0 +1,102 @@ +#!/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="jfduke3d" +rp_module_desc="lightweight Duke3D source port by JonoF" +rp_module_licence="GPL2 https://raw.githubusercontent.com/jonof/jfduke3d/master/GPL.TXT" +rp_module_repo="git https://github.com/jonof/jfduke3d.git master 41cd46bc" +rp_module_section="exp" +rp_module_flags="" + +function depends_jfduke3d() { + local depends=( + libsdl2-dev libvorbis-dev libfluidsynth-dev + ) + + isPlatform "x86" && depends+=(nasm) + isPlatform "gl" || isPlatform "mesa" && depends+=(libgl1-mesa-dev libglu1-mesa-dev) + isPlatform "x11" && depends+=(libgtk3.0-dev) + getDepends "${depends[@]}" +} + +function sources_jfduke3d() { + gitPullOrClone +} + +function build_jfduke3d() { + local params=(DATADIR=$romdir/ports/duke3d RELEASE=1) + + ! isPlatform "x86" && params+=(USE_ASM=0) + ! isPlatform "x11" && params+=(WITHOUT_GTK=1) + ! isPlatform "gl3" && params+=(USE_POLYMOST=0) + + if isPlatform "gl" || isPlatform "mesa"; then + params+=(USE_OPENGL=USE_GL2) + elif isPlatform "gles"; then + params+=(USE_OPENGL=USE_GLES2) + else + params+=(USE_OPENGL=0) + fi + + make clean veryclean + make "${params[@]}" + + md_ret_require="$md_build/duke3d" +} + +function install_jfduke3d() { + md_ret_files=( + 'duke3d' + 'build' + 'README.md' + 'GPL.TXT' + ) +} + +function game_data_jfduke3d() { + local dest="$romdir/ports/duke3d" + if [[ ! -n $(find $dest -maxdepth 1 -iname duke3d.grp) ]]; then + mkUserDir "$dest" + local temp="$(mktemp -d)" + download "$__archive_url/3dduke13.zip" "$temp" + unzip -L -o "$temp/3dduke13.zip" -d "$temp" dn3dsw13.shr + unzip -L -o "$temp/dn3dsw13.shr" -d "$dest" duke3d.grp duke.rts + rm -rf "$temp" + chown -R $user:$user "$dest" + fi +} + +function configure_jfduke3d() { + local config="$md_conf_root/jfduke3d/duke3d.cfg" + + mkRomDir "ports/duke3d" + moveConfigDir "$home/.jfduke3d" "$md_conf_root/jfduke3d" + + # params are just for parity with eduke32, last one is not supported + addPort "$md_id" "duke3d" "Duke Nukem 3D" "$md_inst/duke3d" "-j$romdir/ports/duke3d -addon 0" + + if [[ "$md_mode" != "install" ]]; then + return + fi + game_data_jfduke3d + + if [[ -f "$config" ]]; then + return + fi + + # no config file exists, creating one + # with alsa as the sound driver + cat >"$config" << _EOF_ +[Sound Setup] +MusicParams = "audio.driver=alsa" +_EOF_ + chown -R $user:$user "$config" +} From 0b107d4503dfa09669c3ad463ace107882e20d21 Mon Sep 17 00:00:00 2001 From: Jaime Moreira Date: Mon, 13 Nov 2023 08:16:30 -0300 Subject: [PATCH 2/5] EDuke32 script correction Avoid downloading Duke3D shareware if full version is present --- scriptmodules/ports/eduke32.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scriptmodules/ports/eduke32.sh b/scriptmodules/ports/eduke32.sh index 710c0b419c..3a727fa2b7 100644 --- a/scriptmodules/ports/eduke32.sh +++ b/scriptmodules/ports/eduke32.sh @@ -77,7 +77,7 @@ function install_eduke32() { function game_data_eduke32() { local dest="$romdir/ports/duke3d" if [[ "$md_id" == "eduke32" ]]; then - if [[ ! -f "$dest/duke3d.grp" ]]; then + if [[ ! -n $(find $dest -maxdepth 1 -iname duke3d.grp) ]]; then mkUserDir "$dest" local temp="$(mktemp -d)" download "$__archive_url/3dduke13.zip" "$temp" From a800bedabfa0f357f4dabf0cca42ef9c854360b9 Mon Sep 17 00:00:00 2001 From: Jaime Moreira Date: Tue, 14 Nov 2023 14:28:55 -0300 Subject: [PATCH 3/5] Added jfsw, Shadow Warrior source port by JonoF Same author as JFDuke3D --- scriptmodules/ports/jfsw.sh | 105 ++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 scriptmodules/ports/jfsw.sh diff --git a/scriptmodules/ports/jfsw.sh b/scriptmodules/ports/jfsw.sh new file mode 100644 index 0000000000..05ae4eed55 --- /dev/null +++ b/scriptmodules/ports/jfsw.sh @@ -0,0 +1,105 @@ +#!/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="jfsw" +rp_module_desc="Shadow Warrior source port by JonoF" +rp_module_help="Place your registered version game files in $romdir/ports/shadowwarrior" +rp_module_licence="GPL2 https://raw.githubusercontent.com/jonof/jfsw/master/GPL.TXT" +rp_module_repo="git https://github.com/jonof/jfsw.git master 12828783" +rp_module_section="exp" +rp_module_flags="" + +function depends_jfsw() { + local depends=( + libsdl2-dev libvorbis-dev libfluidsynth-dev + ) + + isPlatform "x86" && depends+=(nasm) + isPlatform "gl" || isPlatform "mesa" && depends+=(libgl1-mesa-dev libglu1-mesa-dev) + isPlatform "x11" && depends+=(libgtk3.0-dev) + getDepends "${depends[@]}" +} + +function sources_jfsw() { + gitPullOrClone +} + +function build_jfsw() { + local params=(DATADIR=$romdir/ports/shadowwarrior RELEASE=1) + + ! isPlatform "x86" && params+=(USE_ASM=0) + ! isPlatform "x11" && params+=(WITHOUT_GTK=1) + ! isPlatform "gl3" && params+=(USE_POLYMOST=0) + + if isPlatform "gl" || isPlatform "mesa"; then + params+=(USE_OPENGL=USE_GL2) + elif isPlatform "gles"; then + params+=(USE_OPENGL=USE_GLES2) + else + params+=(USE_OPENGL=0) + fi + + make clean veryclean + make "${params[@]}" + + md_ret_require="$md_build/sw" +} + +function install_jfsw() { + md_ret_files=( + 'sw' + 'build' + 'README.md' + 'GPL.TXT' + ) +} + +function gamedata_jfsw() { + local dest="$romdir/ports/shadowwarrior" + if [[ ! -n $(find $dest -maxdepth 1 -iname sw.grp) ]]; then + mkUserDir "$dest" + local temp="$(mktemp -d)" + download "ftp://ftp.3drealms.com/share/3dsw12.zip" "$temp" + unzip -L -o "$temp/3dsw12.zip" -d "$temp" swsw12.shr + unzip -L -o "$temp/swsw12.shr" -d "$dest" sw.grp sw.rts + rm -rf "$temp" + fi + chown -R $user:$user "$dest" +} + +function configure_jfsw() { + local config="$md_conf_root/sw/jfsw/sw.cfg" + local gamedir="$romdir/ports/shadowwarrior" + + mkRomDir "ports/shadowwarrior" + moveConfigDir "$home/.jfsw" "$md_conf_root/sw/jfsw" + + addPort "$md_id" "sw" "Shadow Warrior" "$md_inst/sw %ROM%" "" + [[ -n $(find $gamedir -maxdepth 1 -iname dragon.zip) ]] && addPort "$md_id" "sw" "Shadow Warrior Twin Dragon" "$md_inst/sw %ROM%" "-gdragon.zip" + [[ -n $(find $gamedir -maxdepth 1 -iname wt.grp) ]] && addPort "$md_id" "sw" "Shadow Warrior Wanton Destruction" "$md_inst/sw %ROM%" "-gwt.grp" + + if [[ "$md_mode" != "install" ]]; then + return + fi + gamedata_jfsw + + if [[ -f "$config" ]]; then + return + fi + + # no config file exists, creating one + # with alsa as the sound driver + cat >"$config" << _EOF_ +[Sound Setup] +MusicParams = "audio.driver=alsa" +_EOF_ + chown -R $user:$user "$config" +} From 07041be405812aa3b652d7cbc604534b0db17333 Mon Sep 17 00:00:00 2001 From: Jaime Moreira Date: Sun, 19 Nov 2023 18:28:32 -0300 Subject: [PATCH 4/5] jfsw.sh now depends directly on 3fduke3d.sh In these ports, alsa is no longer forced on x86 Also, master branch is used in both projects --- scriptmodules/ports/jfduke3d.sh | 52 +++++++++++++++++++++------------ scriptmodules/ports/jfsw.sh | 51 ++++---------------------------- 2 files changed, 39 insertions(+), 64 deletions(-) diff --git a/scriptmodules/ports/jfduke3d.sh b/scriptmodules/ports/jfduke3d.sh index cd557f3c6b..3b1df5d7f0 100644 --- a/scriptmodules/ports/jfduke3d.sh +++ b/scriptmodules/ports/jfduke3d.sh @@ -12,7 +12,7 @@ rp_module_id="jfduke3d" rp_module_desc="lightweight Duke3D source port by JonoF" rp_module_licence="GPL2 https://raw.githubusercontent.com/jonof/jfduke3d/master/GPL.TXT" -rp_module_repo="git https://github.com/jonof/jfduke3d.git master 41cd46bc" +rp_module_repo="git https://github.com/jonof/jfduke3d.git master" rp_module_section="exp" rp_module_flags="" @@ -32,7 +32,16 @@ function sources_jfduke3d() { } function build_jfduke3d() { - local params=(DATADIR=$romdir/ports/duke3d RELEASE=1) + local gamedir="duke3d" + local require="duke3d" + local params=(RELEASE=1) + + if [[ ! -z "$1" ]] && [[ ! -z "$2" ]]; then + gamedir=$1 + require=$2 + fi + + params+=(DATADIR=$romdir/ports/$gamedir) ! isPlatform "x86" && params+=(USE_ASM=0) ! isPlatform "x11" && params+=(WITHOUT_GTK=1) @@ -49,16 +58,21 @@ function build_jfduke3d() { make clean veryclean make "${params[@]}" - md_ret_require="$md_build/duke3d" + md_ret_require="$md_build/$require" } function install_jfduke3d() { md_ret_files=( - 'duke3d' 'build' 'README.md' 'GPL.TXT' ) + + if [[ ! -z "$1" ]]; then + md_ret_files+=("$1") + else + md_ret_files+=('duke3d') + fi } function game_data_jfduke3d() { @@ -74,9 +88,22 @@ function game_data_jfduke3d() { fi } -function configure_jfduke3d() { - local config="$md_conf_root/jfduke3d/duke3d.cfg" +function config_file_jfduke3d() { + local config="$1" + if [[ -f "$config" ]] || isPlatform "x86"; then + return + fi + + # no config file exists, creating one + # with alsa as the sound driver + cat >"$config" << _EOF_ +[Sound Setup] +MusicParams = "audio.driver=alsa" +_EOF_ + chown -R $user:$user "$config" +} +function configure_jfduke3d() { mkRomDir "ports/duke3d" moveConfigDir "$home/.jfduke3d" "$md_conf_root/jfduke3d" @@ -87,16 +114,5 @@ function configure_jfduke3d() { return fi game_data_jfduke3d - - if [[ -f "$config" ]]; then - return - fi - - # no config file exists, creating one - # with alsa as the sound driver - cat >"$config" << _EOF_ -[Sound Setup] -MusicParams = "audio.driver=alsa" -_EOF_ - chown -R $user:$user "$config" + config_file_jfduke3d "$md_conf_root/jfduke3d/duke3d.cfg" } diff --git a/scriptmodules/ports/jfsw.sh b/scriptmodules/ports/jfsw.sh index 05ae4eed55..9795f4b548 100644 --- a/scriptmodules/ports/jfsw.sh +++ b/scriptmodules/ports/jfsw.sh @@ -13,19 +13,12 @@ rp_module_id="jfsw" rp_module_desc="Shadow Warrior source port by JonoF" rp_module_help="Place your registered version game files in $romdir/ports/shadowwarrior" rp_module_licence="GPL2 https://raw.githubusercontent.com/jonof/jfsw/master/GPL.TXT" -rp_module_repo="git https://github.com/jonof/jfsw.git master 12828783" +rp_module_repo="git https://github.com/jonof/jfsw.git master" rp_module_section="exp" rp_module_flags="" function depends_jfsw() { - local depends=( - libsdl2-dev libvorbis-dev libfluidsynth-dev - ) - - isPlatform "x86" && depends+=(nasm) - isPlatform "gl" || isPlatform "mesa" && depends+=(libgl1-mesa-dev libglu1-mesa-dev) - isPlatform "x11" && depends+=(libgtk3.0-dev) - getDepends "${depends[@]}" + depends_jfduke3d } function sources_jfsw() { @@ -33,33 +26,11 @@ function sources_jfsw() { } function build_jfsw() { - local params=(DATADIR=$romdir/ports/shadowwarrior RELEASE=1) - - ! isPlatform "x86" && params+=(USE_ASM=0) - ! isPlatform "x11" && params+=(WITHOUT_GTK=1) - ! isPlatform "gl3" && params+=(USE_POLYMOST=0) - - if isPlatform "gl" || isPlatform "mesa"; then - params+=(USE_OPENGL=USE_GL2) - elif isPlatform "gles"; then - params+=(USE_OPENGL=USE_GLES2) - else - params+=(USE_OPENGL=0) - fi - - make clean veryclean - make "${params[@]}" - - md_ret_require="$md_build/sw" + build_jfduke3d "shadowwarrior" "sw" } function install_jfsw() { - md_ret_files=( - 'sw' - 'build' - 'README.md' - 'GPL.TXT' - ) + install_jfduke3d 'sw' } function gamedata_jfsw() { @@ -76,7 +47,6 @@ function gamedata_jfsw() { } function configure_jfsw() { - local config="$md_conf_root/sw/jfsw/sw.cfg" local gamedir="$romdir/ports/shadowwarrior" mkRomDir "ports/shadowwarrior" @@ -90,16 +60,5 @@ function configure_jfsw() { return fi gamedata_jfsw - - if [[ -f "$config" ]]; then - return - fi - - # no config file exists, creating one - # with alsa as the sound driver - cat >"$config" << _EOF_ -[Sound Setup] -MusicParams = "audio.driver=alsa" -_EOF_ - chown -R $user:$user "$config" + config_file_jfduke3d "$md_conf_root/sw/jfsw/sw.cfg" } From b56f78108e90884f7960838d76833852d53afc1a Mon Sep 17 00:00:00 2001 From: Jaime Moreira Date: Sun, 19 Nov 2023 23:32:56 -0300 Subject: [PATCH 5/5] Only one place to obtain Duke3D shareware Fixed GTK3 package name --- scriptmodules/ports/eduke32.sh | 20 +++++++++----------- scriptmodules/ports/jfduke3d.sh | 17 ++--------------- 2 files changed, 11 insertions(+), 26 deletions(-) diff --git a/scriptmodules/ports/eduke32.sh b/scriptmodules/ports/eduke32.sh index 3a727fa2b7..b71edea8a9 100644 --- a/scriptmodules/ports/eduke32.sh +++ b/scriptmodules/ports/eduke32.sh @@ -76,16 +76,14 @@ function install_eduke32() { function game_data_eduke32() { local dest="$romdir/ports/duke3d" - if [[ "$md_id" == "eduke32" ]]; then - if [[ ! -n $(find $dest -maxdepth 1 -iname duke3d.grp) ]]; then - mkUserDir "$dest" - local temp="$(mktemp -d)" - download "$__archive_url/3dduke13.zip" "$temp" - unzip -L -o "$temp/3dduke13.zip" -d "$temp" dn3dsw13.shr - unzip -L -o "$temp/dn3dsw13.shr" -d "$dest" duke3d.grp duke.rts - rm -rf "$temp" - chown -R $user:$user "$dest" - fi + if [[ ! -n $(find $dest -maxdepth 1 -iname duke3d.grp) ]]; then + mkUserDir "$dest" + local temp="$(mktemp -d)" + download "$__archive_url/3dduke13.zip" "$temp" + unzip -L -o "$temp/3dduke13.zip" -d "$temp" dn3dsw13.shr + unzip -L -o "$temp/dn3dsw13.shr" -d "$dest" duke3d.grp duke.rts + rm -rf "$temp" + chown -R $user:$user "$dest" fi } @@ -107,7 +105,7 @@ function configure_eduke32() { rm -f "$romdir/ports/Duke3D Shareware.sh" if [[ "$md_mode" == "install" ]]; then - game_data_eduke32 + [[ "$md_id" == "eduke32" ]] && game_data_eduke32 touch "$config" iniConfig " " '"' "$config" diff --git a/scriptmodules/ports/jfduke3d.sh b/scriptmodules/ports/jfduke3d.sh index 3b1df5d7f0..9decd039c9 100644 --- a/scriptmodules/ports/jfduke3d.sh +++ b/scriptmodules/ports/jfduke3d.sh @@ -23,7 +23,7 @@ function depends_jfduke3d() { isPlatform "x86" && depends+=(nasm) isPlatform "gl" || isPlatform "mesa" && depends+=(libgl1-mesa-dev libglu1-mesa-dev) - isPlatform "x11" && depends+=(libgtk3.0-dev) + isPlatform "x11" && depends+=(libgtk-3-dev) getDepends "${depends[@]}" } @@ -75,19 +75,6 @@ function install_jfduke3d() { fi } -function game_data_jfduke3d() { - local dest="$romdir/ports/duke3d" - if [[ ! -n $(find $dest -maxdepth 1 -iname duke3d.grp) ]]; then - mkUserDir "$dest" - local temp="$(mktemp -d)" - download "$__archive_url/3dduke13.zip" "$temp" - unzip -L -o "$temp/3dduke13.zip" -d "$temp" dn3dsw13.shr - unzip -L -o "$temp/dn3dsw13.shr" -d "$dest" duke3d.grp duke.rts - rm -rf "$temp" - chown -R $user:$user "$dest" - fi -} - function config_file_jfduke3d() { local config="$1" if [[ -f "$config" ]] || isPlatform "x86"; then @@ -113,6 +100,6 @@ function configure_jfduke3d() { if [[ "$md_mode" != "install" ]]; then return fi - game_data_jfduke3d + game_data_eduke32 config_file_jfduke3d "$md_conf_root/jfduke3d/duke3d.cfg" }