Skip to content

Commit

Permalink
GH-14 Split patches
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin-Idel-SI authored and Karsten1987 committed Dec 14, 2018
1 parent 3fac836 commit 2f959a9
Show file tree
Hide file tree
Showing 7 changed files with 131 additions and 127 deletions.
12 changes: 8 additions & 4 deletions ros1_rosbag_storage_vendor/CMakeLists.txt
Expand Up @@ -29,10 +29,10 @@ set(git_apply git apply)
include(ExternalProject)
# We have to include a number of patches to the rosbag
# 1. rosbag1_encryption_patch includes https://github.com/ros/ros_comm/pull/1499, without it, pluginlib won't link
# 2. rosbag1_for_ros2_patch patches the pluginlib usage:
# 2. The next two patches patch the pluginlib usage:
# Missing boost/bind include
# Using pluginlib with boost results in compile errors on some systems, so we need to switch to pluginlib without boost
# 3. rosbag1_ament_patch.diff patches the catkin package to ament and renames it
# 3. The next patches patch the catkin package to ament and renames it
# Patching to ament is necessary as otherwise colcon needs to build a catkin package together with an ament package, which is impossible
# Renaming the package is necessary on some systems to not confuse the linker
#
Expand All @@ -50,8 +50,12 @@ ExternalProject_Add(ros1_rosbag_storage
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/rosbag_install -DCMAKE_NO_SYSTEM_FROM_IMPORTED=1
PATCH_COMMAND
${git_apply} ${CMAKE_CURRENT_SOURCE_DIR}/resources/rosbag1_encryption_patch.diff &&
${git_apply} ${CMAKE_CURRENT_SOURCE_DIR}/resources/rosbag1_for_ros2_patch.diff &&
${git_apply} ${CMAKE_CURRENT_SOURCE_DIR}/resources/rosbag1_ament_patch.diff &&
${git_apply} ${CMAKE_CURRENT_SOURCE_DIR}/resources/bagh.diff &&
${git_apply} ${CMAKE_CURRENT_SOURCE_DIR}/resources/bagcpp.diff &&
${git_apply} ${CMAKE_CURRENT_SOURCE_DIR}/resources/bagcpp_name.diff &&
${git_apply} ${CMAKE_CURRENT_SOURCE_DIR}/resources/plugin_descriptionxml.diff &&
${git_apply} ${CMAKE_CURRENT_SOURCE_DIR}/resources/packagexml.diff &&
${git_apply} ${CMAKE_CURRENT_SOURCE_DIR}/resources/cmakeliststxt.diff &&
${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/cmake/CMakeLists.txt.in ${CMAKE_CURRENT_BINARY_DIR}/sources/CMakeLists.txt
)

Expand Down
@@ -1,37 +1,15 @@
diff --git a/tools/rosbag_storage/include/rosbag/bag.h b/tools/rosbag_storage/include/rosbag/bag.h
index c65533011..e75ef9c78 100644
--- a/tools/rosbag_storage/include/rosbag/bag.h
+++ b/tools/rosbag_storage/include/rosbag/bag.h
@@ -35,6 +35,8 @@
#ifndef ROSBAG_BAG_H
#define ROSBAG_BAG_H

+#include <memory>
+
#include "rosbag/macros.h"

#include "rosbag/buffer.h"
@@ -354,7 +356,7 @@ private:
// Encryptor plugin loader
pluginlib::ClassLoader<rosbag::EncryptorBase> encryptor_loader_;
// Active encryptor
- boost::shared_ptr<rosbag::EncryptorBase> encryptor_;
+ std::shared_ptr<rosbag::EncryptorBase> encryptor_;
};

} // namespace rosbag
diff --git a/tools/rosbag_storage/src/bag.cpp b/tools/rosbag_storage/src/bag.cpp
index 7e2e67171..073072934 100644
--- a/tools/rosbag_storage/src/bag.cpp
+++ b/tools/rosbag_storage/src/bag.cpp
@@ -40,6 +40,7 @@
#include <iomanip>

