SFML community forums

Help => General => Topic started by: argoneus on June 09, 2012, 11:52:44 am

Title: How to distribute my game most user-friendly from Linux to Win/Linux?
Post by: argoneus on June 09, 2012, 11:52:44 am
I was wondering about this. I currently have SFML libraries installed in /usr/local on my Linux machine so I can link against those with -lsfml-graphics etc., but how should I distribute the game to a machine both Linux and Windows which doesn't have SFML installed anywhere (and also without the user having to install stuff himself)?

If it helps, I'm using Netbeans C++ for this.
Title: Re: How to distribute my game most user-friendly from Linux to Win/Linux?
Post by: thePyro_13 on June 09, 2012, 12:30:15 pm
For windows, just put the dll's in the same directory as the executable. Or statically link.

By this I mean you should distribute the correct dll's with your game.
Title: Re: How to distribute my game most user-friendly from Linux to Win/Linux?
Post by: eXpl0it3r on June 09, 2012, 07:49:41 pm
It's common to have seperate packages for each platform.

For a Windows release just put the .exe, .dll and other ressource files into a ZIP or something like that.
For a Linux release you could also just provide the binary and a list for all the dependencies, but I've no idea how it's done best in Linux.
Title: Re: How to distribute my game most user-friendly from Linux to Win/Linux?
Post by: takoa on June 10, 2012, 04:30:08 pm
Hi, I'm a Linux user, so I will tell you how I expect to find things.
The following are only my opinions, it's not any rule.

The source tarball should only contains sources, no binary.
If you provide binary, the tarball should not contain any sources, but should tell where the sources can be found.

For building the sources don't use an exotic tool. Use something widely known and used.
Your build system should be configurable to find sfml in a non-standard location. Provide at least 2 variables to configure where to find SFML's include and SFML's .so libs. Tell in the README file how to use these 2 variables with an example.

If you provide a binary tarball, you may or may not also provide SFML's .so libs. If you don't tell where to download it. If you do write a "boot .sh" script that first set LD_LIRARY_PATH to the local path where the .so are, and then start your local ./program

LOCDIR=`dirname $0`
SFML_LIBS="${LOCDIR}/sfml_lib"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SFML_LIBS"
${LOCDIR}/program $*

If you don't provide sfml's .so, you can still provide this script, but tells in the README how to set the variable SFML_LIBS to the location of the sfml's so libs in case it is in a non-standard location.