Skip to content

Commit

Permalink
Add ability to identify latest release; Fix bugs with missing make clean
Browse files Browse the repository at this point in the history
  • Loading branch information
gderber committed Sep 10, 2024
1 parent 19587c0 commit 9d5c523
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 14 deletions.
27 changes: 16 additions & 11 deletions scriptmodules/ports/etlegacy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,20 @@
#

rp_module_id="etlegacy"
rp_module_desc="etlegacy - ET: Legacy - A Fully compatable Wolfenstein: Enemy Territory 2.81.0 Client and Server"
rp_module_desc="etlegacy - ET: Legacy - A Fully compatable Wolfenstein: Enemy Territory Client and Server"
rp_module_licence="GPL3 https://raw.githubusercontent.com/etlegacy/etlegacy/master/COPYING.txt"
rp_module_help="Fix Me!"
rp_module_section="exp"
rp_module_repo="git https://github.com/etlegacy/etlegacy.git v2.81.0"
rp_module_flags=""
rp_module_repo="git https://github.com/etlegacy/etlegacy.git master :_get_branch_etlegacy"
rp_module_flags="!64bit"

function _get_branch_etlegacy() {
# Tested tag was 2.82.1 commit 0a24c70
# manual:
# 'curl https://api.github.com/repos/etlegacy/etlegacy/tags | grep -m 1 sha | cut -d\" -f4 | cut -dv -f2'

download https://api.github.com/repos/etlegacy/etlegacy/tags - | grep -m 1 sha | cut -d\" -f4 | cut -dv -f2
}

function _arch_etlegacy() {
# exact parsing from Makefile
Expand All @@ -33,9 +41,7 @@ function sources_etlegacy() {
function build_etlegacy() {
local params=(-DCMAKE_BUILD_TYPE=Release)

if [[ "${md_id}" == "etlegacy_64" ]]; then
params+=(-DCROSS_COMPILE32=0)
else
if isPlatform "64bit"; then
params+=(-DCROSS_COMPILE32=1)
git submodule init
git submodule update
Expand All @@ -48,12 +54,11 @@ function build_etlegacy() {
mkdir "$md_build/build"
cd "$md_build/build"

if [[ "${md_id}" == "etlegacy_64" ]]; then
cmake "${params[@]}" ..
if isPlatform "64bit"; then
# The added CC= and CXX= is to ensure that 64 bit libraries are not used during
# compilation of the 32 bit version
CC="gcc -m32" CXX="g++ -m32" cmake "${params[@]}" ..
else
# The added CC= and CXX= is to ensure that 64 bit libraries are not used during compilation of the
# 32 bit version
#CC="gcc -m32" CXX="g++ -m32" cmake "${params[@]}" ..
cmake "${params[@]}" ..
fi
make clean
Expand Down
25 changes: 22 additions & 3 deletions scriptmodules/ports/etlegacy_64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,17 @@
#

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

function _get_branch_etlegacy_64() {
download https://api.github.com/repos/etlegacy/etlegacy/tags - | grep -m 1 sha | cut -d\" -f4 | cut -dv -f2
}

function depends_etlegacy_64() {
getDepends cmake libsdl2-dev libopenal-dev
}
Expand All @@ -26,7 +30,22 @@ function sources_etlegacy_64() {
}

function build_etlegacy_64() {
build_etlegacy
local params=(-DCMAKE_BUILD_TYPE=Release)
params+=(-DCROSS_COMPILE32=0)

if isPlatform "rpi"; then
params+=(-DARM=1)
fi

mkdir "$md_build/build"
cd "$md_build/build"
cmake "${params[@]}" ..

make clean
make

md_ret_require="$md_build/build/etl.$(_arch_etlegacy)"

}

function install_etlegacy_64() {
Expand Down

0 comments on commit 9d5c523

Please sign in to comment.