[Debian / Ubuntu] 1-line script: install Minetest Git

User avatar
Lejo
Member
Posts: 718
Joined: Mon Oct 19, 2015 16:32
GitHub: Lejo1
In-game: Lejo

Re: [Debian / Ubuntu] 1-line script: install Minetest Git

by Lejo » Post

How can I delete the dev-0.5.0 release?
I need a server release of 0.4.17, I think this was a client release.
Edit: It is both?

User avatar
Krock
Developer
Posts: 4649
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: [Debian / Ubuntu] 1-line script: install Minetest Git

by Krock » Post

Lejo wrote:I need a server release of 0.4.17, I think this was a client release.
Right, I forgot to mention the CMake options which let you build the server (minetestserver) without the client built-in.

Code: Select all

cmake . -DBUILD_CLIENT=0 -DBUILD_SERVER=1
If you want Minetest as a (more or less) portable package, also define the option " -DRUN_IN_PLACE=1 ". If you have a desktop environment on the computer where you are building the server, then also check out the executable "cmake-gui".
More options: https://github.com/minetest/minetest/bl ... ke-options

CMake does not offer a way to uninstall a system-wide installed application, so you'd have to remove the files either manually or parse the manifest file.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
Lejo
Member
Posts: 718
Joined: Mon Oct 19, 2015 16:32
GitHub: Lejo1
In-game: Lejo

Re: [Debian / Ubuntu] 1-line script: install Minetest Git

by Lejo » Post

Thanks! It works perfect.

u34

Re: [Debian / Ubuntu] 1-line script: install Minetest Git

by u34 » Post

Krock wrote:
Lejo wrote:I need a server release of 0.4.17, I think this was a client release.
Right, I forgot to mention the CMake options which let you build the server (minetestserver) without the client built-in.

Code: Select all

cmake . -DBUILD_CLIENT=0 -DBUILD_SERVER=1
If you want Minetest as a (more or less) portable package, also define the option " -DRUN_IN_PLACE=1 ". If you have a desktop environment on the computer where you are building the server, then also check out the executable "cmake-gui".
More options: https://github.com/minetest/minetest/bl ... ke-options

CMake does not offer a way to uninstall a system-wide installed application, so you'd have to remove the files either manually or parse the manifest file.
+1; void *print() { cout <<"hello world"} LOL sorry... wrong way...

izzyb
Member
Posts: 35
Joined: Thu May 07, 2015 22:41

Re: [Debian / Ubuntu] 1-line script: install Minetest Git

by izzyb » Post

Lejo wrote:How can I delete the dev-0.5.0 release?
I need a server release of 0.4.17, I think this was a client release.
Edit: It is both?
To build a 4.17 release from the source, you need to checkout the 4.17 release after your git clone of the source.
UPDATE: Thanks Lejo - use checkout stable-0.4 instead of checkout 0.4.17 as I originally indicated. That way you'll get the latest stable automatically if there is a new release.

Code: Select all

git clone https://github.com/minetest/minetest.git
cd minetest
git checkout stable-0.4
cd games
git clone https://github.com/minetest/minetest_game.git
git checkout stable-0.4
Then do your cmake and make.

I recently figured this out, so please correct me if I have anything wrong here. I'm not sure how to get a list of branches, but found on my system tab completion produces a list if you type git checkout <tab><tab>. I'm sure there's a command to do the same, just not sure what it is.
Last edited by izzyb on Fri Jun 22, 2018 15:42, edited 1 time in total.
cdb_d26897136a4c

User avatar
Lejo
Member
Posts: 718
Joined: Mon Oct 19, 2015 16:32
GitHub: Lejo1
In-game: Lejo

Re: [Debian / Ubuntu] 1-line script: install Minetest Git

by Lejo » Post

Thanks!
But it's: git checkout stable-0.4

User avatar
poikilos
Member
Posts: 67
Joined: Thu Feb 18, 2016 13:45
GitHub: Poikilos
In-game: Poikilos

