1{ stdenv
2, lib
3, buildPythonPackage
4, fetchPypi
5, python
6, cffi
7, pytestCheckHook
8, ApplicationServices
9}:
10
11buildPythonPackage rec {
12 pname = "pymunk";
13 version = "6.3.0";
14
15 src = fetchPypi {
16 inherit pname version;
17 extension = "zip";
18 sha256 = "sha256-er0+HuCQw2FPeyuBc1BVdutmidYzcKIBqdeteqwsXiA=";
19 };
20
21 propagatedBuildInputs = [ cffi ];
22 buildInputs = lib.optionals stdenv.isDarwin [
23 ApplicationServices
24 ];
25
26 preBuild = ''
27 ${python.interpreter} setup.py build_ext --inplace
28 '';
29
30 checkInputs = [ pytestCheckHook ];
31 pytestFlagsArray = [
32 "pymunk/tests"
33 ];
34 pythonImportsCheck = [ "pymunk" ];
35
36 meta = with lib; {
37 description = "2d physics library";
38 homepage = "https://www.pymunk.org";
39 license = with licenses; [ mit ];
40 maintainers = with maintainers; [ emilytrau ];
41 platforms = platforms.unix;
42 };
43}