gdesmott / system-deps

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

can't detect library #68

Closed TornaxO7 closed 1 year ago

TornaxO7 commented 1 year ago

Hello! Thank you for this crate first of all :)

I'm using Arch linux and if I execute the following:

cd /usr/lib
rg --files | rg libgbm

than I'm getting the following output:

libgbm.so.1.0.0

in other words, /usr/lib/libgbm.so.1.0.0 exist.

But if I have the following in my Cargo.toml:

[package.metadata.system-deps]
libgbm = "1.0.0"

I'm getting the following error message, if I try cargo build:

  thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: PkgConfig(`PKG_CONFIG_ALLOW_SYSTEM_CFLAGS="1" "pkg-config" "--libs" "--cflags" "libgbm" "libgbm >= 1.0.0"` did not exit successfully: exit status: 1
  error: could not find system library 'libgbm' required by the 'rust_tmp' crate

May I ask what I'm doing wrong?

Reproduction steps

I created a repository for you, so you don't need to create directories and stuff through the terminal. Just clone my repository and run cargo build. You'll just need to take a look into the build.rs and Cargo.toml :) I hope it helps!

gdesmott commented 1 year ago

pkg-config needs the library .pc file as well, which is generally provided by devel packages (I don't know about Arch).

So you'd need libgbm.pc but I checked on my system and I actually have gbm.pc so I suppose you should use gbm as your dependency.

TornaxO7 commented 1 year ago

pkg-config needs the library .pc file as well (...) so .pc and .so are required or is only .pc required?

gdesmott commented 1 year ago

yes, you need both to be able to build and link.

TornaxO7 commented 1 year ago

Alright, thank you for the information!