Skip to content

Commit 9d5c523

Browse files
committed
Add ability to identify latest release; Fix bugs with missing make clean
1 parent 19587c0 commit 9d5c523

File tree

2 files changed

+38
-14
lines changed

2 files changed

+38
-14
lines changed

scriptmodules/ports/etlegacy.sh

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,20 @@
1010
#
1111

1212
rp_module_id="etlegacy"
13-
rp_module_desc="etlegacy - ET: Legacy - A Fully compatable Wolfenstein: Enemy Territory 2.81.0 Client and Server"
13+
rp_module_desc="etlegacy - ET: Legacy - A Fully compatable Wolfenstein: Enemy Territory Client and Server"
1414
rp_module_licence="GPL3 https://raw.githubusercontent.com/etlegacy/etlegacy/master/COPYING.txt"
1515
rp_module_help="Fix Me!"
1616
rp_module_section="exp"
17-
rp_module_repo="git https://github.com/etlegacy/etlegacy.git v2.81.0"
18-
rp_module_flags=""
17+
rp_module_repo="git https://github.com/etlegacy/etlegacy.git master :_get_branch_etlegacy"
18+
rp_module_flags="!64bit"
19+
20+
function _get_branch_etlegacy() {
21+
# Tested tag was 2.82.1 commit 0a24c70
22+
# manual:
23+
# 'curl https://api.github.com/repos/etlegacy/etlegacy/tags | grep -m 1 sha | cut -d\" -f4 | cut -dv -f2'
24+
25+
download https://api.github.com/repos/etlegacy/etlegacy/tags - | grep -m 1 sha | cut -d\" -f4 | cut -dv -f2
26+
}
1927

2028
function _arch_etlegacy() {
2129
# exact parsing from Makefile
@@ -33,9 +41,7 @@ function sources_etlegacy() {
3341
function build_etlegacy() {
3442
local params=(-DCMAKE_BUILD_TYPE=Release)
3543

36-
if [[ "${md_id}" == "etlegacy_64" ]]; then
37-
params+=(-DCROSS_COMPILE32=0)
38-
else
44+
if isPlatform "64bit"; then
3945
params+=(-DCROSS_COMPILE32=1)
4046
git submodule init
4147
git submodule update
@@ -48,12 +54,11 @@ function build_etlegacy() {
4854
mkdir "$md_build/build"
4955
cd "$md_build/build"
5056

51-
if [[ "${md_id}" == "etlegacy_64" ]]; then
52-
cmake "${params[@]}" ..
57+
if isPlatform "64bit"; then
58+
# The added CC= and CXX= is to ensure that 64 bit libraries are not used during
59+
# compilation of the 32 bit version
60+
CC="gcc -m32" CXX="g++ -m32" cmake "${params[@]}" ..
5361
else
54-
# The added CC= and CXX= is to ensure that 64 bit libraries are not used during compilation of the
55-
# 32 bit version
56-
#CC="gcc -m32" CXX="g++ -m32" cmake "${params[@]}" ..
5762
cmake "${params[@]}" ..
5863
fi
5964
make clean

scriptmodules/ports/etlegacy_64.sh

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,17 @@
1010
#
1111

1212
rp_module_id="etlegacy_64"
13-
rp_module_desc="etlegacy_64 - ET: Legacy - A Fully compatable Wolfenstein: Enemy Territory 2.81.0 Client and Server"
13+
rp_module_desc="etlegacy_64 - ET: Legacy - A Fully compatable Wolfenstein: Enemy Territory Client and Server"
1414
rp_module_licence="https://raw.githubusercontent.com/etlegacy/etlegacy/master/COPYING.txt"
1515
rp_module_help=""
1616
rp_module_section="exp"
17-
rp_module_repo="git https://github.com/etlegacy/etlegacy.git v2.81.0"
17+
rp_module_repo="git https://github.com/etlegacy/etlegacy.git master :_get_branch_etlegacy"
1818
rp_module_flags="!all 64bit"
1919

20+
function _get_branch_etlegacy_64() {
21+
download https://api.github.com/repos/etlegacy/etlegacy/tags - | grep -m 1 sha | cut -d\" -f4 | cut -dv -f2
22+
}
23+
2024
function depends_etlegacy_64() {
2125
getDepends cmake libsdl2-dev libopenal-dev
2226
}
@@ -26,7 +30,22 @@ function sources_etlegacy_64() {
2630
}
2731

2832
function build_etlegacy_64() {
29-
build_etlegacy
33+
local params=(-DCMAKE_BUILD_TYPE=Release)
34+
params+=(-DCROSS_COMPILE32=0)
35+
36+
if isPlatform "rpi"; then
37+
params+=(-DARM=1)
38+
fi
39+
40+
mkdir "$md_build/build"
41+
cd "$md_build/build"
42+
cmake "${params[@]}" ..
43+
44+
make clean
45+
make
46+
47+
md_ret_require="$md_build/build/etl.$(_arch_etlegacy)"
48+
3049
}
3150

3251
function install_etlegacy_64() {

0 commit comments

Comments
 (0)