mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-28 16:42:09 +00:00
46f2b49b44
This setupHook is necessary for actually using pkgconfig. Without this setupHook, you need to put both pythonPackages.pkgconfig and pkgconfig into your buildInputs, just to get the setuphook of the latter. Previously, pythonPackages.pkgconfig depended on pkgconfig as a propagatedBuildInput, so this setupHook was propagated down to dependents. That was changed to a regular nativeBuildInput, so now this setupHook change is necessary for packages to only depend on pythonPackages.pkgconfig. A possible alternative is extracting out a common pkgconfigHook package and having both pythonPackages.pkgconfig and pkgconfig depend on that with propagatedBuildInputs. That might be necessary to avoid the buildHook running twice?
33 lines
759 B
Nix
33 lines
759 B
Nix
{ lib, buildPythonPackage, fetchPypi, nose, pkgconfig }:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "pkgconfig";
|
|
version = "1.4.0";
|
|
|
|
setupHook = pkgconfig.setupHook;
|
|
|
|
src = fetchPypi {
|
|
inherit pname version;
|
|
sha256 = "048c3b457da7b6f686b647ab10bf09e2250e4c50acfe6f215398a8b5e6fcdb52";
|
|
};
|
|
|
|
checkInputs = [ nose ];
|
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
|
|
|
checkPhase = ''
|
|
nosetests
|
|
'';
|
|
|
|
patches = [ ./executable.patch ];
|
|
postPatch = ''
|
|
substituteInPlace pkgconfig/pkgconfig.py --replace 'PKG_CONFIG_EXE = "pkg-config"' 'PKG_CONFIG_EXE = "${pkgconfig}/bin/pkg-config"'
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Interface Python with pkg-config";
|
|
homepage = https://github.com/matze/pkgconfig;
|
|
license = licenses.mit;
|
|
};
|
|
}
|