From 9879db3a97a028c383a321e068e3c1980cb37f6b Mon Sep 17 00:00:00 2001
From: Lukas Bulwahn <lukas.bulwahn@oss.bmw-carit.de>
Date: Sat, 21 Sep 2013 17:00:46 +0200
Subject: [PATCH] removing optional rostest dependencies

When CATKIN_ENABLE_TESTING is deactivated, the ROS packages do not
require the rostest package.
This commit includes a number of patches to be submitted in the
upstream repositories and removes the rostest dependencies from
the recipes.
---
 .../actionlib/0001-rostest-is-optional.patch  | 29 +++++++++
 recipes-ros/actionlib/actionlib_1.10.3.bb     |  4 +-
 .../0001-rostest-is-optional.patch            | 29 +++++++++
 recipes-ros/chatter/chatter-sender_git.bb     |  3 +-
 recipes-ros/geometry/geometry.inc             |  2 +
 .../tf/0001-rostest-is-optional.patch         | 30 +++++++++
 .../files/0001-rostest-is-optional.patch      | 62 +++++++++++++++++++
 .../ros-comm/message-filters_1.9.49.bb        |  2 +-
 recipes-ros/ros-comm/ros-comm.inc             |  2 +
 recipes-ros/ros-comm/rosnode_1.9.49.bb        |  1 -
 recipes-ros/ros-comm/rostopic_1.9.49.bb       |  2 -
 recipes-ros/ros-comm/roswtf_1.9.49.bb         |  2 -
 recipes-ros/ros-comm/topic-tools_1.9.49.bb    |  2 +-
 .../0001-rostest-is-optional.patch            | 29 +++++++++
 .../ros-tutorials/rospy-tutorials_0.4.1.bb    |  4 +-
 15 files changed, 193 insertions(+), 10 deletions(-)
 create mode 100644 recipes-ros/actionlib/actionlib/0001-rostest-is-optional.patch
 create mode 100644 recipes-ros/chatter/chatter-sender/0001-rostest-is-optional.patch
 create mode 100644 recipes-ros/geometry/tf/0001-rostest-is-optional.patch
 create mode 100644 recipes-ros/ros-comm/files/0001-rostest-is-optional.patch
 create mode 100644 recipes-ros/ros-tutorials/rospy-tutorials/0001-rostest-is-optional.patch

diff --git a/recipes-ros/actionlib/actionlib/0001-rostest-is-optional.patch b/recipes-ros/actionlib/actionlib/0001-rostest-is-optional.patch
new file mode 100644
index 0000000..39db819
--- /dev/null
+++ b/recipes-ros/actionlib/actionlib/0001-rostest-is-optional.patch
@@ -0,0 +1,29 @@
+From 9a6b0ed481e8585d5a042f69c8cdaf39b783fc9a Mon Sep 17 00:00:00 2001
+From: Lukas Bulwahn <lukas.bulwahn@oss.bmw-carit.de>
+Date: Sat, 21 Sep 2013 15:41:34 +0200
+Subject: [PATCH] rostest is optional
+
+---
+ CMakeLists.txt |    6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 9a3652f..ab0226c 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,7 +1,11 @@
+ cmake_minimum_required(VERSION 2.8.3)
+ project(actionlib)
+ 
+-find_package(catkin REQUIRED COMPONENTS actionlib_msgs message_generation roscpp rostest rosunit std_msgs)
++if(CATKIN_ENABLE_TESTING)
++  find_package(catkin REQUIRED COMPONENTS actionlib_msgs message_generation roscpp rostest rosunit std_msgs)
++else()
++  find_package(catkin REQUIRED COMPONENTS actionlib_msgs message_generation roscpp std_msgs)
++endif()
+ find_package(Boost REQUIRED COMPONENTS thread)
+ 
+ include_directories(include ${catkin_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})
+-- 
+1.7.10.4
+
diff --git a/recipes-ros/actionlib/actionlib_1.10.3.bb b/recipes-ros/actionlib/actionlib_1.10.3.bb
index 846fd4d..9b90610 100644
--- a/recipes-ros/actionlib/actionlib_1.10.3.bb
+++ b/recipes-ros/actionlib/actionlib_1.10.3.bb
@@ -4,10 +4,12 @@ SECTION = "devel"
 LICENSE = "BSD"
 LIC_FILES_CHKSUM = "file://package.xml;beginline=11;endline=11;md5=d566ef916e9dedc494f5f793a6690ba5"
 
