about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/pybullet
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/pybullet')
-rw-r--r--nixpkgs/pkgs/development/python-modules/pybullet/default.nix34
-rw-r--r--nixpkgs/pkgs/development/python-modules/pybullet/static-libs.patch13
2 files changed, 47 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/pybullet/default.nix b/nixpkgs/pkgs/development/python-modules/pybullet/default.nix
new file mode 100644
index 000000000000..944278ce3c2c
--- /dev/null
+++ b/nixpkgs/pkgs/development/python-modules/pybullet/default.nix
@@ -0,0 +1,34 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, libGLU_combined
+, xorg
+}:
+
+buildPythonPackage rec {
+  pname = "pybullet";
+  version = "2.4.8";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "0b6dkrac5zydxqfrf827xhamsimychrn77dsfnz1kf7c1crlwcw9";
+  };
+
+  buildInputs = [
+    libGLU_combined
+    xorg.libX11
+  ];
+
+  patches = [
+    # make sure X11 and OpenGL can be found at runtime
+    ./static-libs.patch
+  ];
+
+  meta = with lib; {
+    description = "Open-source software for robot simulation, integrated with OpenAI Gym";
+    homepage = https://pybullet.org/;
+    license = licenses.zlib;
+    maintainers = with maintainers; [ timokau ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/python-modules/pybullet/static-libs.patch b/nixpkgs/pkgs/development/python-modules/pybullet/static-libs.patch
new file mode 100644
index 000000000000..08a68b814866
--- /dev/null
+++ b/nixpkgs/pkgs/development/python-modules/pybullet/static-libs.patch
@@ -0,0 +1,13 @@
+diff --git a/setup.py b/setup.py
+index 98efabdbf..e69e79084 100644
+--- a/setup.py
++++ b/setup.py
+@@ -563,6 +563,8 @@ print("-----")
+ 
+ extensions = []
+ 
++libraries += [ "X11", "GL" ] # statically link x11 and opengl
++
+ pybullet_ext = Extension("pybullet",
+         sources =  sources,
+         libraries = libraries,