#build-dependencies #manifest #metadata #pkg-config #build-depends

build metadeps

Run pkg-config from declarative dependencies in Cargo.toml

6 stable releases

1.1.2 May 30, 2017
1.1.1 Dec 28, 2016
1.1.0 Dec 26, 2016
1.0.2 Dec 25, 2016
1.0.1 Dec 15, 2016

#9 in Build Utils

Download history 3632/week @ 2018-10-17 4087/week @ 2018-10-24 3170/week @ 2018-10-31 3678/week @ 2018-11-07 3970/week @ 2018-11-14 3404/week @ 2018-11-21 3548/week @ 2018-11-28 3724/week @ 2018-12-05 4755/week @ 2018-12-12 4282/week @ 2018-12-19 2397/week @ 2018-12-26 5144/week @ 2019-01-02 5153/week @ 2019-01-09 5432/week @ 2019-01-16 5199/week @ 2019-01-23

7,193 downloads per month
Used in 49 crates (14 directly)

MIT/Apache

5KB
66 lines

metadeps lets you write pkg-config dependencies in Cargo.toml metadata, rather than programmatically in build.rs. This makes those dependencies declarative, so other tools can read them as well.

Usage

In your Cargo.toml, add the following to your [build-dependencies]:

metadeps = "1.1"

Then, to declare a dependency on testlib >= 1.2, and a conditional dependency on testdata >= 4.5, add the following section:

[package.metadata.pkg-config]
testlib = "1.2"
testdata = { version = "4.5", feature = "use-testdata" }

In your build.rs, add:

extern crate metadeps;

fn main() {
    metadeps::probe().unwrap();
}

lib.rs:

metadeps lets you write pkg-config dependencies in Cargo.toml metadata, rather than programmatically in build.rs. This makes those dependencies declarative, so other tools can read them as well.

metadeps parses metadata like this in Cargo.toml:

[package.metadata.pkg-config]
testlib = "1.2"
testdata = { version = "4.5", feature = "some-feature" }

Dependencies

~299KB