From b472e72505a04fde0b1938d550ca47d7d10cfb28 Mon Sep 17 00:00:00 2001 From: "Peter S. Housel" Date: Sat, 2 Aug 2014 20:14:50 -0700 Subject: [PATCH 1/5] layer.conf: define ROSDISTRO within the meta-ros layer Define a ROSDISTRO variable to record the current ROS distribution code name for use within ROS-related recipes. --- conf/layer.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/conf/layer.conf b/conf/layer.conf index 6ef59ea..6bcc666 100644 --- a/conf/layer.conf +++ b/conf/layer.conf @@ -9,3 +9,5 @@ BBFILE_PATTERN_ros-layer := "^${LAYERDIR}/" BBFILE_PRIORITY_ros-layer = "7" LICENSE_PATH += "${LAYERDIR}/licenses" + +ROSDISTRO := "hydro" From e9ec1fc08907551135b2f6407c7159b12e30e294 Mon Sep 17 00:00:00 2001 From: "Peter S. Housel" Date: Thu, 14 Aug 2014 12:29:02 -0700 Subject: [PATCH 2/5] classes: locate packages in /opt/ros/${ROSDISTRO} Following standard convention, place ROS/Catkin packages under the prefix /opt/ros/${ROSDISTRO} (exported as ${ros_prefix}) rather than in the usual ${prefix}. --- classes/catkin.bbclass | 9 ++++--- classes/ros.bbclass | 61 ++++++++++++++++++++++++++++++++++++++---- 2 files changed, 61 insertions(+), 9 deletions(-) diff --git a/classes/catkin.bbclass b/classes/catkin.bbclass index 5286c4e..b22b19e 100644 --- a/classes/catkin.bbclass +++ b/classes/catkin.bbclass @@ -7,11 +7,13 @@ inherit cmake distutils-base ros faulty-solibs DEPENDS_prepend = "${@['catkin-native ', ''][d.getVar('BPN', True) == 'catkin']}" EXTRA_OECMAKE_CATKIN = "\ - -DCMAKE_PREFIX_PATH='${STAGING_DIR_HOST}/usr;${STAGING_DIR_NATIVE}/usr' \ + -DCMAKE_PREFIX_PATH='${STAGING_DIR_HOST}${ros_prefix};${STAGING_DIR_HOST}${prefix};${STAGING_DIR_NATIVE}${ros_prefix};${STAGING_DIR_NATIVE}${prefix}' \ + -DCMAKE_INSTALL_PREFIX:PATH='${ros_prefix}' \ " EXTRA_OECMAKE_CATKIN_class-native = "\ - -DCMAKE_PREFIX_PATH=${STAGING_DIR_NATIVE}/usr \ + -DCMAKE_PREFIX_PATH='${ros_prefix}' \ + -DCMAKE_INSTALL_PREFIX:PATH='${ros_prefix}' \ -DRT_LIBRARY=${libdir_native} \ " @@ -29,7 +31,6 @@ export BUILD_SYS export HOST_SYS SYSROOT_PREPROCESS_FUNCS += "catkin_sysroot_preprocess" - catkin_sysroot_preprocess () { - sysroot_stage_dir ${D}${prefix}/etc ${SYSROOT_DESTDIR}${prefix}/etc + sysroot_stage_dir ${D}${ros_sysconfdir} ${SYSROOT_DESTDIR}${ros_sysconfdir} } diff --git a/classes/ros.bbclass b/classes/ros.bbclass index 4e181ba..3b016a4 100644 --- a/classes/ros.bbclass +++ b/classes/ros.bbclass @@ -7,20 +7,55 @@ ROS_BPN = "${@d.getVar('BPN', True).replace('-', '_')}" ROS_SPN ?= "${ROS_BPN}" ROS_SP = "${ROS_SPN}-${PV}" +export ros_prefix = "/opt/ros/${ROSDISTRO}" +ros_prefix_virtclass-native = "${STAGING_DIR_NATIVE}/opt/ros/${ROSDISTRO}" + +export ros_bindir = "${ros_prefix}/bin" +export ros_libdir = "${ros_prefix}/${baselib}" +export ros_libexecdir = "${ros_libdir}/${ROS_BPN}" +export ros_includedir = "${ros_prefix}/include" +export ros_datadir = "${ros_prefix}/share" +export ros_sysconfdir = "${ros_prefix}/etc" +export ros_stacksdir = "${ros_prefix}/stacks" + +PREPROCESS_RELOCATE_DIRS += " \ + ${ros_bindir} \ + ${ros_libdir} \ +" + +PKG_CONFIG_PATH .= ":${PKG_CONFIG_DIR}:${STAGING_DIR_HOST}${ros_libdir}/pkgconfig:${STAGING_DATADIR}/pkgconfig" +PYTHON_SITEPACKAGES_DIR = "${ros_libdir}/${PYTHON_DIR}/site-packages" +export PYTHONPATH = "${STAGING_DIR_NATIVE}${PYTHON_SITEPACKAGES_DIR}" +PYTHONPATH_virtclass-native = "${PYTHON_SITEPACKAGES_DIR}" + FILES_${PN} += "\ - ${prefix}/etc \ - ${datadir}/ros/config/${ROS_BPN}.config \ - ${datadir}/ros/core/${ROS_BPN} \ - ${datadir}/${ROS_BPN} \ + ${ros_bindir}/* ${ros_libexecdir}/* ${ros_libdir}/lib*.so \ + ${PYTHON_SITEPACKAGES_DIR} \ + ${ros_datadir} \ + ${ros_sysconfdir} \ + ${ros_stacksdir} \ " FILES_${PN}-dev += "\ + ${ros_includedir} \ + ${ros_libdir}/pkgconfig \ + ${PYTHON_SITEPACKAGES_DIR}/*.la \ + ${ros_datadir}/${ROS_BPN}/cmake \ ${datadir}/${ROS_BPN}/cmake \ ${datadir}/${ROS_BPN}/*.template \ " FILES_${PN}-dbg += "\ - ${libdir}/${ROS_BPN}/.debug/* \ + ${ros_bindir}/.debug ${ros_libexecdir}/.debug ${ros_libdir}/.debug \ + ${ros_datadir}/*/bin/.debug \ + ${PYTHON_SITEPACKAGES_DIR}/.debug \ + ${PYTHON_SITEPACKAGES_DIR}/*/.debug \ + ${PYTHON_SITEPACKAGES_DIR}/*/*/.debug \ + " + +FILES_${PN}-staticdev += "\ + ${ros_libdir}/*.a \ + ${ros_libdir}/${BPN}/*.a \ " PACKAGES += "${PN}-commonlisp" @@ -28,3 +63,19 @@ PACKAGES += "${PN}-commonlisp" FILES_${PN}-commonlisp += " \ ${datadir}/common-lisp/ \ " + +SYSROOT_PREPROCESS_FUNCS += "ros_sysroot_preprocess" +ros_sysroot_preprocess () { + sysroot_stage_dir ${D}${ros_includedir} ${SYSROOT_DESTDIR}${ros_includedir} + if [ "${BUILD_SYS}" = "${HOST_SYS}" ]; then + sysroot_stage_dir ${D}${ros_bindir} ${SYSROOT_DESTDIR}${ros_bindir} + sysroot_stage_dir ${D}${ros_sysconfdir} ${SYSROOT_DESTDIR}${ros_sysconfdir} + fi + if [ -d ${D}${ros_libdir} ]; then + sysroot_stage_libdir ${D}${ros_libdir} ${SYSROOT_DESTDIR}${ros_libdir} + fi + sysroot_stage_dir ${D}${ros_datadir} ${SYSROOT_DESTDIR}${ros_datadir} + if [ -d ${D}${ros_stacksdir} ]; then + sysroot_stage_dir ${D}${ros_stacksdir} ${SYSROOT_DESTDIR}${ros_stacksdir} + fi +} From a2ffde5153cc289fbcf27d67575f0c36b51b8a84 Mon Sep 17 00:00:00 2001 From: "Peter S. Housel" Date: Sat, 2 Aug 2014 23:16:04 -0700 Subject: [PATCH 3/5] README.md: update to reflect new ROS package prefix Update the setup instructions to reflect the use of ${ros_prefix}. --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2929d8a..07cf649 100644 --- a/README.md +++ b/README.md @@ -126,10 +126,13 @@ Currently, this layer is still under continuous development. to the /etc/hosts file, and set up the environment with - export ROS_ROOT=/usr + export ROS_ROOT=/opt/ros/hydro + export PATH=$PATH:/opt/ros/hydro/bin + export LD_LIBRARY_PATH=/opt/ros/hydro/lib + export PYTHONPATH=/opt/ros/hydro/lib/python2.7/site-packages export ROS_MASTER_URI=http://localhost:11311 - export CMAKE_PREFIX_PATH=/usr - touch /usr/.catkin + export CMAKE_PREFIX_PATH=/opt/ros/hydro + touch /opt/ros/hydro/.catkin Finally, you can start roscore with From 67af03fa8f326f30425888f68623977371a567f6 Mon Sep 17 00:00:00 2001 From: "Peter S. Housel" Date: Sun, 10 Aug 2014 08:31:23 -0700 Subject: [PATCH 4/5] ros-realtime-tests: updating to 0.1.3 This version fixes build problems with a ${prefix} other than /usr. --- ...munication-tests_0.1.2.bb => communication-tests_0.1.3.bb} | 0 ...yclic-timer-tests_0.1.2.bb => cyclic-timer-tests_0.1.3.bb} | 0 ...shot-timer-tests_0.1.2.bb => oneshot-timer-tests_0.1.3.bb} | 0 recipes-ros/ros-realtime-tests/ros-realtime-tests.inc | 4 ++-- .../{rt-tests-support_0.1.2.bb => rt-tests-support_0.1.3.bb} | 0 5 files changed, 2 insertions(+), 2 deletions(-) rename recipes-ros/ros-realtime-tests/{communication-tests_0.1.2.bb => communication-tests_0.1.3.bb} (100%) rename recipes-ros/ros-realtime-tests/{cyclic-timer-tests_0.1.2.bb => cyclic-timer-tests_0.1.3.bb} (100%) rename recipes-ros/ros-realtime-tests/{oneshot-timer-tests_0.1.2.bb => oneshot-timer-tests_0.1.3.bb} (100%) rename recipes-ros/ros-realtime-tests/{rt-tests-support_0.1.2.bb => rt-tests-support_0.1.3.bb} (100%) diff --git a/recipes-ros/ros-realtime-tests/communication-tests_0.1.2.bb b/recipes-ros/ros-realtime-tests/communication-tests_0.1.3.bb similarity index 100% rename from recipes-ros/ros-realtime-tests/communication-tests_0.1.2.bb rename to recipes-ros/ros-realtime-tests/communication-tests_0.1.3.bb diff --git a/recipes-ros/ros-realtime-tests/cyclic-timer-tests_0.1.2.bb b/recipes-ros/ros-realtime-tests/cyclic-timer-tests_0.1.3.bb similarity index 100% rename from recipes-ros/ros-realtime-tests/cyclic-timer-tests_0.1.2.bb rename to recipes-ros/ros-realtime-tests/cyclic-timer-tests_0.1.3.bb diff --git a/recipes-ros/ros-realtime-tests/oneshot-timer-tests_0.1.2.bb b/recipes-ros/ros-realtime-tests/oneshot-timer-tests_0.1.3.bb similarity index 100% rename from recipes-ros/ros-realtime-tests/oneshot-timer-tests_0.1.2.bb rename to recipes-ros/ros-realtime-tests/oneshot-timer-tests_0.1.3.bb diff --git a/recipes-ros/ros-realtime-tests/ros-realtime-tests.inc b/recipes-ros/ros-realtime-tests/ros-realtime-tests.inc index d525f0a..9a2714d 100644 --- a/recipes-ros/ros-realtime-tests/ros-realtime-tests.inc +++ b/recipes-ros/ros-realtime-tests/ros-realtime-tests.inc @@ -1,6 +1,6 @@ SRC_URI = "https://github.com/bmwcarit/${ROS_SPN}/archive/${PV}.tar.gz;downloadfilename=${ROS_SP}.tar.gz" -SRC_URI[md5sum] = "8fbf5ff2bd671584da27272d45e11bc9" -SRC_URI[sha256sum] = "0b36c6ee0035ab8c5c5e048d6a66bd83a55bcfe1d8ec6150fa8e62cab9fc4c4d" +SRC_URI[md5sum] = "350c87a343c6657bc1516b4c7437a6c0" +SRC_URI[sha256sum] = "2c6f17e4f84ef0f9663d0ced05417501dc770961951e4cd13871b75adbb8c72a" S = "${WORKDIR}/${ROS_SP}/${ROS_BPN}" diff --git a/recipes-ros/ros-realtime-tests/rt-tests-support_0.1.2.bb b/recipes-ros/ros-realtime-tests/rt-tests-support_0.1.3.bb similarity index 100% rename from recipes-ros/ros-realtime-tests/rt-tests-support_0.1.2.bb rename to recipes-ros/ros-realtime-tests/rt-tests-support_0.1.3.bb From ec20dbba730391f4f4330c93fc0a640840ce19bc Mon Sep 17 00:00:00 2001 From: "Peter S. Housel" Date: Mon, 11 Aug 2014 18:18:57 -0700 Subject: [PATCH 5/5] tf2-py: suppress rpath usage for Python extension libraries --- recipes-ros/geometry-experimental/tf2-py_0.4.11.bb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/recipes-ros/geometry-experimental/tf2-py_0.4.11.bb b/recipes-ros/geometry-experimental/tf2-py_0.4.11.bb index 52d2a6d..75b6f2f 100644 --- a/recipes-ros/geometry-experimental/tf2-py_0.4.11.bb +++ b/recipes-ros/geometry-experimental/tf2-py_0.4.11.bb @@ -5,4 +5,8 @@ LIC_FILES_CHKSUM = "file://package.xml;beginline=14;endline=14;md5=d566ef916e9de DEPENDS = "rospy tf2" +EXTRA_OECMAKE += "\ + -DCMAKE_SKIP_RPATH=ON \ + " + require geometry-experimental.inc