On 09/17/2015 06:36 PM, Alexis Ballier wrote:
>
> # @ECLASS-VARIABLE: PYTHON_COMPAT
> # @DESCRIPTION:
> # Tells the eclass the package has python code and forwards it to
> python-r1.eclass.
> PYTHON_ECLASS=""
> CATKIN_PYTHON_USEDEP=""
> if [ -n "${PYTHON_COMPAT}" ] ; then
> PYTHON_ECLASS="python-r1 python-utils-r1"
> fi
see python-r1.eclass:
"""
# Please note that python-r1 will always inherit python-utils-r1 as
# well. Thus, all the functions defined there can be used
# in the packages using python-r1, and there is no need ever to inherit
# both.
"""
> # @FUNCTION: ros-catkin_src_install_with_python
> # @DESCRIPTION:
> # Decorator around cmake-utils_src_install to ensure python scripts are
> properly handled w.r.t. python-exec2.
> ros-catkin_src_install_with_python() {
> python_export PYTHON_SCRIPTDIR
> cmake-utils_src_install
> if [ ! -f "${T}/.catkin_python_symlinks_generated" -a -d
> "${D}/${PYTHON_SCRIPTDIR}" ]; then
> dodir /usr/bin
> for i in "${D}/${PYTHON_SCRIPTDIR}"/* ; do
> dosym ../lib/python-exec/python-exec2
> "/usr/bin/${i##*/}" || die
> done
> touch "${T}/.catkin_python_symlinks_generated"
> fi
> }
Maybe I don't understand the purpose, but this looks like a hack
that is trying to circumvent the python eclasses.
You probably should have a look at:
"""
# @FUNCTION: python_replicate_script
# @USAGE: <path>...
# @DESCRIPTION:
# Copy the given script to variants for all enabled Python
# implementations, then replace it with a symlink to the wrapper.
#
# All specified files must start with a 'python' shebang. A file not
# having a matching shebang will be refused.
"""
>
> # @FUNCTION: ros-catkin_src_compile
> # @DESCRIPTION:
> # Builds a catkin-based package.
> ros-catkin_src_compile() {
> if [ -n "${CATKIN_DO_PYTHON_MULTIBUILD}" ] ; then
> python_foreach_impl cmake-utils_src_compile
> else
> cmake-utils_src_compile
> fi
> }
>
>
> # @FUNCTION: ros-catkin_src_test
> # @DESCRIPTION:
> # Run the tests of a catkin-based package.
> ros-catkin_src_test() {
> if [ -n "${CATKIN_DO_PYTHON_MULTIBUILD}" ] ; then
> python_foreach_impl ros-catkin_src_test_internal
> else
> ros-catkin_src_test_internal
> fi
> }
>
>
> # @FUNCTION: ros-catkin_src_install
> # @DESCRIPTION:
> # Installs a catkin-based package.
> ros-catkin_src_install() {
> if [ -n "${CATKIN_DO_PYTHON_MULTIBUILD}" ] ; then
> python_foreach_impl ros-catkin_src_install_with_python
> else
> cmake-utils_src_install
> fi
> }
>
I think these functions should pass arguments through to cmake-utils_src_*
functions,
so an ebuild might be able to do stuff like
ros-catkin_src_compile -j1
or other things if that is really needed.