#include <boost/foreach.hpp>
+#include <boost/bind.hpp>

#include "console_bridge/console.h"

@@ -222,7 +223,8 @@ void Bag::setEncryptorPlugin(std::string const& plugin_name, std::string const&
if (!chunks_.empty()) {
throw BagException("Cannot set encryption plugin after chunks are written");
Expand All @@ -41,4 +19,4 @@ index 7e2e67171..073072934 100644
+ encryptor_ = std::shared_ptr<rosbag::EncryptorBase>(unmanaged_instance);
encryptor_->initialize(*this, plugin_param);
}

29 changes: 29 additions & 0 deletions ros1_rosbag_storage_vendor/resources/bagcpp_name.diff
@@ -0,0 +1,29 @@
diff --git a/tools/rosbag_storage/src/bag.cpp b/tools/rosbag_storage/src/bag.cpp
index 073072934..13a7fc8fc 100644
--- a/tools/rosbag_storage/src/bag.cpp
+++ b/tools/rosbag_storage/src/bag.cpp
@@ -58,12 +58,13 @@ using ros::Time;

namespace rosbag {

-Bag::Bag() : encryptor_loader_("rosbag_storage", "rosbag::EncryptorBase")
+Bag::Bag() : encryptor_loader_("ros1_rosbag_storage", "rosbag::EncryptorBase")
{
init();
}

-Bag::Bag(string const& filename, uint32_t mode) : encryptor_loader_("rosbag_storage", "rosbag::EncryptorBase")
+Bag::Bag(string const& filename, uint32_t mode)
+: encryptor_loader_("ros1_rosbag_storage", "rosbag::EncryptorBase")
{
init();
open(filename, mode);
@@ -71,7 +72,7 @@ Bag::Bag(string const& filename, uint32_t mode) : encryptor_loader_("rosbag_stor

#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES

-Bag::Bag(Bag&& other) : encryptor_loader_("rosbag_storage", "rosbag::EncryptorBase") {
+Bag::Bag(Bag&& other) : encryptor_loader_("ros1_rosbag_storage", "rosbag::EncryptorBase") {
init();
swap(other);
}
22 changes: 22 additions & 0 deletions ros1_rosbag_storage_vendor/resources/bagh.diff
@@ -0,0 +1,22 @@
diff --git a/tools/rosbag_storage/include/rosbag/bag.h b/tools/rosbag_storage/include/rosbag/bag.h
index c65533011..e75ef9c78 100644
--- a/tools/rosbag_storage/include/rosbag/bag.h
+++ b/tools/rosbag_storage/include/rosbag/bag.h
@@ -35,6 +35,8 @@
#ifndef ROSBAG_BAG_H
#define ROSBAG_BAG_H

+#include <memory>
+
#include "rosbag/macros.h"

#include "rosbag/buffer.h"
@@ -354,7 +356,7 @@ private:
// Encryptor plugin loader
pluginlib::ClassLoader<rosbag::EncryptorBase> encryptor_loader_;
// Active encryptor
- boost::shared_ptr<rosbag::EncryptorBase> encryptor_;
+ std::shared_ptr<rosbag::EncryptorBase> encryptor_;
};

} // namespace rosbag
Expand Up @@ -199,100 +199,3 @@ index dc49e2250..a440b7eda 100644
+)
+
+ament_package()
diff --git a/tools/rosbag_storage/encryptor_plugins.xml b/tools/rosbag_storage/encryptor_plugins.xml
index 3128ec9a5..fb66f450c 100644
--- a/tools/rosbag_storage/encryptor_plugins.xml
+++ b/tools/rosbag_storage/encryptor_plugins.xml
@@ -1,4 +1,4 @@
-<library path="lib/librosbag_default_encryption_plugins">
+<library path="rosbag_default_encryption_plugins">
<class name="rosbag/NoEncryptor" type="rosbag::NoEncryptor" base_class_type="rosbag::EncryptorBase">
<description>This is a plugin for no encryption.</description>
</class>
diff --git a/tools/rosbag_storage/package.xml b/tools/rosbag_storage/package.xml
index 502f5308b..3f28d00f1 100644
--- a/tools/rosbag_storage/package.xml
+++ b/tools/rosbag_storage/package.xml
@@ -1,5 +1,5 @@
-<package>
- <name>rosbag_storage</name>
+<package format="2">
+ <name>ros1_rosbag_storage</name>
<version>1.14.3</version>
<description>
This is a set of tools for recording from and playing back ROS
@@ -8,35 +8,25 @@
<maintainer email="dthomas@osrfoundation.org">Dirk Thomas</maintainer>
<license>BSD</license>

- <buildtool_depend>catkin</buildtool_depend>
+ <buildtool_depend>ament_cmake</buildtool_depend>

+ <build_depend>ros1_bridge</build_depend>
<build_depend>boost</build_depend>
<build_depend>bzip2</build_depend>
- <build_depend version_gte="0.3.17">cpp_common</build_depend>
+ <build_depend>cpp_common</build_depend>
<build_depend>libconsole-bridge-dev</build_depend>
<build_depend>libgpgme-dev</build_depend>
<build_depend>libssl-dev</build_depend>
<build_depend>pluginlib</build_depend>
- <build_depend>roscpp_serialization</build_depend>
- <build_depend version_gte="0.3.17">roscpp_traits</build_depend>
- <build_depend>rostest</build_depend>
- <build_depend>rostime</build_depend>
- <build_depend>roslz4</build_depend>

- <run_depend>boost</run_depend>
- <run_depend>bzip2</run_depend>
- <run_depend version_gte="0.3.17">cpp_common</run_depend>
- <run_depend>libconsole-bridge-dev</run_depend>
- <run_depend>libgpgme-dev</run_depend>
- <run_depend>libssl-dev</run_depend>
- <run_depend>pluginlib</run_depend>
- <run_depend>roscpp_serialization</run_depend>
- <run_depend version_gte="0.3.17">roscpp_traits</run_depend>
- <run_depend>rostime</run_depend>
- <run_depend>roslz4</run_depend>
+ <exec_depend>boost</exec_depend>
+ <exec_depend>bzip2</exec_depend>
+ <exec_depend>libconsole-bridge-dev</exec_depend>
+ <exec_depend>libgpgme-dev</exec_depend>
+ <exec_depend>libssl-dev</exec_depend>
+ <exec_depend>pluginlib</exec_depend>

<export>
- <rosdoc config="${prefix}/rosdoc.yaml"/>
- <rosbag_storage plugin="${prefix}/encryptor_plugins.xml" />
+ <build_type>ament_cmake</build_type>
</export>
</package>
diff --git a/tools/rosbag_storage/src/bag.cpp b/tools/rosbag_storage/src/bag.cpp
index 073072934..13a7fc8fc 100644
--- a/tools/rosbag_storage/src/bag.cpp
+++ b/tools/rosbag_storage/src/bag.cpp
@@ -58,12 +58,13 @@ using ros::Time;

namespace rosbag {

-Bag::Bag() : encryptor_loader_("rosbag_storage", "rosbag::EncryptorBase")
+Bag::Bag() : encryptor_loader_("ros1_rosbag_storage", "rosbag::EncryptorBase")
{
init();
}

-Bag::Bag(string const& filename, uint32_t mode) : encryptor_loader_("rosbag_storage", "rosbag::EncryptorBase")
+Bag::Bag(string const& filename, uint32_t mode)
+: encryptor_loader_("ros1_rosbag_storage", "rosbag::EncryptorBase")
{
init();
open(filename, mode);
@@ -71,7 +72,7 @@ Bag::Bag(string const& filename, uint32_t mode) : encryptor_loader_("rosbag_stor

#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES

-Bag::Bag(Bag&& other) : encryptor_loader_("rosbag_storage", "rosbag::EncryptorBase") {
+Bag::Bag(Bag&& other) : encryptor_loader_("ros1_rosbag_storage", "rosbag::EncryptorBase") {
init();
swap(other);
}
58 changes: 58 additions & 0 deletions ros1_rosbag_storage_vendor/resources/packagexml.diff
@@ -0,0 +1,58 @@
diff --git a/tools/rosbag_storage/package.xml b/tools/rosbag_storage/package.xml
index 502f5308b..3f28d00f1 100644
--- a/tools/rosbag_storage/package.xml
+++ b/tools/rosbag_storage/package.xml
@@ -1,5 +1,5 @@
-<package>
- <name>rosbag_storage</name>
+<package format="2">
+ <name>ros1_rosbag_storage</name>
<version>1.14.3</version>
<description>
This is a set of tools for recording from and playing back ROS
@@ -8,35 +8,25 @@
<maintainer email="dthomas@osrfoundation.org">Dirk Thomas</maintainer>
<license>BSD</license>

- <buildtool_depend>catkin</buildtool_depend>
+ <buildtool_depend>ament_cmake</buildtool_depend>

+ <build_depend>ros1_bridge</build_depend>
<build_depend>boost</build_depend>
<build_depend>bzip2</build_depend>
- <build_depend version_gte="0.3.17">cpp_common</build_depend>
+ <build_depend>cpp_common</build_depend>
<build_depend>libconsole-bridge-dev</build_depend>
<build_depend>libgpgme-dev</build_depend>
<build_depend>libssl-dev</build_depend>
<build_depend>pluginlib</build_depend>
- <build_depend>roscpp_serialization</build_depend>
- <build_depend version_gte="0.3.17">roscpp_traits</build_depend>
- <build_depend>rostest</build_depend>
- <build_depend>rostime</build_depend>
- <build_depend>roslz4</build_depend>

- <run_depend>boost</run_depend>
- <run_depend>bzip2</run_depend>
- <run_depend version_gte="0.3.17">cpp_common</run_depend>
- <run_depend>libconsole-bridge-dev</run_depend>
- <run_depend>libgpgme-dev</run_depend>
- <run_depend>libssl-dev</run_depend>
- <run_depend>pluginlib</run_depend>
- <run_depend>roscpp_serialization</run_depend>
- <run_depend version_gte="0.3.17">roscpp_traits</run_depend>
- <run_depend>rostime</run_depend>
- <run_depend>roslz4</run_depend>
+ <exec_depend>boost</exec_depend>
+ <exec_depend>bzip2</exec_depend>
+ <exec_depend>libconsole-bridge-dev</exec_depend>
+ <exec_depend>libgpgme-dev</exec_depend>
+ <exec_depend>libssl-dev</exec_depend>
+ <exec_depend>pluginlib</exec_depend>

<export>
- <rosdoc config="${prefix}/rosdoc.yaml"/>
- <rosbag_storage plugin="${prefix}/encryptor_plugins.xml" />
+ <build_type>ament_cmake</build_type>
</export>
</package>
10 changes: 10 additions & 0 deletions ros1_rosbag_storage_vendor/resources/plugin_descriptionxml.diff
@@ -0,0 +1,10 @@
diff --git a/tools/rosbag_storage/encryptor_plugins.xml b/tools/rosbag_storage/encryptor_plugins.xml
index 3128ec9a5..fb66f450c 100644
--- a/tools/rosbag_storage/encryptor_plugins.xml
+++ b/tools/rosbag_storage/encryptor_plugins.xml
@@ -1,4 +1,4 @@
-<library path="lib/librosbag_default_encryption_plugins">
+<library path="rosbag_default_encryption_plugins">
<class name="rosbag/NoEncryptor" type="rosbag::NoEncryptor" base_class_type="rosbag::EncryptorBase">
<description>This is a plugin for no encryption.</description>
</class>

0 comments on commit 2f959a9

Please sign in to comment.