python.pkgs.roboschool: init at 1.0.39 (#58451)

Needs a forked version of bullet.
This commit is contained in:
Timo Kaufmann 2019-03-27 21:26:54 +00:00 committed by GitHub
parent a921f8a1d1
commit e7a084bdba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 138 additions and 0 deletions

View file

@ -0,0 +1,57 @@
{ stdenv, fetchFromGitHub, cmake, libGLU_combined, freeglut
, Cocoa, OpenGL
}:
stdenv.mkDerivation rec {
name = "bullet-${version}";
version = "2019-03-27";
src = fetchFromGitHub {
owner = "olegklimov";
repo = "bullet3";
# roboschool needs the HEAD of a specific branch of this fork, see
# https://github.com/openai/roboschool/issues/126#issuecomment-421643980
# https://github.com/openai/roboschool/pull/62
# https://github.com/openai/roboschool/issues/124
rev = "3687507ddc04a15de2c5db1e349ada3f2b34b3d6";
sha256 = "1wd7vj9136dl7lfb8ll0rc2fdl723y3ls9ipp7657yfl2xrqhvkb";
};
nativeBuildInputs = [ cmake ];
buildInputs = stdenv.lib.optionals stdenv.isLinux [ libGLU_combined freeglut ]
++ stdenv.lib.optionals stdenv.isDarwin [ Cocoa OpenGL ];
patches = [ ./gwen-narrowing.patch ];
postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
sed -i 's/FIND_PACKAGE(OpenGL)//' CMakeLists.txt
sed -i 's/FIND_LIBRARY(COCOA_LIBRARY Cocoa)//' CMakeLists.txt
'';
cmakeFlags = [
"-DBUILD_SHARED_LIBS=ON"
"-DBUILD_CPU_DEMOS=OFF"
"-DINSTALL_EXTRA_LIBS=ON"
] ++ stdenv.lib.optionals stdenv.isDarwin [
"-DOPENGL_FOUND=true"
"-DOPENGL_LIBRARIES=${OpenGL}/Library/Frameworks/OpenGL.framework"
"-DOPENGL_INCLUDE_DIR=${OpenGL}/Library/Frameworks/OpenGL.framework"
"-DOPENGL_gl_LIBRARY=${OpenGL}/Library/Frameworks/OpenGL.framework"
"-DCOCOA_LIBRARY=${Cocoa}/Library/Frameworks/Cocoa.framework"
"-DBUILD_BULLET2_DEMOS=OFF"
"-DBUILD_UNIT_TESTS=OFF"
];
enableParallelBuilding = true;
meta = with stdenv.lib; {
description = "A professional free 3D Game Multiphysics Library";
longDescription = ''
Bullet 3D Game Multiphysics Library provides state of the art collision
detection, soft body and rigid body dynamics.
'';
homepage = http://bulletphysics.org;
license = licenses.zlib;
platforms = platforms.unix;
};
}

View file

@ -0,0 +1,73 @@
{ lib
, buildPythonPackage
, python
, fetchFromGitHub
, fetchpatch
, qt5
, boost
, assimp
, gym
, bullet-roboschool
, pkgconfig
, which
}:
buildPythonPackage rec {
pname = "roboschool";
version = "1.0.39";
src = fetchFromGitHub {
owner = "openai";
repo = "roboschool";
rev = version;
sha256 = "1s7rp5bbiglnrfm33wf7x7kqj0ks3b21bqyz18c5g6vx39rxbrmh";
};
propagatedBuildInputs = [
gym
];
nativeBuildInputs = [
pkgconfig
qt5.qtbase # needs the `moc` tool
which
];
buildInputs = [
bullet-roboschool
assimp
qt5.qtbase
boost
];
NIX_CFLAGS_COMPILE="-I ${python}/include/${python.libPrefix}";
patches = [
# Remove kwarg that was removed in upstream gym
# https://github.com/openai/roboschool/pull/180
(fetchpatch {
name = "remove-close-kwarg.patch";
url = "https://github.com/openai/roboschool/pull/180/commits/334f489c8ce7af4887e376139ec676f89da5b16f.patch";
sha256 = "0bbz8b63m40a9lrwmh7c8d8gj9kpa8a7svdh08qhrddjkykvip6r";
})
];
preBuild = ''
# First build the cpp dependencies
cd roboschool/cpp-household
make \
MOC=moc \
-j$NIX_BUILD_CORES
cd ../..
'';
# Does a QT sanity check, but QT is not expected to work in isolation
doCheck = false;
meta = with lib; {
description = "Open-source software for robot simulation, integrated with OpenAI Gym";
homepage = https://github.com/openai/roboschool;
license = licenses.mit;
maintainers = with maintainers; [ timokau ];
};
}

View file

@ -23343,6 +23343,10 @@ in
inherit (darwin.apple_sdk.frameworks) Cocoa OpenGL;
};
bullet-roboschool = callPackage ../development/libraries/bullet/roboschool-fork.nix {
inherit (darwin.apple_sdk.frameworks) Cocoa OpenGL;
};
inherit (callPackages ../development/libraries/spdlog { })
spdlog_0 spdlog_1;

View file

@ -4028,6 +4028,10 @@ in {
retry_decorator = callPackage ../development/python-modules/retry_decorator { };
roboschool = callPackage ../development/python-modules/roboschool {
inherit (pkgs) pkgconfig; # use normal pkgconfig, not the python package
};
qdarkstyle = callPackage ../development/python-modules/qdarkstyle { };
quamash = callPackage ../development/python-modules/quamash { };