tomassedovic / tcod-rs

Rust bindings for libtcod 1.6.3 (the Doryen library/roguelike toolkit)
Do What The F*ck You Want To Public License
229 stars 45 forks source link

How to distribute finished game to one directory with CI? #298

Open saintech opened 5 years ago

saintech commented 5 years ago

Is there an easy way to automate copying shared libs to a binary location for all three platforms (win, osx, linux)? For example for Travis? The problem is that when i use cargo build --release, it puts shared libs in paths like build/tcod-sys-395905244d0762cd/out, and i don't know what commands i should use to create a release ZIP for all platforms.

tomassedovic commented 5 years ago

Sorry, I'm not sure :-(. There's OUT_DIR which is accessible in Cargo build scripts, but I don't know how to get one for a dependency (which is what you want here).

Here's what I used to do in my game when I was using tcod:

https://gitlab.com/tryjumping/dose-response/blob/911e420c13e63cf903f6ddfd5b0e31cfc2f8d82f/ci/before_deploy.sh#L23-29

It's not super pretty, but it worked. This was before any of the CIs (that I knew) had Windows, Linux and Mac support so I had a separate scripts for each platform.

Note that at least on Linux (and I'm pretty sure Mac too) just copying the DLL next to the binary does not work. You need to either set the right environment variables (e.g. LD_LIBRARY_PATH) or configure your binary to look in the right place.

saintech commented 5 years ago

This is very important information, because the task is very popular in home gamedev, but the information is impossible to find. Thank you, you really helped. I will try to finish my CI config.

Maybe some of this information should be added to the README/Wiki?

tomassedovic commented 5 years ago

Yeah absolutely. Would you be open to putting up a pull request at some point?

I'd prefer to have it in the readme (or a separate file linked from there if it's too big) -- that way it's always there if you clone the repo.

saintech commented 5 years ago

Yeah absolutely. Would you be open to putting up a pull request at some point?

Yeah, I'd like to, but not soon. I need to resolve this issue in my playground project first.

I'd prefer to have it in the readme (or a separate file linked from there if it's too big) -- that way it's always there if you clone the repo.

OK 👍