Merge: matrix-synapse: 1.122.0 -> 1.123.0 (#378018)
[NixPkgs.git] / pkgs / development / python-modules / pkgconfig / default.nix
blobaa69c7f286ca9bfe50ade4eeb03ef546dd164dc8
2   lib,
3   buildPythonPackage,
4   fetchFromGitHub,
5   pythonOlder,
6   poetry-core,
7   pkg-config,
8   pytestCheckHook,
9 }:
11 buildPythonPackage rec {
12   pname = "pkgconfig";
13   version = "1.5.5";
14   format = "pyproject";
16   inherit (pkg-config)
17     setupHooks
18     wrapperName
19     suffixSalt
20     targetPrefix
21     baseBinName
22     ;
24   src = fetchFromGitHub {
25     owner = "matze";
26     repo = "pkgconfig";
27     rev = "v${version}";
28     hash = "sha256-uuLUGRNLCR3NS9g6OPCI+qG7tPWsLhI3OE5WmSI3vm8=";
29   };
31   postPatch = ''
32     substituteInPlace pkgconfig/pkgconfig.py \
33       --replace "pkg_config_exe = os.environ.get('PKG_CONFIG', None) or 'pkg-config'" "pkg_config_exe = '${pkg-config}/bin/${pkg-config.targetPrefix}pkg-config'"
35     # those pc files are missing and pkg-config validates that they exist
36     substituteInPlace data/fake-openssl.pc \
37       --replace "Requires: libssl libcrypto" ""
38   '';
40   nativeBuildInputs = [ poetry-core ];
42   # ModuleNotFoundError: No module named 'distutils'
43   # https://github.com/matze/pkgconfig/issues/64
44   doCheck = pythonOlder "3.12";
46   nativeCheckInputs = [ pytestCheckHook ];
48   pythonImportsCheck = [ "pkgconfig" ];
50   meta = with lib; {
51     description = "Interface Python with pkg-config";
52     homepage = "https://github.com/matze/pkgconfig";
53     license = licenses.mit;
54     maintainers = with maintainers; [ nickcao ];
55   };