Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / libraries / crocoddyl / default.nix
bloba25ca5b97dff91a9f68a6c05f13e4f6123c56e8e
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , fetchpatch
5 , cmake
6 , example-robot-data
7 , pinocchio
8 , pythonSupport ? false
9 , python3Packages
12 stdenv.mkDerivation (finalAttrs: {
13   pname = "crocoddyl";
14   version = "2.0.1";
16   src = fetchFromGitHub {
17     owner = "loco-3d";
18     repo = finalAttrs.pname;
19     rev = "v${finalAttrs.version}";
20     fetchSubmodules = true;
21     hash = "sha256-h7rzLSvmWOZCP8rvmUEhFeMEiPhojfbvkt+fNKpgoXo=";
22   };
24   strictDeps = true;
26   nativeBuildInputs = [
27     cmake
28   ];
30   propagatedBuildInputs = lib.optionals (!pythonSupport) [
31     example-robot-data
32     pinocchio
33   ] ++ lib.optionals pythonSupport [
34     python3Packages.example-robot-data
35     python3Packages.pinocchio
36   ];
38   cmakeFlags = lib.optionals (!pythonSupport) [
39     "-DBUILD_EXAMPLES=OFF"
40     "-DBUILD_PYTHON_INTERFACE=OFF"
41   ];
43   prePatch = ''
44     substituteInPlace \
45       examples/CMakeLists.txt \
46       examples/log/check_logfiles.sh \
47       --replace /bin/bash ${stdenv.shell}
48   '';
50   doCheck = true;
51   pythonImportsCheck = [
52     "crocoddyl"
53   ];
54   checkInputs = lib.optionals (pythonSupport) [
55     python3Packages.scipy
56   ];
58   meta = with lib; {
59     description = "Crocoddyl optimal control library";
60     homepage = "https://github.com/loco-3d/crocoddyl";
61     license = licenses.bsd3;
62     maintainers = with maintainers; [ nim65s wegank ];
63     platforms = platforms.unix;
64   };