[$] pkg-config --static --libs glfw3
Package x11 was not found in the pkg-config search path.
Perhaps you should add the directory containing `x11.pc'
to the PKG_CONFIG_PATH environment variable
Package 'x11', required by 'glfw3', not found
If I add xorg.libX11 to the expression I get another error saying pthread-stubs not found.
What is the correct way of handling transitive dependencies in nix shells?
We add the dependencies listed in the Requires section of the .pc file into propagatedBuildInputs of the package but sometimes this is forgotten.
We do not do this for Requires.private which are only required for static linking since it is superfluous in normal operation. I am not sure if there is other way than collecting the dependencies manually or using something like let deps = pkg: (pkg.buildInputs or []) ++ (pkg.propagatedBuildInputs or []); collect = pkg: lib.unique (deps pkg ++ lib.concatMap collect (deps pkg)); in collect xorg.libX11.