From 2c66e130e5e04211a456af2a2a954534b8f47d7b Mon Sep 17 00:00:00 2001 From: Brian Shin Date: Fri, 1 Jun 2018 14:01:08 -0700 Subject: [PATCH] DRAFT ament-python bbclass: Import from lgsvl/meta-ros2@7a2ce1033f92b8ebf7f63f9ef8ec7d8129fcb513 Add missing copyright notice. --- classes/ament-python.bbclass | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 classes/ament-python.bbclass diff --git a/classes/ament-python.bbclass b/classes/ament-python.bbclass new file mode 100644 index 0000000..b789016 --- /dev/null +++ b/classes/ament-python.bbclass @@ -0,0 +1,28 @@ +# Copyright (c) 2018 LG Electronics, Inc. + +ROS_BPN ?= "${@d.getVar('BPN', True).replace('-', '_')}" + +S = "${WORKDIR}/git/${ROS_BPN}" + +inherit setuptools3 + +do_install_append() { + mkdir -p ${D}/usr/share/ament_index/resource_index/packages + touch ${D}/usr/share/ament_index/resource_index/packages/${ROS_BPN} + if test -e ${D}/usr/lib/${ROS_BPN}; then + for i in ${D}/usr/lib/${ROS_BPN}/* ; do \ + sed -i '1c#!/usr/bin/python3' $i + done + fi +} + +FILES_${PN} = " \ + /usr/share/* \ + ${datadir}/${ROS_BPN}/package.xml \ + ${datadir}/${ROS_BPN}/resource/* \ + ${datadir}/ament_index/* \ + ${libdir}/${PYTHON_DIR}/* \ + ${libdir}/${ROS_BPN}/* \ + ${libdir}/lib*.so \ +" +