Skip to content

Commit

Permalink
jfsw.sh now depends directly on 3fduke3d.sh
Browse files Browse the repository at this point in the history
In these ports, alsa is no longer forced on x86
Also, master branch is used in both projects
  • Loading branch information
protocultor committed Nov 19, 2023
1 parent a800bed commit 7b237f9
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 64 deletions.
52 changes: 34 additions & 18 deletions scriptmodules/ports/jfduke3d.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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=""

Expand All @@ -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

This comment has been minimized.

Copy link
@joolswills

joolswills Nov 19, 2023

Member

Looks like some tab indentation sneaked in here.

This comment has been minimized.

Copy link
@protocultor

protocultor Nov 19, 2023

Author Contributor

Apologies, I've just amended it.

fi

params+=(DATADIR=$romdir/ports/$gamedir)

! isPlatform "x86" && params+=(USE_ASM=0)
! isPlatform "x11" && params+=(WITHOUT_GTK=1)
Expand All @@ -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() {
Expand All @@ -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"

Expand All @@ -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"
}
51 changes: 5 additions & 46 deletions scriptmodules/ports/jfsw.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,53 +13,24 @@ 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() {
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"
build_jfduke3d "shadowwarrior" "sw"
}

function install_jfsw() {
md_ret_files=(
'sw'
'build'
'README.md'
'GPL.TXT'
)
install_jfduke3d 'sw'
}

function gamedata_jfsw() {
Expand All @@ -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"
Expand All @@ -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"
}

0 comments on commit 7b237f9

Please sign in to comment.