6 stable releases

Uses old Rust 2015

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

#791 in Build Utils

Download history 5441/week @ 2024-12-15 2764/week @ 2024-12-22 3389/week @ 2024-12-29 4787/week @ 2025-01-05 7192/week @ 2025-01-12 5117/week @ 2025-01-19 4120/week @ 2025-01-26 6603/week @ 2025-02-02 5929/week @ 2025-02-09 5243/week @ 2025-02-16 4933/week @ 2025-02-23 4012/week @ 2025-03-02 4652/week @ 2025-03-09 5210/week @ 2025-03-16 5161/week @ 2025-03-23 3499/week @ 2025-03-30

18,728 downloads per month
Used in 106 crates (23 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.

metadeps parses metadata like this in Cargo.toml:

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

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();
}

Dependencies

~260KB