summary refs log tree commit diff
path: root/gnu/packages/simulation.scm
diff options
context:
space:
mode:
authorLiliana Marie Prikler <liliana.prikler@gmail.com>2022-12-03 10:04:27 +0100
committerLiliana Marie Prikler <liliana.prikler@gmail.com>2023-02-12 08:45:36 +0100
commit015777f4c5094d20c2697c633dfe52ff966052a1 (patch)
tree8f121302e5de8f738ac460a83b3aac6fddd9050e /gnu/packages/simulation.scm
parent4a42167c3cb39645d07cb1a25b4e4e75247b4322 (diff)
downloadguix-015777f4c5094d20c2697c633dfe52ff966052a1.tar.gz
gnu: Add esmini.
* gnu/packages/patches/esmini-no-clutter-log.patch: New file.
* gnu/packages/patches/esmini-use-pkgconfig.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add them here.
* gnu/packages/simulation.scm (esmini): New variable.

Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
Diffstat (limited to 'gnu/packages/simulation.scm')
-rw-r--r--gnu/packages/simulation.scm70
1 files changed, 70 insertions, 0 deletions
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index b949b06531..1ade349306 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -291,6 +291,76 @@ functions in virtual scenarios.")
     (build-system python-build-system)
     (arguments '())))
 
+(define-public esmini
+  (package
+    (name "esmini")
+    (version "2.27.1")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/esmini/esmini")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (patches (search-patches "esmini-use-pkgconfig.patch"
+                                       "esmini-no-clutter-log.patch"))
+              (modules '((guix build utils) (ice-9 ftw)))
+              (snippet
+               #~(with-directory-excursion "externals"
+                   (for-each
+                    (lambda (dir) (unless (member dir '("." ".." "expr"))
+                               (delete-file-recursively dir)))
+                    (scandir "."))))
+              (sha256
+               (base32
+                "07ccydz7kxy5jc52f8fmxg4nkr1spshfnpzcv0wgd5lqz9ghjahz"))))
+    (build-system cmake-build-system)
+    (arguments
+     (list
+      #:configure-flags #~(list "-DDYN_PROTOBUF=TRUE")
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'fix-cmake
+            (lambda* (#:key inputs outputs #:allow-other-keys)
+              (substitute* "CMakeLists.txt"
+                (("\\$\\{CMAKE_HOME_DIRECTORY\\}/bin")
+                 (string-append (assoc-ref outputs "out") "/bin")))
+              (substitute* "EnvironmentSimulator/CMakeLists.txt"
+                (("\\$\\{OSI_DIR\\}/(include|lib)(-dyn)?" all what)
+                 (search-input-directory
+                  inputs
+                  (string-append what "/osi"
+                                 #$(version-major
+                                    (package-version
+                                     (this-package-input
+                                      "open-simulation-interface"))))))
+                (("\\$\\{SUMO_BASE_DIR\\}/\\$\\{EXT_DIR_NAME\\}")
+                 #$(this-package-input "sumo")))))
+          (replace 'check
+            (lambda* (#:key tests? #:allow-other-keys)
+              (with-directory-excursion "EnvironmentSimulator/Unittest/"
+                (for-each invoke (find-files "_test$")))))
+          (add-after 'install 'move-libraries
+            (lambda* (#:key outputs #:allow-other-keys)
+              (let ((out (assoc-ref outputs "out")))
+                (mkdir-p (string-append out "/lib"))
+                (with-directory-excursion (string-append out "/bin")
+                  (for-each
+                   (lambda (f)
+                     (rename-file f (string-append out "/lib/"
+                                                   (basename f))))
+                   (find-files "." "\\.so$")))))))))
+    (inputs (list mesa
+                  openscenegraph `(,openscenegraph "pluginlib")
+                  open-simulation-interface
+                  protobuf pugixml sumo))
+    (native-inputs (list googletest pkg-config))
+    (home-page "https://github.com/esmini/esmini")
+    (synopsis "Basic OpenSCENARIO player")
+    (description "@command{esmini} is a tool to play OpenSCENARIO files.
+It is provided as both a standalone application and a shared library and has
+some support for generating and analysing traffic scenarios..")
+    (license license:mpl2.0)))
+
 (define-public python-fenics-dijitso
   (package
     (name "python-fenics-dijitso")