Author Topic: Nightly .deb packages for Linux  (Read 2589 times)

0 Members and 1 Guest are viewing this topic.

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 15688
  • Total likes: 395
  • Helpful: 174
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Nightly .deb packages for Linux
« on: November 29, 2016, 10:59:00 PM »
I have just started testing a system to create .deb packages for Linux (Ubuntu, Debian, Gentoo, etc.) for Simutrans-Extended's latest nightly builds. I have not tested this yet, so I should be interested in anyone's experiences of how this works.

This includes the graphical executable, makeobj, nettool, Pak128.Britain-Ex and Pak128.Sweden-Ex (both the latest nightlies from the half-heights branch). They are available below.

Nightly .deb packages

I should be grateful if people could let me know whether this works.

Edit: I think that these will need some work to get these in the correct paths so that it runs properly from the command line.
« Last Edit: February 14, 2017, 12:01:49 AM by jamespetts »
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline Vladki

Re: Nightly .deb packages for Linux
« Reply #1 on: December 03, 2016, 12:16:19 PM »
I have tried the deb package on Debian Jessie (8.x current stable), but it does not install because of unmet dependencies. You specify dependency on libpng, but the package is libpng12-0. More over there should be much more dependencies. dh_shlibdeps may be helpful to make the dependencies right.
Also putting all files in /usr/local/bin/simutrans/ is imho not the "right way". There should be only executables in /usr/local/bin/. One way would be to put everything in /opt/simutrans/ and symlink the executables in /usr/local/bin/ or /usr/local/games/.

Perhaps the easiest way would be to get the source package from debian - simutrans is already there, just it is standard version 111.2.2, and modify the package to contain simutrans experimental. Also the package is split into binary (arch dependent), data (arch independent) and paksets. Just do apt-get source simutrans, and fiddle with it.

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 15688
  • Total likes: 395
  • Helpful: 174
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Nightly .deb packages for Linux
« Reply #2 on: December 03, 2016, 04:16:00 PM »
Thank you for that feedback. I am entirely new to creating Debian packages, so do forgive me if I have missed a few things.

For reference, here is the control file:

Code: [Select]
Package: simutrans-ex
Version: 12.9000
Section: base
Priority: optional
Architecture: amd64
Depends: libpng
Maintainer: James E. Petts <jamespetts@yahoo.com>
Description: Simutrans-Experimental

And here is the shell script that I use to create the package:

Code: [Select]
echo "Package creater for Simutrans-Ex"
echo
# TODO: Set the version numbesr automatically somehow
major_version=12
minor_version=9000
revision=14

name=simutrans-ex_$major_version.$minor_version.$revision
dir_name=/usr/share/games/package/$name

mkdir $dir_name
mkdir $dir_name/usr
mkdir $dir_name/usr/local
mkdir $dir_name/usr/local/bin

echo
echo "Copying executables"
cp -rf /usr/share/games/nightly/simutrans-experimental/simutrans $dir_name/usr/local/bin
cp /usr/share/games/nightly/simutrans-experimental/build/default/simutrans-experimental $dir_name/usr/local/bin/simutrans/simutrans-experimental
chmod 777 $dir_name/usr/local/bin/simutrans/simutrans-experimental
cp /usr/share/games/nightly/simutrans-experimental/build/default/makeobj-experimental/makeobj-experimental $dir_name/usr/local/bin/simutrans/makeobj-experimental
chmod 777 $dir_name/usr/local/bin/simutrans/makeobj-experimental
cp /usr/share/games/nightly/simutrans-experimental/build/default/nettool/nettool $dir_name/usr/local/bin/simutrans/nettool
chmod 777 $dir_name/usr/local/bin/simutrans/nettool

echo
echo "Copying pakset files"
cp -rf /usr/share/games/nightly/simutrans-pak128.britain/pak128.Britain-Ex $dir_name/usr/local/bin/simutrans/
cp -rf /usr/share/games/nightly/Pak128.Sweden-Ex/Pak128.Sweden-Ex $dir_name/usr/local/bin/simutrans/

# TODO: Find a way of downloading the latest translation texts here

echo
echo "Creating control file"
mkdir $dir_name/DEBIAN
# TODO: Make the version numbers in control automatic
cp /usr/share/games/package/control $dir_name/DEBIAN

