The International Simutrans Forum

 

Author Topic: How to Compile Simutrans on Linux Mint 19.3 Tricia  (Read 967 times)

0 Members and 1 Guest are viewing this topic.

Offline NNW

  • *
  • Posts: 90
  • Languages: EN,DE,AT
How to Compile Simutrans on Linux Mint 19.3 Tricia
« on: June 13, 2020, 08:42:25 AM »
I think, this maybe usefull for some users.

Thanks to Prissi and Andarix to explain this for me:

1) You need the ST Sourcecode from

the Subversion Repo

svn://servers.simutrans.org/simutrans

or Github

https://github.com/aburch/simutrans

From Subversion you get 3 Directories: "branches" "patches" "trunk" Github has only 1: "simutrans"

2) Before you can compile the Code you need a bunch of Devel Libraries:

Open a Terminal an type in:

Code: [Select]
sudo apt-get update
 sudo apt-get install libsdl2-dev libfreetype6-dev libminiupnpc-dev libbz2-dev libpng-dev zlib1g-dev autoconf

This may take a bit.

3) Go to the "trunk" respectively "simutrans" folder in your Filemanager then.

Start a terminal inside (Rightclick => Open a terminal here) and type in:
Code: [Select]
autoconf && ./configure
You have now a File "config.default"
If you have downloaded the code from the github, it does not get the revision correctly. Instead you can use the following line (if you have a working svn aka subversion client installed).

Code: [Select]
echo "FLAGS = -DREVISION=$(svn info --show-item revision svn://servers.simutrans.org/simutrans) " >>config.default
With github, you need to run this everytime you download a new revision. If you do not join networkgames, you can ignore this.

4) Now you can compile ST by typing:

Code: [Select]
make
and get a cup of coffee, because this needs a minute or 3 ...

5) The last step, make the shell script "distribute.sh" executable and start it.

Code: [Select]
chmod a+x ./distrubte.sh
./distribute.sh

The Script closes the terminal Window after finishing his work

You find now a *.zip File with the complete simutrans package in the "trunk" folder.
If you need only the binary, look for a file named "sim" in trunk.

Edit on svn revison info by prissi 13.6.2020.
« Last Edit: June 13, 2020, 12:46:49 PM by prissi »

Offline sdog

  • Devotee
  • *
  • Posts: 2052
Re: How to Compile Simutrans on Linux Mint 19.3 Tricia
« Reply #1 on: September 06, 2020, 11:04:07 PM »
Quote
If you have downloaded the code from the github, it does not get the revision correctly. Instead you can use the following line (if you have a working svn aka subversion client installed).
When you get Simutrans from Aburch GitHub mirror of the SVN there is an easier way. The revision number is by default included in the git commit message.
Code: [Select]
git log -3 --pretty=%B | grep ^git-svn-id | head -n 1 | sed 's/.*trunk@\(\d\{4,5\}\)\s.*/\1/g'
This will get the last three commit messages from `git log`, grep the the svn line, take only the first hit, remove all but the revision number and return it.

I dod have a related question though:
With -DREVISION flag, does one still have to set WITH_REVISION in config.default?

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10445
  • Languages: De,EN,JP
Re: How to Compile Simutrans on Linux Mint 19.3 Tricia
« Reply #2 on: September 06, 2020, 11:46:25 PM »
The WITH_REVISION is not needed, especially if you take things from github. The revison is then used directly. With revision uses svn info for the revision.

But for the above script, the use of the original repository needs anyway SVN, And for github, I cannot test it, since I have no access to aburch repository. For testing in my fork, the commit messages are quickly lost.