|
| 1 | +{ |
| 2 | + lib, |
| 3 | + stdenv, |
| 4 | + fetchFromGitHub, |
| 5 | + |
| 6 | + # nativeBuildInputs |
| 7 | + cmake, |
| 8 | + python3Packages, |
| 9 | + |
| 10 | + # buildInputs |
| 11 | + eigen, |
| 12 | + glpk, |
| 13 | + msgpack-cxx, |
| 14 | + pinocchio, |
| 15 | + qpoases, |
| 16 | + |
| 17 | + # checkInputs |
| 18 | + gtest, |
| 19 | +}: |
| 20 | + |
| 21 | +stdenv.mkDerivation (finalAttrs: { |
| 22 | + pname = "toppra"; |
| 23 | + version = "0.6.7"; |
| 24 | + |
| 25 | + src = fetchFromGitHub { |
| 26 | + owner = "hungpham2511"; |
| 27 | + repo = "toppra"; |
| 28 | + tag = finalAttrs.version; |
| 29 | + hash = "sha256-37FHQmcAlSiavaJdJrsWfMaxU7I06f+MNQA8hvtQ0mw="; |
| 30 | + }; |
| 31 | + |
| 32 | + sourceRoot = "source/cpp"; |
| 33 | + |
| 34 | + # fix ld: cannot open output file |
| 35 | + # /build/source/toppra/toppra/cpp/toppra_int.cpython-313-x86_64-linux-gnu.so: |
| 36 | + # No such file or directory |
| 37 | + postPatch = '' |
| 38 | + substituteInPlace bindings/CMakeLists.txt --replace-fail \ |
| 39 | + "LIBRARY_OUTPUT_DIRECTORY $""{TOPPRA_PYTHON_SOURCE_DIR}" \ |
| 40 | + "LIBRARY_OUTPUT_DIRECTORY $""{CMAKE_CURRENT_BINARY_DIR}" |
| 41 | + ''; |
| 42 | + |
| 43 | + nativeBuildInputs = [ |
| 44 | + cmake |
| 45 | + python3Packages.pybind11 |
| 46 | + ]; |
| 47 | + |
| 48 | + buildInputs = [ |
| 49 | + python3Packages.boost |
| 50 | + eigen |
| 51 | + glpk |
| 52 | + msgpack-cxx |
| 53 | + pinocchio |
| 54 | + # python3Packages.pinocchio |
| 55 | + qpoases |
| 56 | + ]; |
| 57 | + |
| 58 | + checkInputs = [ |
| 59 | + gtest |
| 60 | + ]; |
| 61 | + |
| 62 | + cmakeFlags = [ |
| 63 | + (lib.cmakeBool "BUILD_TESTS" finalAttrs.doCheck) |
| 64 | + (lib.cmakeBool "BUILD_WITH_PINOCCHIO" true) |
| 65 | + (lib.cmakeBool "BUILD_WITH_PINOCCHIO_PYTHON" true) |
| 66 | + (lib.cmakeBool "BUILD_WITH_qpOASES" true) |
| 67 | + (lib.cmakeBool "BUILD_WITH_GLPK" true) |
| 68 | + (lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic)) |
| 69 | + (lib.cmakeBool "OPT_MSGPACK" true) |
| 70 | + (lib.cmakeBool "PYTHON_BINDINGS" true) |
| 71 | + (lib.cmakeFeature "PYTHON_VERSION" (lib.versions.majorMinor python3Packages.python.version)) |
| 72 | + ]; |
| 73 | + |
| 74 | + doCheck = true; |
| 75 | + |
| 76 | + meta = { |
| 77 | + description = "Robotic motion planning library"; |
| 78 | + homepage = "https://github.com/hungpham2511/toppra"; |
| 79 | + license = lib.licenses.mit; |
| 80 | + maintainers = with lib.maintainers; [ nim65s ]; |
| 81 | + platforms = lib.platforms.all; |
| 82 | + }; |
| 83 | +}) |
0 commit comments