-
Notifications
You must be signed in to change notification settings - Fork 4
use pkg-config by default, fall back to source build automatically #25
Conversation
5edbdb3
to
7028b08
Compare
build.rs
Outdated
println!("building libproj from source"); | ||
if let Ok(val) = &env::var("_PROJ_SYS_TEST_EXPECT_BUILD_FROM_SRC") { | ||
if val != "1" { | ||
panic!("for testing purposes: package was building from source but should not have been"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to test some things about the build and this is the best I could come up with.
A failure looks like this: https://travis-ci.org/github/georust/proj-sys/jobs/726133697#L2410
WDYT?
03ec634
to
3a3deb8
Compare
889efb3
to
e532b1f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice PR! Only had minor suggestions to consider.
README.md
Outdated
|
||
A guide to the functions can be found here: https://proj.org/development/reference/functions.html. Run `cargo doc (optionally --open)` to generate the crate documentation. | ||
**This is a | ||
[`*-sys`](https://doc.rust-lang.org/cargo/reference/build-scripts.html#a-sys-packages) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This link doesn't point correctly. Did you mean https://doc.rust-lang.org/cargo/reference/build-scripts.html#-sys-packages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! Fixed.
src/lib.rs
Outdated
|
||
//! | ||
//! **This is a | ||
//! [`*-sys`](https://doc.rust-lang.org/cargo/reference/build-scripts.html#a-sys-packages) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This link also should be fixed #a-
-> #-
build.rs
Outdated
// Unwrap the Result and panic on failure. | ||
.expect("Unable to generate bindings"); | ||
.and_then(|pk| { | ||
println!("found acceptable libproj already installed at: {:?}", pk.link_paths[0]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be eprintln!
to not mess with stdout that cargo uses to pass options to rustc, etc.?
build.rs
Outdated
#[cfg(not(feature = "nobuild"))] | ||
fn main() -> Result<(), Box<dyn std::error::Error>> { | ||
let include_path = if cfg!(feature = "bundled_proj") { | ||
println!("feature flags specified source build"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should all the "info" messages print to stderr (eprintln!
) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cargo only looks at stdout lines that begin with "cargo:" - so this won't break anything, but I've switched it to eprintln. I'm fine with it either way.
Yep, great work. @rmanoka beat me to the prntln stuff – it won't show as output because the build script swallows it. |
bors r=rmanoka |
fixes georust/proj#40