From b1d04be2a331e09afb88495e8063ae2773fdbb84 Mon Sep 17 00:00:00 2001 From: Raffael Mancini Date: Sat, 25 Oct 2014 17:05:28 +0200 Subject: [PATCH 1/3] New package: python-box2d. The Python bindings of the c++ game physics library box2. --- .../python-modules/box2d/disable-test.patch | 14 +++++++++++ pkgs/top-level/python-packages.nix | 24 +++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 pkgs/development/python-modules/box2d/disable-test.patch diff --git a/pkgs/development/python-modules/box2d/disable-test.patch b/pkgs/development/python-modules/box2d/disable-test.patch new file mode 100644 index 00000000000..bc2897a8b10 --- /dev/null +++ b/pkgs/development/python-modules/box2d/disable-test.patch @@ -0,0 +1,14 @@ +Common subdirectories: Box2D-2.3b0/Box2D and Box2D-2.3b0.new/Box2D +Common subdirectories: Box2D-2.3b0/examples and Box2D-2.3b0.new/examples +Common subdirectories: Box2D-2.3b0/library and Box2D-2.3b0.new/library +diff -u Box2D-2.3b0/setup.py Box2D-2.3b0.new/setup.py +--- Box2D-2.3b0/setup.py 2013-02-02 18:09:34.000000000 +0100 ++++ Box2D-2.3b0.new/setup.py 2014-10-25 13:32:07.136922343 +0200 +@@ -176,7 +176,6 @@ + package_dir = {'Box2D': library_path, + 'Box2D.b2': os.path.join(library_path, 'b2'), + 'Box2D.tests' : 'tests'}, +- test_suite = 'tests', + options = { 'build_ext': { 'swig_opts' : swig_arguments }, + 'egg_info' : { 'egg_base' : library_base }, + }, diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 809e648e910..45721731d37 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1056,6 +1056,30 @@ let }; }; + box2d = buildPythonPackage rec { + name = "box2d-${version}"; + version = "2.3b0"; + + src = pkgs.fetchurl { + url = "https://pypi.python.org/packages/source/B/Box2D/Box2D-2.3b0.zip"; + md5="25fc4f69cd580bdca0022ac3ace53865"; + }; + + patches = [ ../development/python-modules/box2d/disable-test.patch ]; + + propagatedBuildInputs = [ pkgs.swig pkgs.box2d ]; + + meta = with stdenv.lib; { + homepage = https://code.google.com/p/pybox2d/; + description = '' + A 2D game physics library for Python under + the very liberal zlib license + ''; + license = license.zlib; + platforms = platforms.all; + maintainers = [ maintainers.sepi ]; + }; + }; # bugz = buildPythonPackage (rec { # name = "bugz-0.9.3"; From f18ede23bff3e94b153cb1b0a0cbdd23b2146402 Mon Sep 17 00:00:00 2001 From: Raffael Mancini Date: Sat, 25 Oct 2014 17:25:47 +0200 Subject: [PATCH 2/3] fixed typo --- pkgs/top-level/python-packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 45721731d37..790015af2e6 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1075,7 +1075,7 @@ let A 2D game physics library for Python under the very liberal zlib license ''; - license = license.zlib; + license = licenses.zlib; platforms = platforms.all; maintainers = [ maintainers.sepi ]; }; From b1dfef0f87a55d6005002fd5cc94ba2fd037e8ca Mon Sep 17 00:00:00 2001 From: Raffael Mancini Date: Sat, 25 Oct 2014 17:54:13 +0200 Subject: [PATCH 3/3] python-box2d: disable for python > 2.7 --- pkgs/top-level/python-packages.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 790015af2e6..000ff72bd48 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1059,6 +1059,7 @@ let box2d = buildPythonPackage rec { name = "box2d-${version}"; version = "2.3b0"; + disabled = (!isPy27); src = pkgs.fetchurl { url = "https://pypi.python.org/packages/source/B/Box2D/Box2D-2.3b0.zip";