Deploying your allegro game for linux
Ariesnl

I finally switched to Linux (mint) for good..
And I use Code:: blocks as an IDE, so I'm not realy used to makefiles.

Can anyone tell me step by step how I should bundle my game so others can install and play the game ?

I have no problem with releasing my code, it's open source anyway !

Edgar Reynaldo

Static link as much as you can (You can't static link everything) and then use ldd to determine which .so libraries your program depends on. Package those with your game, and use a startup script to add the library path to LD_LIBRARY_PATH at runtime.

Ariesnl

I found this nice command: ldd file | grep "=> /" | awk '{print $3}' | xargs -I '{}' cp -v '{}' /destination

So all used .so libs are now in a "shared" folder in the root of my release version..
Now how would that startup script look like ?

Edgar Reynaldo

It's really simple :

runme

export OLD_PATH=$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=./shared/:$LD_LIBRARY_PATH
./mygame
export LD_LIBRARY_PATH=$OLD_PATH

Ariesnl

Seems to work !
Thnx..

I'll put up a version this week ;D;)

dthompson

I'd recommend giving these bad bois a look too: https://appimage.org/

Ariesnl

that is a good suggestion dthompson..

btw I've added Khan to the game ;D

{"name":"1k0.jpg","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/5\/d\/5d597f042927deb810c7d9edf079df31.jpg","w":1024,"h":768,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/5\/d\/5d597f042927deb810c7d9edf079df31"}1k0.jpg

bamccaig

export LD_LIBRARY_PATH=$OLD_PATH

No need to restore it. The script is executed in a subprocess with its own copy of the environment. When the script exits the process ends and the shell that spawned it takes control again with its original environment.

(That is not generally the case with batch scripting in DOS/Windows, but in Unix-like systems I think all of the shells operate that way...)

Edgar Reynaldo

Okay, thanks. Wasn't sure if the ENV was inherited or not.

Thread #618064. Printed from Allegro.cc