Skip to content

Commit 07041be

Browse files
committed
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
1 parent a800bed commit 07041be

File tree

2 files changed

+39
-64
lines changed

2 files changed

+39
-64
lines changed

Diff for: scriptmodules/ports/jfduke3d.sh

+34-18
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
rp_module_id="jfduke3d"
1313
rp_module_desc="lightweight Duke3D source port by JonoF"
1414
rp_module_licence="GPL2 https://raw.githubusercontent.com/jonof/jfduke3d/master/GPL.TXT"
15-
rp_module_repo="git https://github.com/jonof/jfduke3d.git master 41cd46bc"
15+
rp_module_repo="git https://github.com/jonof/jfduke3d.git master"
1616
rp_module_section="exp"
1717
rp_module_flags=""
1818

@@ -32,7 +32,16 @@ function sources_jfduke3d() {
3232
}
3333

3434
function build_jfduke3d() {
35-
local params=(DATADIR=$romdir/ports/duke3d RELEASE=1)
35+
local gamedir="duke3d"
36+
local require="duke3d"
37+
local params=(RELEASE=1)
38+
39+
if [[ ! -z "$1" ]] && [[ ! -z "$2" ]]; then
40+
gamedir=$1
41+
require=$2
42+
fi
43+
44+
params+=(DATADIR=$romdir/ports/$gamedir)
3645

3746
! isPlatform "x86" && params+=(USE_ASM=0)
3847
! isPlatform "x11" && params+=(WITHOUT_GTK=1)
@@ -49,16 +58,21 @@ function build_jfduke3d() {
4958
make clean veryclean
5059
make "${params[@]}"
5160

52-
md_ret_require="$md_build/duke3d"
61+
md_ret_require="$md_build/$require"
5362
}
5463

5564
function install_jfduke3d() {
5665
md_ret_files=(
57-
'duke3d'
5866
'build'
5967
'README.md'
6068
'GPL.TXT'
6169
)
70+
71+
if [[ ! -z "$1" ]]; then
72+
md_ret_files+=("$1")
73+
else
74+
md_ret_files+=('duke3d')
75+
fi
6276
}
6377

6478
function game_data_jfduke3d() {
@@ -74,9 +88,22 @@ function game_data_jfduke3d() {
7488
fi
7589
}
7690

77-
function configure_jfduke3d() {
78-
local config="$md_conf_root/jfduke3d/duke3d.cfg"
91+
function config_file_jfduke3d() {
92+
local config="$1"
93+
if [[ -f "$config" ]] || isPlatform "x86"; then
94+
return
95+
fi
96+
97+
# no config file exists, creating one
98+
# with alsa as the sound driver
99+
cat >"$config" << _EOF_
100+
[Sound Setup]
101+
MusicParams = "audio.driver=alsa"
102+
_EOF_
103+
chown -R $user:$user "$config"
104+
}
79105

106+
function configure_jfduke3d() {
80107
mkRomDir "ports/duke3d"
81108
moveConfigDir "$home/.jfduke3d" "$md_conf_root/jfduke3d"
82109

@@ -87,16 +114,5 @@ function configure_jfduke3d() {
87114
return
88115
fi
89116
game_data_jfduke3d
90-
91-
if [[ -f "$config" ]]; then
92-
return
93-
fi
94-
95-
# no config file exists, creating one
96-
# with alsa as the sound driver
97-
cat >"$config" << _EOF_
98-
[Sound Setup]
99-
MusicParams = "audio.driver=alsa"
100-
_EOF_
101-
chown -R $user:$user "$config"
117+
config_file_jfduke3d "$md_conf_root/jfduke3d/duke3d.cfg"
102118
}

Diff for: scriptmodules/ports/jfsw.sh

+5-46
Original file line numberDiff line numberDiff line change
@@ -13,53 +13,24 @@ rp_module_id="jfsw"
1313
rp_module_desc="Shadow Warrior source port by JonoF"
1414
rp_module_help="Place your registered version game files in $romdir/ports/shadowwarrior"
1515
rp_module_licence="GPL2 https://raw.githubusercontent.com/jonof/jfsw/master/GPL.TXT"
16-
rp_module_repo="git https://github.com/jonof/jfsw.git master 12828783"
16+
rp_module_repo="git https://github.com/jonof/jfsw.git master"
1717
rp_module_section="exp"
1818
rp_module_flags=""
1919

2020
function depends_jfsw() {
21-
local depends=(
22-
libsdl2-dev libvorbis-dev libfluidsynth-dev
23-
)
24-
25-
isPlatform "x86" && depends+=(nasm)
26-
isPlatform "gl" || isPlatform "mesa" && depends+=(libgl1-mesa-dev libglu1-mesa-dev)
27-
isPlatform "x11" && depends+=(libgtk3.0-dev)
28-
getDepends "${depends[@]}"
21+
depends_jfduke3d
2922
}
3023

3124
function sources_jfsw() {
3225
gitPullOrClone
3326
}
3427

3528
function build_jfsw() {
36-
local params=(DATADIR=$romdir/ports/shadowwarrior RELEASE=1)
37-
38-
! isPlatform "x86" && params+=(USE_ASM=0)
39-
! isPlatform "x11" && params+=(WITHOUT_GTK=1)
40-
! isPlatform "gl3" && params+=(USE_POLYMOST=0)
41-
42-
if isPlatform "gl" || isPlatform "mesa"; then
43-
params+=(USE_OPENGL=USE_GL2)
44-
elif isPlatform "gles"; then
45-
params+=(USE_OPENGL=USE_GLES2)
46-
else
47-
params+=(USE_OPENGL=0)
48-
fi
49-
50-
make clean veryclean
51-
make "${params[@]}"
52-
53-
md_ret_require="$md_build/sw"
29+
build_jfduke3d "shadowwarrior" "sw"
5430
}
5531

5632
function install_jfsw() {
57-
md_ret_files=(
58-
'sw'
59-
'build'
60-
'README.md'
61-
'GPL.TXT'
62-
)
33+
install_jfduke3d 'sw'
6334
}
6435

6536
function gamedata_jfsw() {
@@ -76,7 +47,6 @@ function gamedata_jfsw() {
7647
}
7748

7849
function configure_jfsw() {
79-
local config="$md_conf_root/sw/jfsw/sw.cfg"
8050
local gamedir="$romdir/ports/shadowwarrior"
8151

8252
mkRomDir "ports/shadowwarrior"
@@ -90,16 +60,5 @@ function configure_jfsw() {
9060
return
9161
fi
9262
gamedata_jfsw
93-
94-
if [[ -f "$config" ]]; then
95-
return
96-
fi
97-
98-
# no config file exists, creating one
99-
# with alsa as the sound driver
100-
cat >"$config" << _EOF_
101-
[Sound Setup]
102-
MusicParams = "audio.driver=alsa"
103-
_EOF_
104-
chown -R $user:$user "$config"
63+
config_file_jfduke3d "$md_conf_root/sw/jfsw/sw.cfg"
10564
}

0 commit comments

Comments
 (0)