I build the Linux installer (since I want to extract the executable from it) with:
pdeploy -v 0.1 -P linux_i386 foo.p3d installer
Now, I extract the executable foo from the file foo-0.1-1-i686.pkg.tar.gz and it works correctly.
But I need to build with the -s switch:
pdeploy -s -v 0.1 -P linux_i386 foo.p3d installer
If I run the executable foo obtained in this second case, it doesn’t work (I only see a white window). There are some folders inside the folder lib inside the file foo-0.1-1-i686.pkg.tar.gz, maybe I’m missing something about those. I tried arranging these folders beside the executable (and modifying the environment variable for libraries), but I can’t get it working.
How can I obtain a Linux standalone executable of my application? Thank you!
The path to the binaries in /usr/lib is hardcoded into the binary. If you want to create a binary with a different hardcoded path, you should run pdeploy in the “standalone” mode (without -s), (this will allow you to override the host_dir internal token, whereas the “installer” mode would simply override it for you) and manually hardcode the path by adding the flag:
-t host_dir=.
This will configure it to expect the panda3d binaries (that you can find in the package produced by the “installer” option with -s) in the directory that the executable is found. You can set it to any path relative to the binary, or of course an absolute path.
It’s a bit clumsy to have to do it this way, but what you’re doing isn’t exactly a standard or recommended procedure.
Another way might be to manually edit the executable, find the string that says /usr/lib/yourgame and replace it with the path you want. It’s a bit more risky, and I can’t guarantee that it will work, but it might be a bit easier.
Thank you so much! I’m trying your suggestions but maybe I’m doing something wrong (since my packages are ignored); I write here how I submit the commands.
I build the p3d file and the installer with -s, then I extract the packages and move them to the current folder.
Now, the executable and the packages are in the current folder, but if I run ./foo then it downloads the packages from internet, ignoring the available ones. Am I applying your suggestions in a wrong way? Thanks again!