1{ lib
2, stdenv
3, fetchFromGitHub
4, fetchpatch
5, cmake
6, pythonSupport ? false
7, python3Packages
8}:
9
10stdenv.mkDerivation (finalAttrs: {
11 pname = "example-robot-data";
12 version = "4.1.0";
13
14 src = fetchFromGitHub {
15 owner = "Gepetto";
16 repo = "example-robot-data";
17 rev = "v${finalAttrs.version}";
18 fetchSubmodules = true;
19 hash = "sha256-Heq+c8SSYNO8ksTv5FphRBRStlTakm9T66jlPXon5tI=";
20 };
21
22 strictDeps = true;
23
24 patches = [
25 # Temporary patch for pinocchio v3.0.0 compatibility.
26 # Should be removed on next example-robot-data release
27 (fetchpatch {
28 name = "pin3.patch";
29 url = "https://github.com/Gepetto/example-robot-data/pull/217/commits/a605ceec857005cde153ec5895e227205eb7a5c3.patch";
30 hash = "sha256-cvAWFytrU2XVggo/nCg8cuLcaZBTACXg6LxjL/6YMPs=";
31 })
32 ];
33
34 nativeBuildInputs = [
35 cmake
36 ];
37
38 buildInputs = lib.optionals pythonSupport [
39 python3Packages.pinocchio
40 ];
41
42 cmakeFlags = lib.optionals (!pythonSupport) [
43 "-DBUILD_PYTHON_INTERFACE=OFF"
44 ];
45
46 doCheck = true;
47 # The package expect to find an `example-robot-data/robots` folder somewhere
48 # either in install prefix or in the sources
49 # where it can find the meshes for unit tests
50 preCheck = "ln -s source ../../${finalAttrs.pname}";
51 pythonImportsCheck = [
52 "example_robot_data"
53 ];
54
55 meta = with lib; {
56 description = "Set of robot URDFs for benchmarking and developed examples";
57 homepage = "https://github.com/Gepetto/example-robot-data";
58 license = licenses.bsd3;
59 maintainers = with maintainers; [ nim65s wegank ];
60 platforms = platforms.unix;
61 };
62})