dev-ros/pluginlib: Fix runtime issues using CMAKE_PREFIX_PATH
authorAlexis Ballier <aballier@gentoo.org>
Fri, 10 Nov 2017 08:50:11 +0000 (09:50 +0100)
committerAlexis Ballier <aballier@gentoo.org>
Fri, 10 Nov 2017 08:51:18 +0000 (09:51 +0100)
Package-Manager: Portage-2.3.13, Repoman-2.3.4

dev-ros/pluginlib/files/catkin_prefix_path.patch [new file with mode: 0644]
dev-ros/pluginlib/files/gentoo2.patch [deleted file]
dev-ros/pluginlib/pluginlib-1.11.1.ebuild
dev-ros/pluginlib/pluginlib-9999.ebuild

diff --git a/dev-ros/pluginlib/files/catkin_prefix_path.patch b/dev-ros/pluginlib/files/catkin_prefix_path.patch
new file mode 100644 (file)
index 0000000..f5a19ec
--- /dev/null
@@ -0,0 +1,15 @@
+Honour CATKIN_PREFIX_PATH at runtime instead of ROS' hack to use CMAKE_PREFIX_PATH.
+
+Index: pluginlib-1.11.1/include/pluginlib/class_loader_imp.h
+===================================================================
+--- pluginlib-1.11.1.orig/include/pluginlib/class_loader_imp.h
++++ pluginlib-1.11.1/include/pluginlib/class_loader_imp.h
+@@ -66,7 +66,7 @@ namespace
+ std::vector<std::string> catkinFindLib()
+ {
+   std::vector<std::string> lib_paths;
+-  const char * env = std::getenv("CMAKE_PREFIX_PATH");
++  const char * env = std::getenv("CATKIN_PREFIX_PATH");
+   if (env) {
+     std::string env_catkin_prefix_paths(env);
+     std::vector<std::string> catkin_prefix_paths;
diff --git a/dev-ros/pluginlib/files/gentoo2.patch b/dev-ros/pluginlib/files/gentoo2.patch
deleted file mode 100644 (file)
index 60fbd7f..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-Find package.xml in ros_packages/package_name too as we moved it here.
-
-Index: pluginlib-1.11.1/include/pluginlib/class_loader_imp.h
-===================================================================
---- pluginlib-1.11.1.orig/include/pluginlib/class_loader_imp.h
-+++ pluginlib-1.11.1/include/pluginlib/class_loader_imp.h
-@@ -510,12 +510,17 @@ ClassLoader<T>::getPackageFromPluginXMLF
-   std::string package_name;
-   boost::filesystem::path p(plugin_xml_file_path);
-   boost::filesystem::path parent = p.parent_path();
-+  boost::filesystem::path basename = p.filename();
- 
-   // Figure out exactly which package the passed XML file is exported by.
-   while (true) {
-     if (boost::filesystem::exists(parent / "package.xml")) {
-       std::string package_file_path = (boost::filesystem::path(parent / "package.xml")).string();
-       return extractPackageNameFromPackageXML(package_file_path);
-+    } else if(boost::filesystem::exists(parent / "ros_packages" / basename / "package.xml"))
-+    {
-+      std::string package_file_path = (boost::filesystem::path(parent / "ros_packages" / basename / "package.xml")).string();
-+      return(extractPackageNameFromPackageXML(package_file_path));
-     } else if (boost::filesystem::exists(parent / "manifest.xml")) {
- #if BOOST_FILESYSTEM_VERSION >= 3
-       std::string package = parent.filename().string();
-@@ -532,6 +537,7 @@ ClassLoader<T>::getPackageFromPluginXMLF
-     }
- 
-     // Recursive case - hop one folder up
-+    basename = parent.filename();
-     parent = parent.parent_path().string();
- 
-     // Base case - reached root and cannot find what we're looking for
index 1e00a91c58ca4d1020f7e06c31f2322045a9ff44..730a3b5305debe316c10bc6d473988281bf4cfa7 100644 (file)
@@ -24,4 +24,4 @@ RDEPEND="
 "
 DEPEND="${RDEPEND}
        test? ( dev-cpp/gtest )"
-PATCHES=( "${FILESDIR}/gentoo2.patch" )
+PATCHES=( "${FILESDIR}/catkin_prefix_path.patch" )
index 1e00a91c58ca4d1020f7e06c31f2322045a9ff44..730a3b5305debe316c10bc6d473988281bf4cfa7 100644 (file)
@@ -24,4 +24,4 @@ RDEPEND="
 "
 DEPEND="${RDEPEND}
        test? ( dev-cpp/gtest )"
-PATCHES=( "${FILESDIR}/gentoo2.patch" )
+PATCHES=( "${FILESDIR}/catkin_prefix_path.patch" )