robotics.scm 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2018 Ludovic Courtès <ludo@gnu.org>
  3. ;;;
  4. ;;; This file is part of GNU Guix.
  5. ;;;
  6. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  7. ;;; under the terms of the GNU General Public License as published by
  8. ;;; the Free Software Foundation; either version 3 of the License, or (at
  9. ;;; your option) any later version.
  10. ;;;
  11. ;;; GNU Guix is distributed in the hope that it will be useful, but
  12. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. ;;; GNU General Public License for more details.
  15. ;;;
  16. ;;; You should have received a copy of the GNU General Public License
  17. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  18. (define-module (gnu packages robotics)
  19. #:use-module (guix packages)
  20. #:use-module (guix download)
  21. #:use-module (guix git-download)
  22. #:use-module ((guix licenses) #:prefix license:)
  23. #:use-module (guix build-system cmake)
  24. #:use-module (gnu packages avahi)
  25. #:use-module (gnu packages cpp)
  26. #:use-module (gnu packages gl)
  27. #:use-module (gnu packages linux)
  28. #:use-module (gnu packages pkg-config)
  29. #:use-module (gnu packages protobuf)
  30. #:use-module (gnu packages qt)
  31. #:use-module (gnu packages sdl)
  32. #:use-module (gnu packages valgrind)
  33. #:use-module (gnu packages xml))
  34. (define-public enki
  35. ;; Previous versions use Qt4 and are unsuitable for Aseba.
  36. (let ((commit "afd2d8e2f91c095f6745505ca1f32f31ea874200")
  37. (revision "0"))
  38. (package
  39. (name "enki")
  40. (version (git-version "2.0pre" revision commit))
  41. (home-page "https://github.com/enki-community/enki/")
  42. (source (origin
  43. (method git-fetch)
  44. (uri (git-reference (url home-page) (commit commit)))
  45. (sha256
  46. (base32
  47. "1d1901zzsfml97hb4mb3ah3ab1bk4kh7bn6m7xrj1rv0gk9wkhq7"))
  48. (file-name (string-append name "-" version "-checkout"))))
  49. (build-system cmake-build-system)
  50. (arguments
  51. '(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
  52. (native-inputs `(("pkg-config" ,pkg-config)))
  53. (inputs
  54. ;; Optionally, add Python + Boost for Python bindings.
  55. `(("sdl2" ,sdl2)))
  56. (propagated-inputs
  57. ;; 'Viewer.h' includes 'QGLWidget'.
  58. `(("qtbase" ,qtbase-5) ;the viewer module needs Qt5 + MESA
  59. ("mesa" ,mesa)))
  60. (synopsis "Robot simulator")
  61. (description
  62. "Enki is a robot simulator written in C++. It provides collision and
  63. limited physics support for robots evolving on a flat surface. On a
  64. contemporary desktop computer, Enki is able to simulate groups of robots
  65. hundred times faster than real-time.")
  66. ;; The 'LICENSE' file as well as source file headers says that
  67. ;; researchers using the software are "asked" to cite using a given
  68. ;; citation, but that sentence is written as not being part of the
  69. ;; license (fortunately).
  70. (license license:gpl2+))))
  71. (define-public aseba
  72. ;; Use the commit that allows us to build with Qt5.
  73. (let ((commit "3b35de80d5fdd47592b1c01d57e1f4ef37c5e5ea")
  74. (revision "0"))
  75. (package
  76. (name "aseba")
  77. (version (git-version "1.6.0" revision commit))
  78. (home-page "https://github.com/aseba-community/aseba")
  79. (source (origin
  80. (method git-fetch)
  81. (uri (git-reference (url home-page) (commit commit)
  82. (recursive? #t))) ;for Blockly
  83. (sha256
  84. (base32
  85. "0j31lmc9f0ksvkh0md2fgsz92hcsrwnrqqcynamizs2ah8iwlqi5"))
  86. (file-name (string-append name "-" version "-checkout"))
  87. (modules '((guix build utils)))
  88. (snippet
  89. ;; Add missing Qt5::Network.
  90. '(begin
  91. (substitute* "targets/playground/CMakeLists.txt"
  92. (("target_link_libraries(.*)\\$\\{EXTRA_LIBS\\}" _ middle)
  93. (string-append "target_link_libraries" middle
  94. " Qt5::Network ${EXTRA_LIBS}")))
  95. #t))))
  96. (build-system cmake-build-system)
  97. (arguments
  98. '(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
  99. (native-inputs
  100. `(("pkg-config" ,pkg-config)
  101. ("valgrind" ,valgrind))) ;for tests
  102. (inputs
  103. `(("dashel" ,dashel)
  104. ("enki" ,enki)
  105. ("protobuf" ,protobuf-3.5) ;for logging
  106. ("qtbase" ,qtbase-5)
  107. ("qtsvg" ,qtsvg)
  108. ("qttools" ,qttools) ;for libQt5Help, needed by "studio"
  109. ("qtwebkit" ,qtwebkit)
  110. ("qtx11extras" ,qtx11extras)
  111. ("eudev" ,eudev)
  112. ("libxml2" ,libxml2)
  113. ("sdl2" ,sdl2)
  114. ("avahi" ,avahi))) ;XXX: we need the libdnssd compat layer
  115. (synopsis "Event-based robot programming tools")
  116. (description
  117. "Aseba means @dfn{actuator and sensor event-based architecture}.
  118. It is a set of tools which allow beginners to program robots easily and
  119. efficiently. It includes robot simulators, a programming language, and a
  120. visual programming language (VPL) that is notably used together with the
  121. Thymio educational robot.")
  122. ;; Source file headers say "version 3.0" without "or any later version".
  123. (license license:lgpl3))))