we are working on an independent game and are planning to support Linux, but don't know how to best package it. Would you mind sharing your experience with us?
We want only a tar.gz archive for now. No distribution specific package, no installer. We also don't want to require the user to manually install required shared libraries, so we are shipping them. We cannot distribute the files across the filesystem as the FSHS would require, so it'll all go to /opt.
Do you know of any tools that aid in packaging for Linux with support for including shared libs? We use CMake for building, but it doesn't seem to support packaging.
Our game's (let's call it foo
structure currently looks like this:
For the package, we'll also need:
directory contains all required shared libraries. foo.sh
is a shell script that sets LD_LIBRARY_PATH
to include the libs
directory and launches the binary.
For packaging the software, we have a shell script that does the following:
- Create a directory and copy foo.sh to it
- Invoke the build process and make install into the new directory
- Copy shared libraries from the filesystem
- Package everything as tar.gz
What do you think of this approach? Are you doing it in a similar way?
There are some problems: We have to hard code all dependencies twice (once in CMake, once in the packaging script) and we have to define the version number twice (once in the source code, once in the packaging script). Any ideas?
Furthermore, we have difficulties to determine which shared libraries to ship, ldd foo
shows an awfully long list. How can we figure out which libraries are supposed to be part of a typical Linux distribution and which we'll have to ship? WorldOfGoo for instance ships only very few libraries.
We thought about picking a few distributions that we want to support (probably the top 4 from distrowatch) and see with what they ship. Is there a better way?