Re: [Debian / Ubuntu] 1-line script: install Minetest Git

by poikilos » Post

There is an issue in the original 1-line script that also was causing trouble in my version. I didn't notice this until recently. This is only an issue for silent install (such as in my case). If you are trying to make a silent install or remote install, the part where you run minetest should be removed:

Code: Select all

minetest;
Otherwise your cron job or whatever you are doing will get stuck.

User avatar
poikilos
Member
Posts: 67
Joined: Thu Feb 18, 2016 13:45
GitHub: Poikilos
In-game: Poikilos

Re: [Debian / Ubuntu] 1-line script: install Minetest Git

by poikilos » Post

For some reason it wouldn't compile due to missing lua.h ("lua.h: no such file or directory") on Ubuntu 18.04 Bionic Beaver, even though present in ./lib/lua/src/lua.h (where . is git version of minetest). This happened even after installing libluajit-5.1-dev liblua5.1-0-dev as per the 1-line script, and lublua5.2-dev as guesswork. I had to add the

Code: Select all

-DLUA_INCLUDE_DIR=/usr/include/luajit-2.1 
option to cmake.

grey
Member
Posts: 28
Joined: Fri Jan 03, 2014 18:51
Contact:

Re: [Debian / Ubuntu] 1-line script: install Minetest Git

by grey » Post

Just in case anyone cares, I tested this on a current Xbuntu machine and it works.

grey
Member
Posts: 28
Joined: Fri Jan 03, 2014 18:51
Contact:

Re: [Debian / Ubuntu] 1-line script: install Minetest Git

by grey » Post

I'm bringing back this dead thread to say that this one line of code still works on Trisquel 8. Thank you OP!

SteveTeece
New member
Posts: 3
Joined: Thu Aug 29, 2019 05:41
GitHub: SteveTeece

Re: [Debian / Ubuntu] 1-line script: install Minetest Git

by SteveTeece » Post

Another post to keep this thread alive.

I've been through ALL the posts in this thread, and modified/updated the 1-line installation script to the following:
1. Installs all the required build tools (latest versions as of 13 Sept, 2019)
2. Clone's the git repository for the most current versions of minetest and minetest-game
3. Compiles server (but not client)
4. Installs server System-Wide

This is tested and working on 13 Sept 2019 using Ubuntu 18.04.3 LTS

Code: Select all

sudo apt-get install -y git build-essential libirrlicht-dev libgettextpo0 libfreetype6-dev cmake libbz2-dev libpng12-dev libjpeg62-turbo-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-openssl-dev libluajit-5.1-dev liblua5.1-0-dev libleveldb-dev; cd; git clone https://github.com/minetest/minetest.git; cd minetest/games; git clone https://github.com/minetest/minetest_game.git; cd ..; cmake . -DRUN_IN_PLACE=0 -DENABLE_GETTEXT=1 -DENABLE_FREETYPE=1 -DENABLE_LEVELDB=0 -DBUILD_CLIENT=0 -DBUILD_SERVER=1; make -j$(nproc); sudo make install; echo -e "\n\n\e[1;33mYou can run Minetest again by typing \"minetest\" in a terminal or selecting it in an applications menu.\nYou can install mods in ~/.minetest/mods, too.\e[0m"

User avatar
Linuxdirk
Member
Posts: 3217
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: [Debian / Ubuntu] 1-line script: install Minetest Git

by Linuxdirk » Post

Alternatively just add the PPA and install from there.

User avatar
bomberman
Member
Posts: 27
Joined: Fri May 19, 2017 05:24
Location: USSR

Re: [Debian / Ubuntu] 1-line script: install Minetest Git

by bomberman » Post

Code: Select all

