From 3e97c448c0931c7c4f8dc16901aa894d6bade40e Mon Sep 17 00:00:00 2001
From: Lukas Bulwahn <lukas.bulwahn@oss.bmw-carit.de>
Date: Tue, 25 Mar 2014 14:13:48 +0100
Subject: [PATCH] urdfdom-py: initial commit

---
 ...nstall-scripts-use-catkin_python_set.patch | 110 ++++++++++++++++++
 recipes-ros/urdfdom/urdfdom-py_0.2.10.bb      |  15 +++
 recipes-ros/urdfdom/urdfdom.inc               |   5 +
 recipes-ros/urdfdom/urdfdom_0.2.10.bb         |   4 +-
 4 files changed, 131 insertions(+), 3 deletions(-)
 create mode 100644 recipes-ros/urdfdom/urdfdom-py/0001-urdf-parser-py-install-scripts-use-catkin_python_set.patch
 create mode 100644 recipes-ros/urdfdom/urdfdom-py_0.2.10.bb
 create mode 100644 recipes-ros/urdfdom/urdfdom.inc

diff --git a/recipes-ros/urdfdom/urdfdom-py/0001-urdf-parser-py-install-scripts-use-catkin_python_set.patch b/recipes-ros/urdfdom/urdfdom-py/0001-urdf-parser-py-install-scripts-use-catkin_python_set.patch
new file mode 100644
index 0000000..9597b35
--- /dev/null
+++ b/recipes-ros/urdfdom/urdfdom-py/0001-urdf-parser-py-install-scripts-use-catkin_python_set.patch
@@ -0,0 +1,110 @@
+From e54fcaaecfbaeaa45f5ace25c2b2a959ed5b2b1d Mon Sep 17 00:00:00 2001
+From: Lukas Bulwahn <lukas.bulwahn@oss.bmw-carit.de>
+Date: Tue, 25 Mar 2014 08:58:12 +0100
+Subject: [PATCH] urdf-parser-py: install scripts use catkin_python_setup
+
+To install urdf-parser-py properly with the bitbake recipe in the
+meta-ros layer, the install scripts, CMakeLists.txt and setup.py
+are adjusted. The package.xml file is needed for the new
+CMakeLists.txt due to using catkin.
+
+The files were obtained from the urdfdom_py release repository at:
+https://github.com/ros-gbp/urdfdom_py-release/tree/4664fc1445f4c75b427dcc6fbad579ba285c1901/hydro
+
+The obtained files were slightly adjusted:
+  - The version in the package.xml is fixed.
+  - Paths in CMakeLists.txt and setup.py were changed for use
+    with the bitbake recipe.
+---
+ urdf_parser_py/CMakeLists.txt | 16 ++++++++++------
+ urdf_parser_py/package.xml    | 28 ++++++++++++++++++++++++++++
+ urdf_parser_py/setup.py       | 18 ++++++------------
+ 3 files changed, 44 insertions(+), 18 deletions(-)
+ create mode 100644 urdf_parser_py/package.xml
+
+diff --git a/urdf_parser_py/CMakeLists.txt b/urdf_parser_py/CMakeLists.txt
+index c811815..6a48657 100644
+--- a/urdf_parser_py/CMakeLists.txt
++++ b/urdf_parser_py/CMakeLists.txt
+@@ -1,7 +1,11 @@
+-find_program(PYTHON "python")
++cmake_minimum_required(VERSION 2.8.3)
++project(urdfdom_py)
+ 
+-if (PYTHON)
+-  set(SETUP_PY "${CMAKE_CURRENT_SOURCE_DIR}/setup.py")
+-  install(CODE "execute_process(COMMAND \"${PYTHON}\" \"${SETUP_PY}\" build --build-base \"${CMAKE_CURRENT_BINARY_DIR}/pybuild\" install --install-layout deb --prefix \"${CMAKE_INSTALL_PREFIX}\"
+-                WORKING_DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}\")")
+-endif()
++find_package(catkin)
++catkin_python_setup()
++catkin_package()
++
++install(PROGRAMS
++  scripts/display_urdf
++  DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
++  )
+diff --git a/urdf_parser_py/package.xml b/urdf_parser_py/package.xml
+new file mode 100644
+index 0000000..c9d2285
+--- /dev/null
++++ b/urdf_parser_py/package.xml
+@@ -0,0 +1,28 @@
++<?xml version="1.0"?>
++<package>
++  <name>urdfdom_py</name>
++  <version>0.2.10</version>
++  <description>A library to access URDFs using the DOM model.</description>
++  <maintainer email="isucan@willowgarage.com">Ioan Sucan</maintainer>
++
++  <license>BSD</license>
++
++  <author>Thomas Moulard</author>
++  <author>David Lu</author>
++  <author>Kelsey Hawkins</author>
++  <author>Antonio El Khoury</author>
++  <author>Eric Cousineau</author>
++
++  <url type="website">http://ros.org/wiki/urdf</url>
++  <url type="bugtracker">https://github.com/ros/urdfdom/issues</url>
++  <url type="repository">https://github.com/ros/urdfdom</url>
++
++  <buildtool_depend>catkin</buildtool_depend>
++  <buildtool_depend>python-catkin-pkg</buildtool_depend>  
++
++  <build_depend>python</build_depend>
++
++  <run_depend>python</run_depend>
++  <run_depend>catkin</run_depend>
++  
++</package>
+diff --git a/urdf_parser_py/setup.py b/urdf_parser_py/setup.py
+index eeb4c6d..45478d9 100644
+--- a/urdf_parser_py/setup.py
++++ b/urdf_parser_py/setup.py
+@@ -1,16 +1,10 @@
+ #!/usr/bin/env python
+-
+ from distutils.core import setup
+-
+-d = {'author': u'Thomas Moulard <thomas.moulard@gmail.com>, David Lu <davidlu@wustl.edu>, Kelsey Hawkins <kphawkins@gmail.com>, Antonio El Khoury <aelkhour@laas.fr>, Eric Cousineau <eacousineau@gmail.com>',
+- 'description': 'The urdf_parser_py package contains a Python implementation of the\nurdf_parser modeling various aspects of robot information, specified in the\nXml Robot Description Format (URDF).',
+- 'license': 'BSD',
+- 'maintainer': u'Thomas Moulard',
+- 'maintainer_email': 'thomas.moulard@gmail.com',
+- 'name': 'urdf_parser_py',
+- 'package_dir': {'': 'src'},
+- 'packages': ['urdf_parser_py', 'urdf_parser_py.xml_reflection'],
+- 'url': 'http://ros.org/wiki/urdf_parser_py',
+- 'version': '0.3.0'}
++from catkin_pkg.python_setup import generate_distutils_setup
++ 
++d = generate_distutils_setup(
++    packages=['urdf_parser_py', 'urdf_parser_py.xml_reflection'],
++    package_dir={'': 'src'}
++)
+ 
+ setup(**d)
+-- 
+1.8.3.2
+
diff --git a/recipes-ros/urdfdom/urdfdom-py_0.2.10.bb b/recipes-ros/urdfdom/urdfdom-py_0.2.10.bb
new file mode 100644
index 0000000..9d68d03
--- /dev/null
+++ b/recipes-ros/urdfdom/urdfdom-py_0.2.10.bb
@@ -0,0 +1,15 @@
+DESCRIPTION = "A python library to access URDFs using the DOM model."
+SECTION = "devel"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://../LICENSE;md5=b441202ba2d6b14d62026cb18bb960ed"
+
+require urdfdom.inc
+
+SRC_URI += "file://0001-urdf-parser-py-install-scripts-use-catkin_python_set.patch;striplevel=2"
+
+S = "${WORKDIR}/${ROS_SP}/urdf_parser_py"
+
+inherit catkin
+
+RDEPENDS_${PN} = "python-lxml"
+
diff --git a/recipes-ros/urdfdom/urdfdom.inc b/recipes-ros/urdfdom/urdfdom.inc
new file mode 100644
index 0000000..568c90b
--- /dev/null
+++ b/recipes-ros/urdfdom/urdfdom.inc
@@ -0,0 +1,5 @@
+SRC_URI = "https://github.com/ros/${ROS_SPN}/archive/${PV}.tar.gz;downloadfilename=${ROS_SP}.tar.gz"
+SRC_URI[md5sum] = "d9e2b630313e458c92ee7f5a40ca4a74"
+SRC_URI[sha256sum] = "e200f5adefa6bf8304e56ab8a3e1c04d3b6cced5df472f4aeb430ff81f1ffa0d"
+
+ROS_SPN = "urdfdom"
diff --git a/recipes-ros/urdfdom/urdfdom_0.2.10.bb b/recipes-ros/urdfdom/urdfdom_0.2.10.bb
index 2329981..5cd7590 100644
--- a/recipes-ros/urdfdom/urdfdom_0.2.10.bb
+++ b/recipes-ros/urdfdom/urdfdom_0.2.10.bb
@@ -7,9 +7,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=b441202ba2d6b14d62026cb18bb960ed"
 
 DEPENDS = "urdfdom-headers console-bridge libtinyxml"
 
-SRC_URI = "https://github.com/ros/${ROS_SPN}/archive/${PV}.tar.gz;downloadfilename=${ROS_SP}.tar.gz"
-SRC_URI[md5sum] = "d9e2b630313e458c92ee7f5a40ca4a74"
-SRC_URI[sha256sum] = "e200f5adefa6bf8304e56ab8a3e1c04d3b6cced5df472f4aeb430ff81f1ffa0d"
+require urdfdom.inc
 
 S = "${WORKDIR}/${ROS_SP}"
 
-- 
GitLab