Generic build scripts

You can get help here if Freeciv doesn't start on your computer, or if you keep getting fatal errors while playing etc.
cazfi
Elite
Posts: 1506
Joined: Tue Jan 29, 2013 6:54 pm

Generic build scripts

Postby cazfi » Mon Mar 12, 2018 8:21 am

I've been writing almost identical instructions when ever someone has asked how to build specific freeciv client of specific freeciv version on a given linux distribution. To make things easier for everyone, I've started creating a script to make most of the work. Unfortunately there is just enough distribution specific details (different package managers, mostly) that single script for everyone is not feasible. I'm going with script per linux distribution, but so that one is easily derived from another.

Features of the script:
- Creates main directory under which is does everything, including installation of produced freeciv
- Later executions can use the same main directory and destroys as little as possible there -> it's possible to have multiple versions and clients installed parallel & no need to redo everything every time the script runs
- Script builds from release tarballs, not git versions
- Script takes care of downloading the freeciv release tarball. All you need to do is to download the script itself and run it.
- Script takes care of installing the dependencies. It does NOT attempt to minimize this package set depending on what version and client it's requested to build, but always installs everything it MAY need (this is the cost of keeping the script simple and straightforward so that it's easy to port to other distributions or for new freeciv versions)

cazfi
Elite
Posts: 1506
Joined: Tue Jan 29, 2013 6:54 pm

Re: Generic build scripts

Postby cazfi » Mon Mar 12, 2018 8:34 am

I've been developing the first script on Linux Mint 18: http://files.freeciv.org/tools/freeciv- ... -mint18.sh

Current version 1.00:
- Supported freeciv releases are those of 2.5 and 2.6 versions
- Supported guis are gtk2, gtk3, qt, sdl, and sdl2 (not in version 2.5)

I've tested this with latest releases from both supported branches; freeciv-2.5.10 and freeciv-2.6.0-beta2.

drgerg
Posts: 44
Joined: Sun Nov 15, 2015 4:05 pm

Re: Generic build scripts

Postby drgerg » Sun May 13, 2018 4:01 pm

Cazfi, thanks for your hard work

I have been reading your script and trying it out piece by piece on a Raspberry Pi (using Raspian as the OS). I am still doing all the sudo apt-get on the packages, one by one. I have one comment so far. Apt-get has twice recommended that I do a "sudo apt-get autoremove" command. So I have done that. No issues so far.

I am wondering if that command is something you want to add to the script. I'm a Linux newb so I'm sure there's implications about which I have no comprehension. I'd like to know your thoughts pros and cons.
Last edited by drgerg on Sun May 13, 2018 4:31 pm, edited 1 time in total.

drgerg
Posts: 44
Joined: Sun Nov 15, 2015 4:05 pm

Re: Generic build scripts

Postby drgerg » Sun May 13, 2018 4:30 pm

all of the packages installed using sudo apt-get package_name. I also did dpkg-query on each package before installing the package to make sure it wasn't installed already, a few were, most weren't.

Some of the packages took like 10-15 minutes to download and install. I had time to eat breakfast during one package, and during another, I had time to wash the dishes in the sink. Thus, when I do a full up test of the script on Raspbian, I am going to expect that it will take an hour.

I need to take a break, and do husbandly duties on this Mother's Day. I doubt I will have a chance to do any more testing today.

drgerg
Posts: 44
Joined: Sun Nov 15, 2015 4:05 pm

Re: Generic build scripts

Postby drgerg » Sun May 13, 2018 11:54 pm

for all the Linux newbs like me, once you download the .sh file (it's like a .bat file in windows), there's one extra step that you have to do--you have to mark the .sh file as executable. Simply right click on the file and select properties. Click on the permissions tab, and set the entry for Execute to be Only Owner.

Then to execute the command (after opening a command window), I needed to learn to type ./ in front of the name of Cazfi's install script.

Also, I assumed that I could just put 2.5 as an argument when executing the script. No, Cazfi's script needs 2.5.10 or 2.5.11.

Hope this helps other Linux newbs (last time I worked on an -ix system, it wasn't -ix, it was -ics as in Multics which kinda dates me).

drgerg
Posts: 44
Joined: Sun Nov 15, 2015 4:05 pm

Re: Generic build scripts

Postby drgerg » Mon May 14, 2018 4:22 am

Cazfi, I think your mint script works fine on a Raspberry Pi using Raspian as the OS. As I mentioned earlier, I manually installed each package that was listed in your mint script--it helped me learn Linux. Then I ran the script and once I got the parameters input correctly, the script did what it was supposed to do.

I was able to find the freeciv-server executable and did a -v. It returned 2.5.11. I then started the free-civ server on the Raspberry Pi, and connected to it from freeciv-GTK2 client running on Windows 10. I also started a freeciv-gtk2 client on the Raspberry Pi, and connected to the same game. I generated a large random map 300x400 or so, and started the game, and played one round.

The model Raspberry Pi that I have isn't the newest one. I bought it about a week before the most recent one became available.

For anyone that is thinking about running FreeCiv-server on a Raspberry Pi, it's doable. However, please be patient with Cazfi's script. It will probably run up to two hours. I will buy a new memory card, and let this script download everything--I will time it and report back.

Also, I have no idea how long the end of turn processing will take once I am in about 100 turns or 200 turns. It will take me several weeks to get to that point.

So again, Cazfi, thanks for your time creating this script.

drgerg
Posts: 44
Joined: Sun Nov 15, 2015 4:05 pm

Re: Generic build scripts

Postby drgerg » Sat May 26, 2018 10:47 pm

drgerg wrote: I have no idea how long the end of turn processing will take once I am in about 100 turns or 200 turns.


So, I am about 100 turns in, playing the Europe scenario with 10 AI and 2 players. The end of turn processing is taking about 25 to 30 seconds after the game save and before the units start moving. This is a bit slower than what today's typical computer can do.

drgerg
Posts: 44
Joined: Sun Nov 15, 2015 4:05 pm

Re: Generic build scripts

Postby drgerg » Thu Jun 07, 2018 12:05 am

drgerg wrote:For anyone that is thinking about running FreeCiv-server on a Raspberry Pi, it's doable. However, please be patient with Cazfi's script. It will probably run up to two hours. I will buy a new memory card, and let this script download everything--I will time it and report back.


Better late than never. :roll: So I loaded up an 4 year old Raspberry Pi and a slow SD card with a current version of Raspian, applied all the updates (apt-get). I then downloaded Cazfi's script and ran it for 2.5.11 and GTK2. My estimate of 2 hours was a bit low. It was just over 2.5 hours for the script to complete.

So, now I have two PIs that can run FreeCiv.

Cazfi, thanks again for the script.