sudo dnf install -y gcc-c++ freetype-devel spatialindex-devel postgresql-devel doxygen irrlicht-devel gettext freetype cmake bzip2-devel libpng libjpeg-turbo libXxf86vm mesa-libGLU libsqlite3x-devel libogg-devel libvorbis-devel openal-devel curl-devel luajit-devel lua-devel leveldb-devel ncurses-devel redis hiredis-devel gmp-devel; cd; git clone https://github.com/minetest/minetest.git; cd minetest/games; git clone https://github.com/minetest/minetest_game.git; cd ..; cmake . -DENABLE_GETTEXT=1 -DENABLE_FREETYPE=1 -DENABLE_LEVELDB=1 -DENABLE_REDIS=1 -DENABLE_POSTGRESQL=1; make -j$(nproc); sudo make install; minetest; echo -e "\n\n\e[1;33mYou can run Minetest again by typing \"minetest\" in a terminal or selecting it in an applications menu.\nYou can install mods in ~/.minetest/mods, too.\e[0m"
in fedora32 need libSM-devel
2020-03-16_12-09.png
2020-03-16_12-09.png (23.19 KiB) Viewed 4290 times

User avatar
Linuxdirk
Member
Posts: 3217
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: [Debian / Ubuntu] 1-line script: install Minetest Git

by Linuxdirk » Post

Krock wrote:CMake does not offer a way to uninstall a system-wide installed application
This is the main reason not to use sudo make install ever. It's better to always create a package and install the package using the system's package manager.

User avatar
Rayjack
Member
Posts: 25
Joined: Thu Nov 15, 2018 18:18
In-game: Rayjack

Re: [Debian / Ubuntu] 1-line script: install Minetest Git

by Rayjack » Post

Linuxdirk wrote:
Fri Sep 13, 2019 08:13
Alternatively just add the PPA and install from there.
Let me guess, in Ubuntu I need:
sudo add-apt-repository ppa:minetestdevs/stable
sudo apt-get update

Could you please tell me how to install the minetest server ... should it be one of the Debian packages for Ubuntu 20.04 (command line version of Ubuntu in a digital ocean droplet dedicated minetest server): https://packages.debian.org/search?keyw ... est-server ? Thanks.

orionlethe13
New member
Posts: 2
Joined: Fri Aug 19, 2022 19:34

Re: [Debian / Ubuntu] 1-line script: install Minetest Git

by orionlethe13 » Post

This doesn't work anymore, I get the following error:

CMake Error at CMakeLists.txt:108 (message):
IrrlichtMt is required to build the client, but it was not found.

The Minetest team has forked Irrlicht to make their own customizations. It
can be found here: https://github.com/minetest/irrlicht

For example use: git clone --depth=1 https://github.com/minetest/irrlicht
lib/irrlichtmt

Any idea what to do here?

User avatar
Blockhead
Member
Posts: 1622
Joined: Wed Jul 17, 2019 10:14
GitHub: Montandalar
IRC: Blockhead256
In-game: Blockhead Blockhead256
Location: Land Down Under
Contact:

Re: [Debian / Ubuntu] 1-line script: install Minetest Git

by Blockhead » Post

Here's a newer version of the installation version that works in my Debian testing:

Code: Select all

sudo apt-get update && sudo apt-get install -y git build-essential libirrlicht-dev libgettextpo0 libfreetype6-dev cmake libbz2-dev libpng-dev libjpeg-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-openssl-dev libluajit-5.1-dev liblua5.1-0-dev && git clone --depth=1 https://github.com/minetest/minetest.git "$HOME/minetest" && cd "$HOME/minetest/games" && git clone --depth=1 https://github.com/minetest/minetest_game.git && cd .. && cd "$HOME/minetest" && git clone --depth=1 https://github.com/minetest/irrlicht lib/irrlichtmt && cmake . && make -j$(nproc) && cpack -G DEB && sudo dpkg -i minetest-* && minetest; echo -e "\n\n\e[1;33mYou can run Minetest again by typing \"minetest\" in a terminal or selecting it in an applications menu.\nYou can install mods in ~/.minetest/mods, too.\e[0m"
It will install properly through dpkg as well which is nicer than make install. I added the command that clones libirrlichtmt and I dropped the numbers out of libpng-dev and libjpeg-dev. Hopefully that works for Ubuntu users.

