Nixpkgs: pkg-config not founding dbus-1

Created on 27 Dec 2017  Â·  3Comments  Â·  Source: NixOS/nixpkgs

Issue description

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/-dbus-1.10.24-dev/lib/pkgconfig/dbus-1.pc

cargo build --release 2>err_log.txt

I tried to add dbus or dbus_libs, vainly.

Steps to reproduce

Here is my step to install NixOS, and my configuration files.

Technical details

  • system: "x86_64-linux"
  • host os: Linux 4.14.9, NixOS, 18.03pre123638.1258d9a4914 (Impala)
  • multi-user?: yes
  • sandbox: no
  • version: nix-env (Nix) 1.11.16
  • channels(root): "nixos-18.03pre123638.1258d9a4914"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs
question rust

Most helpful comment

nix-shell -p cargo dbus pkgconfig --pure --run 'cargo build --release' works for me.

All 3 comments

nix-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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

langston-barrett picture langston-barrett  Â·  3Comments

edolstra picture edolstra  Â·  3Comments

tomberek picture tomberek  Â·  3Comments

ob7 picture ob7  Â·  3Comments

ayyess picture ayyess  Â·  3Comments