Skip to content

Commit

Permalink
[regale-library] quick fix temporary problem
Browse files Browse the repository at this point in the history
  • Loading branch information
adfaure committed Sep 15, 2023
1 parent 99eef97 commit 2285b24
Show file tree
Hide file tree
Showing 2 changed files with 109 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pkgs/regale-library/default.nix
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
{ stdenv, lib, cmake, fastdds, buildExamples ? true }:
{ stdenv, lib, cmake, fastdds, buildExamples ? false }:

stdenv.mkDerivation rec {
pname = "regale-library";
version = "1.0";

src = builtins.fetchGit {
url = "https://gricad-gitlab.univ-grenoble-alpes.fr/regale/tools/regale.git";
rev = "bccacf984a8a2e40a04c17e37f85af90f3e12e7e";
narHash = "sha256-2Yylmc5237Ewrzq6Jcyy2x/q9HLZejHwG9dtSIlf3O4=";
allRefs = true;
rev = "fa4ec6b192c514760e639d1a436b05839a021105";
ref = "regale_nm_ear";
};

patches = [ ./temporary_patch.patch ];
nativeBuildInputs = [ cmake ];
buildInputs = [
fastdds
];

cmakeFlags = [ "-DREGALE_EXAMPLES=${if buildExamples then "ON" else "OFF"}" ];
# Examples are broken with recent changes
cmakeFlags = [ "-DCMAKE_SKIP_RPATH=ON" "-DREGALE_EXAMPLES=${if buildExamples then "ON" else "OFF"}" ];

meta = with lib; {
description = "Regale published subscribed library.";
Expand Down
103 changes: 103 additions & 0 deletions pkgs/regale-library/temporary_patch.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
diff --git a/dummy_components/Monitor/RegaleMonitorServer_impl.c b/dummy_components/Monitor/RegaleMonitorServer_impl.c
index 048ee2c..311aa15 100644
--- a/dummy_components/Monitor/RegaleMonitorServer_impl.c
+++ b/dummy_components/Monitor/RegaleMonitorServer_impl.c
@@ -1,4 +1,5 @@
-#include <regale_monitor_types.h>
+#include <regale_monitor_server_impl.h>
+
regale_state_t regale_report_node_telemetry_server(regale_node_id_t *node,regale_node_data_t *data)
{
regale_verbose_node_data(0, node, data);
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index d45b687..2d0714a 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -1,5 +1,5 @@
-set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
-set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+# set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
+# set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

file(GLOB SOURCE_FILES *.c *.cpp)

diff --git a/examples/main_publisher.c b/examples/main_publisher.c
index c6e7d42..080c248 100644
--- a/examples/main_publisher.c
+++ b/examples/main_publisher.c
@@ -1,4 +1,4 @@
-#include "regale.h"
+#include "regale_core.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
diff --git a/examples/main_publisher_02.c b/examples/main_publisher_02.c
index f505740..438e6f8 100644
--- a/examples/main_publisher_02.c
+++ b/examples/main_publisher_02.c
@@ -1,4 +1,4 @@
-#include "regale.h"
+#include "regale_core.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
diff --git a/examples/main_publisher_02_cpp.cpp b/examples/main_publisher_02_cpp.cpp
index f505740..438e6f8 100644
--- a/examples/main_publisher_02_cpp.cpp
+++ b/examples/main_publisher_02_cpp.cpp
@@ -1,4 +1,4 @@
-#include "regale.h"
+#include "regale_core.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
diff --git a/examples/main_publisher_cpp.cpp b/examples/main_publisher_cpp.cpp
index c6e7d42..080c248 100644
--- a/examples/main_publisher_cpp.cpp
+++ b/examples/main_publisher_cpp.cpp
@@ -1,4 +1,4 @@
-#include "regale.h"
+#include "regale_core.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
diff --git a/examples/main_subscriber.c b/examples/main_subscriber.c
index 1bc65bd..e5f7336 100644
--- a/examples/main_subscriber.c
+++ b/examples/main_subscriber.c
@@ -1,4 +1,4 @@
-#include "regale.h"
+#include "regale_core.h"
#include <stdio.h>
#include <unistd.h>
#include <string.h>
diff --git a/examples/main_subscriber_02.c b/examples/main_subscriber_02.c
index 5975cfc..2628004 100644
--- a/examples/main_subscriber_02.c
+++ b/examples/main_subscriber_02.c
@@ -1,4 +1,4 @@
-#include "regale.h"
+#include "regale_core.h"
#include <stdio.h>
#include <unistd.h>
#include <string.h>
diff --git a/examples/main_subscriber_02_cpp.cpp b/examples/main_subscriber_02_cpp.cpp
index 5975cfc..2628004 100644
--- a/examples/main_subscriber_02_cpp.cpp
+++ b/examples/main_subscriber_02_cpp.cpp
@@ -1,4 +1,4 @@
-#include "regale.h"
+#include "regale_core.h"
#include <stdio.h>
#include <unistd.h>
#include <string.h>
diff --git a/src/regale.cpp b/src/regale.cpp
index 6144e7d..e398834 100644
--- a/src/regale.cpp
+++ b/src/regale.cpp
@@ -1,4 +1,4 @@
-#include "regale.h"
+#include "regale_core.h"
#include <string.h>
#include "RegaleSubscriber.h"
#include "RegalePublisher.h"

0 comments on commit 2285b24

Please sign in to comment.