-DEPENDS = "actionlib-msgs roscpp rostest"
+DEPENDS = "actionlib-msgs roscpp"
 
 SRC_URI = "https://github.com/ros/${ROS_SPN}/archive/${PV}.tar.gz;downloadfilename=${ROS_SP}.tar.gz"
 SRC_URI[md5sum] = "2e13067c3c85e81a3ab4b603ff15e45b"
 SRC_URI[sha256sum] = "f71df286552e6bf3a03ef83635342d3bdd6eef836e7b0565dccd2d341dbeaa11"
 
+SRC_URI += "file://0001-rostest-is-optional.patch"
+
 inherit catkin
diff --git a/recipes-ros/chatter/chatter-sender/0001-rostest-is-optional.patch b/recipes-ros/chatter/chatter-sender/0001-rostest-is-optional.patch
new file mode 100644
index 0000000..497cd75
--- /dev/null
+++ b/recipes-ros/chatter/chatter-sender/0001-rostest-is-optional.patch
@@ -0,0 +1,29 @@
+From 9c9051d1c00164cf2b63e23ad10f24ddce2b0413 Mon Sep 17 00:00:00 2001
+From: Lukas Bulwahn <lukas.bulwahn@oss.bmw-carit.de>
+Date: Sat, 21 Sep 2013 15:53:17 +0200
+Subject: [PATCH] rostest is optional
+
+---
+ chatter_sender/CMakeLists.txt |    6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/chatter_sender/CMakeLists.txt b/chatter_sender/CMakeLists.txt
+index f2bc563..243bc53 100644
+--- a/chatter_sender/CMakeLists.txt
++++ b/chatter_sender/CMakeLists.txt
+@@ -1,7 +1,11 @@
+ cmake_minimum_required(VERSION 2.8.3)
+ project(chatter_sender)
+ 
+-find_package(catkin REQUIRED COMPONENTS chatter_msgs roscpp rostest)
++if(CATKIN_ENABLE_TESTING)
++  find_package(catkin REQUIRED COMPONENTS chatter_msgs roscpp rostest)
++else()
++  find_package(catkin REQUIRED COMPONENTS chatter_msgs roscpp)
++endif()
+ 
+ catkin_package()
+ 
+-- 
+1.7.10.4
+
diff --git a/recipes-ros/chatter/chatter-sender_git.bb b/recipes-ros/chatter/chatter-sender_git.bb
index 6566aec..d7fad35 100644
--- a/recipes-ros/chatter/chatter-sender_git.bb
+++ b/recipes-ros/chatter/chatter-sender_git.bb
@@ -3,9 +3,10 @@ SECTION = "devel"
 LICENSE = "BSD"
 LIC_FILES_CHKSUM = "file://package.xml;beginline=7;endline=7;md5=d566ef916e9dedc494f5f793a6690ba5"
 
-DEPENDS = "rostest chatter-msgs roscpp"
+DEPENDS = "chatter-msgs roscpp"
 
 SRC_URI = "git://github.com/bmwcarit/ros_chatter.git"
+SRC_URI += "file://0001-rostest-is-optional.patch;striplevel=2"
 
 SRCREV = "${AUTOREV}"
 PV = "1.0.0+gitr${SRCPV}"
diff --git a/recipes-ros/geometry/geometry.inc b/recipes-ros/geometry/geometry.inc
index c3bf67a..7ee18eb 100644
--- a/recipes-ros/geometry/geometry.inc
+++ b/recipes-ros/geometry/geometry.inc
@@ -2,6 +2,8 @@ SRC_URI = "https://github.com/ros/${ROS_SPN}/archive/${PV}.tar.gz;downloadfilena
 SRC_URI[md5sum] = "32fd3bf4e85fdbf40a391daf32a8a91b"
 SRC_URI[sha256sum] = "8b0341d39391abfec2b3f72dad2ec0ce8c37bd4443822322a64eacb36f0ce7b6"
 
+SRC_URI += "file://0001-rostest-is-optional.patch;striplevel=2"
+
 S = "${WORKDIR}/${ROS_SP}/${ROS_BPN}"
 
 inherit catkin
diff --git a/recipes-ros/geometry/tf/0001-rostest-is-optional.patch b/recipes-ros/geometry/tf/0001-rostest-is-optional.patch
new file mode 100644
index 0000000..fea37ec
--- /dev/null
+++ b/recipes-ros/geometry/tf/0001-rostest-is-optional.patch
@@ -0,0 +1,30 @@
+From 9f1e801c6de00287658f1bae21048f37bb9bb198 Mon Sep 17 00:00:00 2001
+From: Lukas Bulwahn <lukas.bulwahn@oss.bmw-carit.de>
+Date: Sat, 21 Sep 2013 16:13:16 +0200
+Subject: [PATCH] rostest is optional
+
+---
+ tf/CMakeLists.txt |    7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/tf/CMakeLists.txt b/tf/CMakeLists.txt
+index e8d3044..2d36df3 100644
+--- a/tf/CMakeLists.txt
++++ b/tf/CMakeLists.txt
+@@ -4,7 +4,12 @@ project(tf)
+ find_package(catkin REQUIRED)
+ 
+ find_package(Boost REQUIRED thread signals)
+-find_package(catkin REQUIRED angles geometry_msgs message_filters message_generation rosconsole roscpp rostest rostime sensor_msgs std_msgs tf2_ros)
++
++if(CATKIN_ENABLE_TESTING)
++  find_package(catkin REQUIRED angles geometry_msgs message_filters message_generation rosconsole roscpp rostest rostime sensor_msgs std_msgs tf2_ros)
++else()
++  find_package(catkin REQUIRED angles geometry_msgs message_filters message_generation rosconsole roscpp rostime sensor_msgs std_msgs tf2_ros)
++endif()
+ 
+ catkin_python_setup()
+ 
+-- 
+1.7.10.4
+
diff --git a/recipes-ros/ros-comm/files/0001-rostest-is-optional.patch b/recipes-ros/ros-comm/files/0001-rostest-is-optional.patch
new file mode 100644
index 0000000..8e54f41
--- /dev/null
+++ b/recipes-ros/ros-comm/files/0001-rostest-is-optional.patch
@@ -0,0 +1,62 @@
+From 0f16232f1bac7d03cce598bd305bcdd4c456f4ed Mon Sep 17 00:00:00 2001
+From: Lukas Bulwahn <lukas.bulwahn@oss.bmw-carit.de>
+Date: Sat, 21 Sep 2013 15:20:11 +0200
+Subject: [PATCH] rostest is optional
+
+---
+ tools/rosnode/CMakeLists.txt    |    6 +++++-
+ tools/rostopic/CMakeLists.txt   |    6 +++++-
+ utilities/roswtf/CMakeLists.txt |    6 +++++-
+ 3 files changed, 15 insertions(+), 3 deletions(-)
+
+diff --git a/tools/rosnode/CMakeLists.txt b/tools/rosnode/CMakeLists.txt
+index a7347b4..b397106 100644
+--- a/tools/rosnode/CMakeLists.txt
++++ b/tools/rosnode/CMakeLists.txt
+@@ -1,6 +1,10 @@
+ cmake_minimum_required(VERSION 2.8.3)
+ project(rosnode)
+-find_package(catkin REQUIRED COMPONENTS rostest)
++if(CATKIN_ENABLE_TESTING)
++  find_package(catkin REQUIRED COMPONENTS rostest)
++else()
++  find_package(catkin REQUIRED)
++endif()
+ catkin_package()
+ 
+ catkin_python_setup()
+diff --git a/tools/rostopic/CMakeLists.txt b/tools/rostopic/CMakeLists.txt
+index 0551583..24fbed0 100644
+--- a/tools/rostopic/CMakeLists.txt
++++ b/tools/rostopic/CMakeLists.txt
+@@ -1,6 +1,10 @@
+ cmake_minimum_required(VERSION 2.8.3)
+ project(rostopic)
+-find_package(catkin REQUIRED COMPONENTS rostest)
++if(CATKIN_ENABLE_TESTING)
++  find_package(catkin REQUIRED COMPONENTS rostest)
++else()
++  find_package(catkin REQUIRED) 
++endif()
+ catkin_package()
+ 
+ catkin_python_setup()
+diff --git a/utilities/roswtf/CMakeLists.txt b/utilities/roswtf/CMakeLists.txt
+index dccb342..cfd0c11 100644
+--- a/utilities/roswtf/CMakeLists.txt
++++ b/utilities/roswtf/CMakeLists.txt
+@@ -1,6 +1,10 @@
+ cmake_minimum_required(VERSION 2.8.3)
+ project(roswtf)
+-find_package(catkin REQUIRED COMPONENTS rostest)
++if(CATKIN_ENABLE_TESTING)
++  find_package(catkin REQUIRED COMPONENTS rostest)
++else()
++  find_package(catkin REQUIRED)
++endif()
+ catkin_package()
+ catkin_python_setup()
+ 
+-- 
+1.7.10.4
+
diff --git a/recipes-ros/ros-comm/message-filters_1.9.49.bb b/recipes-ros/ros-comm/message-filters_1.9.49.bb
index 19b606f..9a338b3 100644
--- a/recipes-ros/ros-comm/message-filters_1.9.49.bb
+++ b/recipes-ros/ros-comm/message-filters_1.9.49.bb
@@ -3,7 +3,7 @@ SECTION = "devel"
 LICENSE = "BSD"
 LIC_FILES_CHKSUM = "file://package.xml;beginline=8;endline=8;md5=d566ef916e9dedc494f5f793a6690ba5"
 
-DEPENDS = "boost rosconsole roscpp rostest rosunit xmlrpcpp"
+DEPENDS = "boost rosconsole roscpp xmlrpcpp"
 
 require ros-comm.inc
 
diff --git a/recipes-ros/ros-comm/ros-comm.inc b/recipes-ros/ros-comm/ros-comm.inc
index d75e848..2b3afb7 100644
--- a/recipes-ros/ros-comm/ros-comm.inc
+++ b/recipes-ros/ros-comm/ros-comm.inc
@@ -2,6 +2,8 @@ SRC_URI = "https://github.com/ros/${ROS_SPN}/archive/${PV}.tar.gz;downloadfilena
 SRC_URI[md5sum] = "098494e9d10b42ac37a32e595e9d68dc"
 SRC_URI[sha256sum] = "6094ab6bd9df197d232825e82a714221fe816a1567495b920917d96f8e271d94"
 
+SRC_URI += "file://0001-rostest-is-optional.patch;patchdir=../.."
+
 ROS_PKG_SUBDIR ?= ""
 S = "${WORKDIR}/${ROS_SP}/${ROS_PKG_SUBDIR}/${ROS_BPN}"
 
diff --git a/recipes-ros/ros-comm/rosnode_1.9.49.bb b/recipes-ros/ros-comm/rosnode_1.9.49.bb
index 475b40c..b981c9c 100644
--- a/recipes-ros/ros-comm/rosnode_1.9.49.bb
+++ b/recipes-ros/ros-comm/rosnode_1.9.49.bb
@@ -4,7 +4,6 @@ SECTION = "devel"
 LICENSE = "BSD"
 LIC_FILES_CHKSUM = "file://package.xml;beginline=12;endline=12;md5=d566ef916e9dedc494f5f793a6690ba5"
 
-DEPENDS = "rostest"
 RDEPENDS_${PN} = "python-io python-xmlrpc rosgraph rostopic"
 
 require ros-comm.inc
diff --git a/recipes-ros/ros-comm/rostopic_1.9.49.bb b/recipes-ros/ros-comm/rostopic_1.9.49.bb
index ff79175..483915c 100644
--- a/recipes-ros/ros-comm/rostopic_1.9.49.bb
+++ b/recipes-ros/ros-comm/rostopic_1.9.49.bb
@@ -4,8 +4,6 @@ SECTION = "devel"
 LICENSE = "BSD"
 LIC_FILES_CHKSUM = "file://package.xml;beginline=17;endline=17;md5=d566ef916e9dedc494f5f793a6690ba5"
 
-DEPENDS = "rostest"
-
 require ros-comm.inc
 
 ROS_PKG_SUBDIR = "tools"
diff --git a/recipes-ros/ros-comm/roswtf_1.9.49.bb b/recipes-ros/ros-comm/roswtf_1.9.49.bb
index 808e05b..318aa71 100644
--- a/recipes-ros/ros-comm/roswtf_1.9.49.bb
+++ b/recipes-ros/ros-comm/roswtf_1.9.49.bb
@@ -3,8 +3,6 @@ SECTION = "devel"
 LICENSE = "BSD"
 LIC_FILES_CHKSUM = "file://package.xml;beginline=8;endline=8;md5=d566ef916e9dedc494f5f793a6690ba5"
 
-DEPENDS = "rostest"
-
 require ros-comm.inc
 
 ROS_PKG_SUBDIR = "utilities"
diff --git a/recipes-ros/ros-comm/topic-tools_1.9.49.bb b/recipes-ros/ros-comm/topic-tools_1.9.49.bb
index 9765f19..a82a421 100644
--- a/recipes-ros/ros-comm/topic-tools_1.9.49.bb
+++ b/recipes-ros/ros-comm/topic-tools_1.9.49.bb
@@ -4,7 +4,7 @@ SECTION = "devel"
 LICENSE = "BSD"
 LIC_FILES_CHKSUM = "file://package.xml;beginline=12;endline=12;md5=d566ef916e9dedc494f5f793a6690ba5"
 
-DEPENDS = "rostest roscpp"
+DEPENDS = "roscpp"
 
 require ros-comm.inc
 
diff --git a/recipes-ros/ros-tutorials/rospy-tutorials/0001-rostest-is-optional.patch b/recipes-ros/ros-tutorials/rospy-tutorials/0001-rostest-is-optional.patch
new file mode 100644
index 0000000..a73b4fb
--- /dev/null
+++ b/recipes-ros/ros-tutorials/rospy-tutorials/0001-rostest-is-optional.patch
@@ -0,0 +1,29 @@
+From 3eaf40260ea400cb779ca229cbf3ab27f5a2b6eb Mon Sep 17 00:00:00 2001
+From: Lukas Bulwahn <lukas.bulwahn@oss.bmw-carit.de>
+Date: Sat, 21 Sep 2013 16:33:11 +0200
+Subject: [PATCH] rostest is optional
+
+---
+ rospy_tutorials/CMakeLists.txt |    6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/rospy_tutorials/CMakeLists.txt b/rospy_tutorials/CMakeLists.txt
+index b588dfc..a48ec0d 100644
+--- a/rospy_tutorials/CMakeLists.txt
++++ b/rospy_tutorials/CMakeLists.txt
+@@ -1,7 +1,11 @@
+ cmake_minimum_required(VERSION 2.8.3)
+ project(rospy_tutorials)
+ 
+-find_package(catkin REQUIRED COMPONENTS message_generation rostest std_msgs)
++if(CATKIN_ENABLE_TESTING)
++  find_package(catkin REQUIRED COMPONENTS message_generation rostest std_msgs)
++else()
++  find_package(catkin REQUIRED COMPONENTS message_generation std_msgs)
++endif()
+ 
+ add_message_files(DIRECTORY msg FILES Floats.msg HeaderString.msg)
+ add_service_files(DIRECTORY srv FILES AddTwoInts.srv BadTwoInts.srv)
+-- 
+1.7.10.4
+
diff --git a/recipes-ros/ros-tutorials/rospy-tutorials_0.4.1.bb b/recipes-ros/ros-tutorials/rospy-tutorials_0.4.1.bb
index 97ab2e4..2e53671 100644
--- a/recipes-ros/ros-tutorials/rospy-tutorials_0.4.1.bb
+++ b/recipes-ros/ros-tutorials/rospy-tutorials_0.4.1.bb
@@ -3,6 +3,8 @@ SECTION = "devel"
 LICENSE = "BSD"
 LIC_FILES_CHKSUM = "file://package.xml;beginline=10;endline=10;md5=d566ef916e9dedc494f5f793a6690ba5"
 
-DEPENDS = "message-generation rostest std-msgs cpp-common roscpp-serialization"
+DEPENDS = "message-generation std-msgs cpp-common roscpp-serialization"
 
 require ros-tutorials.inc
+
+SRC_URI += "file://0001-rostest-is-optional.patch;striplevel=2"
-- 
GitLab