gchp / rustbox

Rust implementation of the termbox library
MIT License
469 stars 48 forks source link

Add termbox-sys package, statically link termbox #5

Closed tomjakubowski closed 9 years ago

tomjakubowski commented 9 years ago

This removes the system dependency on termbox, instead depending on the vendored package termbox-sys which will build termbox from source and link it statically.

By convention, *-sys libraries should also try to probe the current system for the library, using something like pkg-config, before resorting to building from source. However, my distribution's termbox package does not include pkg-config files at the moment, so adding this (very desirable!) functionality will need to wait for future work.

gchp commented 9 years ago

This is great! Thanks a mil for doing this, I hadn't thought of this at all.

I'm having trouble building it, though. Here's what I'm seeing:

Failed to run custom build command for `termbox-sys v0.0.1 (file:///home/gchp/github.com/gchp/rustbox)`
Process didn't exit successfully: `/home/gchp/github.com/gchp/rustbox/target/build/termbox-sys-f427388c3525ad90/build-script-build` (status=101)
--- stdout
waf configure: setting CFLAGS to: `-m64 -fPIC`
running: ./waf 'configure' '--prefix=/'

--- stderr
task '<main>' panicked at 'called `Result::unwrap()` on an `Err` value: no such file or directory', /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/src/libcore/result.rs:743

Looks like it's not finding the ./waf file maybe?

tomjakubowski commented 9 years ago

Hmm, this PR adds a submodule for termbox, did you do the git submodule init and git submodule update dance? That's the error I'm seeing on a fresh checkout where I forgot to do that.

gchp commented 9 years ago

Heh, nope. Once I did it worked perfectly. Thanks!