1{ lib
2, buildPythonPackage
3, isPy3k
4, python
5, fetchFromGitHub
6, fetchpatch
7, qtbase
8, boost
9, assimp
10, gym
11, bullet-roboschool
12, pkg-config
13, which
14}:
15
16buildPythonPackage rec {
17 pname = "roboschool";
18 version = "1.0.39";
19
20 src = fetchFromGitHub {
21 owner = "openai";
22 repo = "roboschool";
23 rev = version;
24 sha256 = "1s7rp5bbiglnrfm33wf7x7kqj0ks3b21bqyz18c5g6vx39rxbrmh";
25 };
26
27 # fails to find boost_python for some reason
28 disabled = !isPy3k;
29
30 propagatedBuildInputs = [
31 gym
32 ];
33
34 nativeBuildInputs = [
35 pkg-config
36 qtbase # needs the `moc` tool
37 which
38 ];
39
40 buildInputs = [
41 bullet-roboschool
42 assimp
43 qtbase
44 boost
45 ];
46
47 dontWrapQtApps = true;
48
49 NIX_CFLAGS_COMPILE="-I ${python}/include/${python.libPrefix}";
50
51 patches = [
52 # Remove kwarg that was removed in upstream gym
53 # https://github.com/openai/roboschool/pull/180
54 (fetchpatch {
55 name = "remove-close-kwarg.patch";
56 url = "https://github.com/openai/roboschool/pull/180/commits/334f489c8ce7af4887e376139ec676f89da5b16f.patch";
57 sha256 = "0bbz8b63m40a9lrwmh7c8d8gj9kpa8a7svdh08qhrddjkykvip6r";
58 })
59 ];
60
61 preBuild = ''
62 # First build the cpp dependencies
63 cd roboschool/cpp-household
64 make \
65 MOC=moc \
66 -j$NIX_BUILD_CORES
67 cd ../..
68 '';
69
70 # Does a QT sanity check, but QT is not expected to work in isolation
71 doCheck = false;
72
73 meta = with lib; {
74 description = "Open-source software for robot simulation, integrated with OpenAI Gym";
75 homepage = "https://github.com/openai/roboschool";
76 license = licenses.mit;
77 maintainers = with maintainers; [ timokau ];
78 };
79}