1{
2 stdenv,
3 lib,
4 buildPythonPackage,
5 fetchPypi,
6 python,
7 cffi,
8 pytestCheckHook,
9 pythonOlder,
10 ApplicationServices,
11}:
12
13buildPythonPackage rec {
14 pname = "pymunk";
15 version = "6.5.2";
16 format = "setuptools";
17
18 disabled = pythonOlder "3.7";
19
20 src = fetchPypi {
21 inherit pname version;
22 extension = "zip";
23 hash = "sha256-AV6upaZcnbKmQm9tTItRB6LpckappjdHvMH/awn/KeE=";
24 };
25
26 propagatedBuildInputs = [ cffi ];
27
28 buildInputs = lib.optionals stdenv.isDarwin [ ApplicationServices ];
29
30 preBuild = ''
31 ${python.pythonOnBuildForHost.interpreter} setup.py build_ext --inplace
32 '';
33
34 nativeCheckInputs = [ pytestCheckHook ];
35
36 pytestFlagsArray = [ "pymunk/tests" ];
37
38 pythonImportsCheck = [ "pymunk" ];
39
40 meta = with lib; {
41 description = "2d physics library";
42 homepage = "https://www.pymunk.org";
43 changelog = "https://github.com/viblo/pymunk/releases/tag/${version}";
44 license = with licenses; [ mit ];
45 maintainers = with maintainers; [ emilytrau ];
46 platforms = platforms.unix;
47 };
48}