gdesmott / system-deps

Run pkg-config from declarative dependencies in Cargo.toml
Apache License 2.0
89 stars 21 forks source link

Add support for providing version ranges to pkg-config #60

Closed sdroege closed 1 year ago

sdroege commented 2 years ago

This needs calling https://docs.rs/pkg-config/latest/pkg_config/struct.Config.html#method.range_version and some syntax for specifying this in Cargo.toml.

gdesmott commented 2 years ago

Which syntax should we use for this? The cargo or pkg-config one?

sdroege commented 2 years ago

Maybe something that you can parse directly into a range, so maybe just the Rust syntax? 0.1.0..=0.9.0 (for >=0.1.0, <= 0.9.0), 0.1.0..0.9.0 (for >= 0.1.0, << 0.9.0)

gdesmott commented 2 years ago

Wouldn't it make more sense to use the cargo syntax has it's in the same file? https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html And there may already have parsing code for those.

sdroege commented 2 years ago

Sure if you want to parse those to exact / at least / range

sdroege commented 2 years ago

You could use https://docs.rs/semver/latest/semver/ and then convert the result of that to one of the cases pkg-config understands. Converting the VersionReq vec of comparators seems like a bit of work though.

sdroege commented 1 year ago

I'm working on this now