And here's my non-installation version:

Code: Select all

sudo apt-get update && sudo apt-get install -y git build-essential libirrlicht-dev libgettextpo0 libfreetype6-dev cmake libbz2-dev libpng-dev libjpeg-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-openssl-dev libluajit-5.1-dev liblua5.1-0-dev && git clone --depth=1 https://github.com/minetest/minetest.git "$HOME/minetest" && cd "$HOME/minetest/games" && git clone --depth=1 https://github.com/minetest/minetest_game.git && cd "$HOME/minetest" && git clone --depth 1 https://github.com/minetest/irrlicht lib/irrlichtmt && cmake . -DRUN_IN_PLACE=1 && make -j$(nproc) && bin/minetest; echo -e "\n\n\e[1;33mYou can run Minetest again by typing \"bin/minetest\" in a terminal or running it from a file manager program.\nYou can install mods in ./mods, too.\e[0m"
I'm not sure what the original version was supposed to accomplish by running make install on a run-in-place build. And since even if it were copied to, say, ~/.minetest, it wouldn't appear in your applications menu (is there even a freedesktop way to have local applications menu entries?), I changed the instructions to tell you to open it from the terminal or a file manager program instead of the applications menu.

Anyway in usual fashion I'm going to tell you that reading what this script actually does is going be much better for your learning than just depending on others to fix it for you. If any step of this fails, reading comprehension of error messages and the ability to go back and manually run the commands one-by-one until you find out what's wrong is going to be a good skill.
/˳˳_˳˳]_[˳˳_˳˳]_[˳˳_˳˳\ Advtrains enthusiast | My map: Noah's Railyard | My Content on ContentDB ✝️♂

User avatar
Linuxdirk
Member
Posts: 3217
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: [Debian / Ubuntu] 1-line script: install Minetest Git

by Linuxdirk » Post

orionlethe13 wrote:
Tue Aug 23, 2022 22:47
Any idea what to do here?
You mean, except reading the message and acting accordingly?

Gerry
New member
Posts: 2
Joined: Tue Jan 02, 2024 22:24

Re: [Debian / Ubuntu] 1-line script: install Minetest Git

by Gerry » Post

Hello all,

I spent some time to build the stable SERVER version for arm64 Ubuntu.
The point is, if you have clients for a specific version,
I assume it is not a bad idea to run the same version everywhere.
Sorry, no 1-liner, but still simple.

I used the following script for 5.8.0:

Code: Select all

#!/bin/sh
git clone --depth 1 https://github.com/minetest/minetest.git minetest -b stable-5
cd minetest
git clone --depth 1 https://github.com/minetest/minetest_game.git games/minetest_game -b stable-5
git clone --depth 1 https://github.com/minetest/irrlicht.git lib/irrlichtmt -b 1.9.0mt13
git clone --depth 1 https://github.com/LuaJIT/LuaJIT.git lib/luajit
cd lib/luajit && make -j4
cd ../..
cmake . -DRUN_IN_PLACE=TRUE -DBUILD_CLIENT=FALSE -DBUILD_SERVER=TRUE -DCMAKE_BUILD_TYPE="Release" -DENABLE_POSTGRESQL=TRUE -DLUA_LIBRARY=./lib/luajit/src/libluajit.a -DLUA_INCLUDE_DIR=./lib/luajit/src
make -j4
For CLIENTS adjust 2 switches:
-DENABLE_GETTEXT=ON
-DBUILD_CLIENT=TRUE

Thank You all for such a great community!

Have fun !

User avatar
Blockhead
Member
Posts: 1622
Joined: Wed Jul 17, 2019 10:14
GitHub: Montandalar
IRC: Blockhead256
In-game: Blockhead Blockhead256
Location: Land Down Under
Contact:

Re: [Debian / Ubuntu] 1-line script: install Minetest Git

by Blockhead » Post

Gerry wrote:
Tue Jan 02, 2024 22:43
Hello all,

I spent some time to build the stable SERVER version for arm64 Ubuntu.
Hi,

This is good that you're publishing it. Others have had issues with out-of-date LuaJIT on arm as well, so it's especially needed on arm to have an up-to-date LuaJIT master, but it's helpful on any CPU architecture as well. I will add two notes to your version though:

Code: Select all

git clone --depth 1 https://github.com/minetest/minetest_game.git games/minetest_game -b stable-5
git clone --depth 1 https://github.com/minetest/irrlicht.git lib/irrlichtmt -b 1.9.0mt13
This will result in a version-mismatch when Minetest 5.9 rolls around. You could target the tag 5.8 not the branch stable-5. Minetest 5.9 will need a newer irrlichtmt tag. If you wanted to keep the script working for any stable-5, there is actually a file in the Minetest source tree that points to the correct matching version of irrlichtmt, it's called misc/irrlichtmt_tag.txt.

Code: Select all

cd lib/luajit && make -j4
This hardcode the number of threads to run, but systems may have more or fewer threads and CPU cores available. The command nproc can be used on Linux systems to determine the number of threads the CPU support. Of course, depending on whether server is only used for Minetest we may not want to use all threads. But let's assume the server is not busy with anything else while you build Minetest.

Putting those notes together we get this revised version:

Code: Select all

#!/bin/sh
git clone --depth 1 https://github.com/minetest/minetest.git minetest -b stable-5
cd minetest
git clone --depth 1 https://github.com/minetest/minetest_game.git games/minetest_game -b stable-5
git clone --depth 1 https://github.com/minetest/irrlicht.git lib/irrlichtmt -b $(cat misc/irrlichtmt_tag.txt)
git clone --depth 1 https://github.com/LuaJIT/LuaJIT.git lib/luajit
cd lib/luajit && make -j$(nproc)
cd ../..
cmake . -DRUN_IN_PLACE=TRUE -DBUILD_CLIENT=FALSE -DBUILD_SERVER=TRUE -DCMAKE_BUILD_TYPE="Release" -DENABLE_POSTGRESQL=TRUE -DLUA_LIBRARY=./lib/luajit/src/libluajit.a -DLUA_INCLUDE_DIR=./lib/luajit/src
make -j$(nproc)
/˳˳_˳˳]_[˳˳_˳˳]_[˳˳_˳˳\ Advtrains enthusiast | My map: Noah's Railyard | My Content on ContentDB ✝️♂

Gerry
New member
Posts: 2
Joined: Tue Jan 02, 2024 22:24

Re: [Debian / Ubuntu] 1-line script: install Minetest Git

by Gerry » Post

Hello Blockhead,

Thank You, suggestions are always welcome.
For sure, it's more generic, now !
Would it be better to specify the tag, instead of stable-5 ?

Have a nice day !

User avatar
Blockhead
Member
Posts: 1622
Joined: Wed Jul 17, 2019 10:14
GitHub: Montandalar
IRC: Blockhead256
In-game: Blockhead Blockhead256
Location: Land Down Under
Contact:

Re: [Debian / Ubuntu] 1-line script: install Minetest Git

by Blockhead » Post

Gerry wrote:
Tue Jan 09, 2024 14:41
Hello Blockhead,

Thank You, suggestions are always welcome.
For sure, it's more generic, now !
Would it be better to specify the tag, instead of stable-5 ?

Have a nice day !
It depends on your goal: building the latest stable version, or a specific version. Building the most up to date stable branch is often good for clients or mod consumers, and not having to change the script is a big bonus to reusing it there. But server operators, mod authors, tinkers and so on will often want a specific one. The latter group is better able to take care of themselves anyway. I'll leave what I've written as-is and assume there's enough information in the documentation to help anyone who wants to build from source.
/˳˳_˳˳]_[˳˳_˳˳]_[˳˳_˳˳\ Advtrains enthusiast | My map: Noah's Railyard | My Content on ContentDB ✝️♂

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests