Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for pkg-config #5

Merged
merged 1 commit into from Nov 27, 2016
Merged

Added support for pkg-config #5

merged 1 commit into from Nov 27, 2016

Conversation

golddranks
Copy link
Contributor

@golddranks golddranks commented Nov 23, 2016

Supporting pkg-config will allow linking a whole bunch of native dependencies flexibly without specifying link flags for each and every one separately. Some *-sys crates support it in their build.rs scripts, but sadly not all. Trying to improve the situation bit by bit.

@sgrif sgrif merged commit 010d8c4 into sgrif:master Nov 27, 2016
@sgrif
Copy link
Owner

sgrif commented Dec 10, 2016

This appears to have broken 3ad9f7b, and I don't see an easy way to fix it. Ultimately the problem is that given the setup that cause the problem that commit fixed in the first place, pkg_config will end up putting /usr/local/lib ahead of the native search path, breaking everything.

I'm honestly not entirely sure what this actually adds over what was there before, either. However, I don't want to flat revert just yet, so I'm going to put it behind a feature flag.

@golddranks
Copy link
Contributor Author

golddranks commented Jan 4, 2017

Indeed, it seems that there isn't an easy way to fix it.

Btw. I did what I could: I posted a suggestion to the pkg-config crate to do the symlink-following thing (since that leads to the single-library-exclusive dirs which prevent conflicts. This works at least in the case of Homebrew, but I think some other packaging systems do this kind of namespacing too, so it should be generally a beneficial thing to do.) If they do that, it should prevent passing /usr/local/lib to Cargo. Here's the issue: rust-lang/pkg-config-rs#34

Also, I noticed that Homebrew .pc files were inconsistent: some declared the lib dir to be /usr/local/lib, and some declared directly the "private" install dir. The latter obviously causes less conflicts, so I sent an issue to Homebrew too. (However, I'm quite oblivious to their system so I don't know if it's going to help at all) Homebrew/homebrew-core#8472

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants