1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, swig
5}:
6
7buildPythonPackage rec {
8 pname = "pybox2d";
9 version = "2.3.10";
10 format = "setuptools";
11
12 src = fetchFromGitHub {
13 owner = "pybox2d";
14 repo = "pybox2d";
15 rev = "refs/tags/${version}";
16 hash = "sha256-yjLFvsg8GQLxjN1vtZM9zl+kAmD4+eS/vzRkpj0SCjY=";
17 };
18
19 nativeBuildInputs = [
20 swig
21 ];
22
23 # We need to build the package explicitly a first time so that the library/Box2D/Box2D.py file
24 # gets generated.
25 # After that, the default behavior will succeed at installing the package.
26 preBuild = ''
27 python setup.py build
28 '';
29
30 pythonImportsCheck = [
31 "Box2D"
32 "Box2D._Box2D"
33 ];
34
35 # Tests need to start GUI windows.
36 doCheck = false;
37
38 meta = with lib; {
39 description = "2D Game Physics for Python";
40 homepage = "https://github.com/pybox2d/pybox2d";
41 license = licenses.zlib;
42 maintainers = with maintainers; [ GaetanLepage ];
43 };
44}