1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/minetest_ynh.git synced 2024-09-03 20:36:00 +02:00

Update to 5.3.0 and add game support

This commit is contained in:
Rafi594 2020-07-29 22:11:02 +02:00
parent a959f3dab2
commit 949c41d82c
8 changed files with 38 additions and 10 deletions

View file

@ -11,7 +11,7 @@ If you dont have YunoHost, please see [here](https://yunohost.org/#/install)
## Overview
Minetest is a free open-source voxel game engine with easy modding and game creation.
**Shipped version:** 5.2.0
**Shipped version:** 5.3.0
## Screenshots

View file

@ -11,7 +11,7 @@ Si vous navez pas YunoHost, veuillez consulter [ici](https://yunohost.org/#/i
## Aperçu
Minetest est un moteur de jeu voxel open-source avec modding et création de jeux faciles.
**Version incluse:** 5.2.0
**Version incluse:** 5.3.0
## Captures décran

View file

@ -1,6 +1,6 @@
SOURCE_URL=https://github.com/minetest/minetest/archive/5.2.0.tar.gz
SOURCE_SUM=4996c7c50a6600d0c7140680d4bd995cb9aae910f216b46373953b49d6b13a5d
SOURCE_URL=https://github.com/minetest/minetest/archive/5.3.0.tar.gz
SOURCE_SUM=65dc2049f24c93fa544500f310a61e289c1b8fa47bf60877b746a2c27a7238d6
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true
SOURCE_FILENAME=minetest-5.2.0.tar.gz
SOURCE_FILENAME=minetest-5.3.0.tar.gz

View file

@ -38,7 +38,7 @@ ipv6_server = true
serverlist_url = servers.minetest.net
# Default game (default when creating a new world)
default_game = minetest
default_game = __GAME__
# World directory (everything in the world is stored here)
map-dir = /home/yunohost.app/__APP__/.minetest/worlds/world

View file

@ -1,6 +1,6 @@
SOURCE_URL=https://github.com/minetest/minetest_game/archive/5.2.0.tar.gz
SOURCE_SUM=0c49fd6e310de1aba2e8cb8ae72efe0e06bb6bc8d7c5efea23bc201b6a80ce94
SOURCE_URL=https://github.com/minetest/minetest_game/archive/5.3.0.tar.gz
SOURCE_SUM=06c6c1d4b97af211dd0fa518a3e68a205f594e9816a4b2477e48d4d21d278e2d
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true
SOURCE_FILENAME=minetest_game-5.2.0.tar.gz
SOURCE_FILENAME=minetest_game-5.3.0.tar.gz

View file

@ -6,7 +6,7 @@
"en": "Free, open source voxel game engine and game. Need a client to connect to the server.",
"fr": "Moteur de jeu de type « bac à sable » gratuit et open source. Nécessite un client pour se connecter au serveur."
},
"version": "5.2.0~ynh1",
"version": "5.3.0~ynh",
"url": "http://www.minetest.net/",
"license": "MIT",
"maintainer": {
@ -46,6 +46,16 @@
},
"default": false
},
{
"name": "game",
"ask": {
"en": "Choose a game for your server",
"fr": "Choissisez un jeu pour votre serveur"
},
"choises": ["minetest_game", "capturetheflag"],
"default": "minetest_game",
"hint": "Minetest_game is the minetest default game. / Capture The Flag player vs player game."
},
{
"name": "servername",
"type": "string",

View file

@ -26,6 +26,7 @@ ynh_abort_if_errors
server_domain=$YNH_APP_ARG_SERVER_DOMAIN
is_public=$YNH_APP_ARG_IS_PUBLIC
game=$YNH_APP_ARG_GAME
pvp=$YNH_APP_ARG_PVP
creative=$YNH_APP_ARG_CREATIVE
damage=$YNH_APP_ARG_DAMAGE
@ -49,6 +50,7 @@ ynh_print_info --message="Storing installation settings..."
ynh_app_setting_set --app=$app --key=server_domain --value=$server_domain
ynh_app_setting_set --app=$app --key=path --value=$path_url
ynh_app_setting_set --app=$app --key=game --value=$game
ynh_app_setting_set --app=$app --key=is_public --value=$is_public
ynh_app_setting_set --app=$app --key=pvp --value=$pvp
ynh_app_setting_set --app=$app --key=creative --value=$creative
@ -115,8 +117,14 @@ ynh_add_systemd_config
#=================================================
# Compile Minetest
pushd /opt/yunohost/$app
# Install the game
if [ $game = "capturetheflag" ]; then
git clone --recursive https://github.com/MT-CTF/capturetheflag.git games/capturetheflag
else
# Download Minetest Game
ynh_setup_source --dest_dir=/opt/yunohost/$app/games/minetest_game --source_id=minetest_game
fi
cmake . -DRUN_IN_PLACE=TRUE -DENABLE_LUAJIT=TRUE -DBUILD_CLIENT=FALSE -DBUILD_SERVER=TRUE
@ -131,6 +139,7 @@ popd
### `ynh_replace_string` is used to replace a string in a file.
### (It's compatible with sed regular expressions syntax)
ynh_replace_string --match_string="__GAME__" --replace_string="$game" --target_file="$home_path/.minetest/minetest.conf"
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$home_path/.minetest/minetest.conf"
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$home_path/.minetest/minetest.conf"
ynh_replace_string --match_string="__SERVERNAME__" --replace_string="$servername" --target_file="$home_path/.minetest/minetest.conf"
@ -140,6 +149,7 @@ ynh_replace_string --match_string="__PVP__" --replace_string="$pvp" --target_fil
ynh_replace_string --match_string="__CREATIVE__" --replace_string="$creative" --target_file="$home_path/.minetest/minetest.conf"
ynh_replace_string --match_string="__DAMAGE__" --replace_string="$damage" --target_file="$home_path/.minetest/minetest.conf"
#=================================================
# CREATE WORLD
#=================================================

View file

@ -18,6 +18,7 @@ app=$YNH_APP_INSTANCE_NAME
server_domain=$(ynh_app_setting_get --app=$app --key=server_domain)
port=$(ynh_app_setting_get --app=$app --key=port)
game=$(ynh_app_setting_get --app=$app --key=game)
is_public=$(ynh_app_setting_get --app=$app --key=is_public)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
home_path=$(ynh_app_setting_get --app=$app --key=home_path)
@ -124,8 +125,14 @@ fi
#=================================================
# Compile Minetest
pushd /opt/yunohost/$app
# Install the game
if [ $game = "capturetheflag" ]; then
# Download Capture The Flag
git clone --recursive https://github.com/MT-CTF/capturetheflag.git games/capturetheflag
else
# Download Minetest Game
ynh_setup_source --dest_dir=/opt/yunohost/$app/games/minetest_game --source_id=minetest_game
fi
cmake . -DRUN_IN_PLACE=TRUE -DENABLE_LUAJIT=TRUE -DBUILD_CLIENT=FALSE -DBUILD_SERVER=TRUE
@ -144,6 +151,7 @@ cp ../conf/minetest.conf $home_path/.minetest/minetest.conf
### `ynh_replace_string` is used to replace a string in a file.
### (It's compatible with sed regular expressions syntax)
ynh_replace_string --match_string="__GAME__" --replace_string="$game" --target_file="$home_path/.minetest/minetest.conf"
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$home_path/.minetest/minetest.conf"
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$home_path/.minetest/minetest.conf"
ynh_replace_string --match_string="__SERVERNAME__" --replace_string="$servername" --target_file="$home_path/.minetest/minetest.conf"