I'm trying to build i3status-rs from cargo with cargo build --release.
Pkg-config is complaining about not founding dbus-1.
pkg-config --libs --cflags dbus-1 ~> No package 'dbus-1' found
find /nix -name dbus-1.pc ~> /nix/store/
cargo build --release 2>err_log.txt
I tried to add dbus or dbus_libs, vainly.
Here is my step to install NixOS, and my configuration files.
"x86_64-linux"Linux 4.14.9, NixOS, 18.03pre123638.1258d9a4914 (Impala)yesnonix-env (Nix) 1.11.16"nixos-18.03pre123638.1258d9a4914"/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgsnix-shell -p cargo dbus pkgconfig --pure --run 'cargo build --release' works for me.
Well, you're right. I tried and it did it. But why it's not working normally?
As I understand it, the pkgconfig setup hook will add $(nix-build -A dbus.dev)/lib/pkgconfig to PKG_CONFIG_PATH. For it to be available globally, the contents of the variable generated by the setup hook would need to be copied into the environment, or the pc file would need to be added to one of the existing paths for example by adding environment.pathsToLink = [ "/lib/pkgconfig" ];. Obviously, this is not done because the environment is not supposed to be polluted by build dependencies – the right way is to write a nix expression, or, for temporary purposes, use nix-shell with -p option.
Most helpful comment
nix-shell -p cargo dbus pkgconfig --pure --run 'cargo build --release'works for me.