1{ lib
2, buildPythonPackage
3, isPy3k
4, python
5, fetchFromGitHub
6, fetchpatch
7, qtbase
8, boost
9, assimp
10, gym
11, bullet-roboschool
12, pkgconfig
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 pkgconfig
36 qtbase # needs the `moc` tool
37 which
38 ];
39
40 buildInputs = [
41 bullet-roboschool
42 assimp
43 qtbase
44 boost
45 ];
46
47 NIX_CFLAGS_COMPILE="-I ${python}/include/${python.libPrefix}";
48
49 patches = [
50 # Remove kwarg that was removed in upstream gym
51 # https://github.com/openai/roboschool/pull/180
52 (fetchpatch {
53 name = "remove-close-kwarg.patch";
54 url = "https://github.com/openai/roboschool/pull/180/commits/334f489c8ce7af4887e376139ec676f89da5b16f.patch";
55 sha256 = "0bbz8b63m40a9lrwmh7c8d8gj9kpa8a7svdh08qhrddjkykvip6r";
56 })
57 ];
58
59 preBuild = ''
60 # First build the cpp dependencies
61 cd roboschool/cpp-household
62 make \
63 MOC=moc \
64 -j$NIX_BUILD_CORES
65 cd ../..
66 '';
67
68 # Does a QT sanity check, but QT is not expected to work in isolation
69 doCheck = false;
70
71 meta = with lib; {
72 description = "Open-source software for robot simulation, integrated with OpenAI Gym";
73 homepage = "https://github.com/openai/roboschool";
74 license = licenses.mit;
75 maintainers = with maintainers; [ timokau ];
76 };
77}