1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 cython,
6 fetchFromGitHub,
7 libstatgrab,
8 pkg-config,
9 pythonOlder,
10 setuptools,
11 unittestCheckHook,
12 wheel,
13 darwin,
14}:
15
16buildPythonPackage rec {
17 pname = "pystatgrab";
18 version = "0.7.2";
19 pyproject = true;
20
21 disabled = pythonOlder "3.7";
22
23 src = fetchFromGitHub {
24 owner = "libstatgrab";
25 repo = "pystatgrab";
26 rev = "PYSTATGRAB_${lib.replaceStrings [ "." ] [ "_" ] version}";
27 hash = "sha256-0FDhkIK8jy3/SFmCzrl9l4RTeIKDjO0o5UoODx6Wnfs=";
28 };
29
30 build-system = [
31 setuptools
32 wheel
33 ];
34
35 nativeBuildInputs = [
36 cython
37 pkg-config
38 ];
39
40 buildInputs = [
41 libstatgrab
42 ] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ IOKit ]);
43
44 nativeCheckInputs = [ unittestCheckHook ];
45
46 pythonImportsCheck = [ "statgrab" ];
47
48 meta = with lib; {
49 description = "Python bindings for libstatgrab";
50 homepage = "https://github.com/libstatgrab/pystatgrab";
51 changelog = "https://github.com/libstatgrab/pystatgrab/blob/PYSTATGRAB_${
52 lib.replaceStrings [ "." ] [ "_" ] version
53 }/NEWS";
54 license = licenses.lgpl21Only;
55 maintainers = with maintainers; [ fab ];
56 };
57}