echo
echo "Building package"
cd $dir_name
cd ..
dpkg-deb --build $name
echo
echo "Moving package to the download directory"
mv /usr/share/games/package/$name.deb /var/www/downloads/nightly/packages
echo
echo "Complete"

If you would like to post improved versions of both of those, that would be exceedingly helpful.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline Vladki

Re: Nightly .deb packages for Linux
« Reply #3 on: December 03, 2016, 09:10:58 PM »
Well the trick is that you should not make your own script, but produce a "rules" file, which is a Makefile that does all what's needed - compile, and make the package.
I may try adapting the debian package to sim-ex, but it might be better and faster to get in contact with debian maintainers of simutrans package. Contacts here: https://tracker.debian.org/pkg/simutrans

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 15688
  • Total likes: 395
  • Helpful: 174
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Nightly .deb packages for Linux
« Reply #4 on: December 03, 2016, 10:22:32 PM »
Where would I find the rules file in the directory to which you linked?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline Vladki

Re: Nightly .deb packages for Linux
« Reply #5 on: December 03, 2016, 10:35:29 PM »
The best way is to enable deb-src lines in your /etc/apt/sources.list, e.g:
deb http://debian.mirror.dkm.cz/debian/ jessie main non-free contrib
deb-src http://debian.mirror.dkm.cz/debian/ jessie main non-free contrib
(similar for ubuntu, just change your mirror and version)
apt-get update
apt-get install dpkg-dev
apt-get source simutrans

The last command will download and unpack the "source" package. You will get a simutrans-120.x.x folder with the simutrans-standard sources, but with an extra "debian" directory, where all packaging stuff is. Also a few debian specific patches will be applied, most notably the paths where to find stuff (~/.simutrans/...; /usr/share/games/simutrans/...), and also config.default is provided.

The easy part is to remove patches you do not want to be applied, and rename the package in debian/control, check if debian/rules is OK. Then the main issue will be to replace the standard sources with experimental. There are also some helper targets in debian/rules to get fresh sources from SVN@SF, so that would have to change to github.


Offline jamespetts

  • Simitrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 15688
  • Total likes: 395
  • Helpful: 174
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Nightly .deb packages for Linux
« Reply #6 on: December 11, 2016, 10:04:56 PM »
I have just modified my control file to change libpng to libpng12-0. I do not currently have time to look into using rules, but can somebody check after to-morrow morning to see whether this now works? I should be most grateful.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline ras52

Re: Nightly .deb packages for Linux
« Reply #7 on: April 25, 2017, 01:48:40 PM »
Are the nightly .deb builds still supposed to be working?  The simutrans-experimental binary in the 25 April build (filename simutrans-ex_12.9000.14.deb) is dying on start up with the message: "Incompatible pak file version for Simutrans-Ex, number 3".  This happens with all three paksets that are supplied in the .deb: pak128.Britain-Ex, Pak128.Britain-Ex and Pak128.Sweden-Ex.  (I assume there are not supposed to be two copies of pak128.Britain-Ex, differing only in their capitalisation.) In case it's of help debugging, the title bar gives the simutrans version as "Simutrans 120.1.2 Experimental Nightly development build 12.9000 - rb565bf4". 
Richard Smith

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 15688
  • Total likes: 395
  • Helpful: 174
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Nightly .deb packages for Linux
« Reply #8 on: April 25, 2017, 02:06:54 PM »
This is odd - it looks as though the binary version in the nightly .deb builds is a much older version, and is now incompatible with the latest pakset version. I will have to look into this when I get a chance. Thank you for the report.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline ras52

Re: Nightly .deb packages for Linux
« Reply #9 on: April 26, 2017, 01:53:55 PM »
it looks as though the binary version in the nightly .deb builds is a much older version, and is now incompatible with the latest pakset version.

Thanks.  That was exactly the problem.  The version of the simutrans-experimental binary in the .deb is from 11 Feb 2017 according to the version string embedded in the binary.  However if I overwrite it with the the nightly simutrans-extended linux-x64 binary downloaded from bridgewater-brunel, it works just fine.  As 11 Feb is the day you renamed it from "Experimental" to "Extended", and as the binary in the .deb is still called the former, I'm guessing the problem is just that you're copying the old binary into the .deb, so hopefully this is an easy one to fix.

(I also note that the .deb is a missing dependency on the libsdl2-2.0-0 package.)
Richard Smith