Gentoo Archives: gentoo-dev

From: hasufell <hasufell@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] New eclass: ros-catkin.eclass, new USE_EXPAND: ROS_MESSAGES, new categories: dev-ros and ros-meta for review.
Date: Fri, 18 Sep 2015 16:28:24
Message-Id: 55FC3B99.4040004@gentoo.org
In Reply to: [gentoo-dev] New eclass: ros-catkin.eclass, new USE_EXPAND: ROS_MESSAGES, new categories: dev-ros and ros-meta for review. by Alexis Ballier
1 On 09/17/2015 06:36 PM, Alexis Ballier wrote:
2 >
3 > # @ECLASS-VARIABLE: PYTHON_COMPAT
4 > # @DESCRIPTION:
5 > # Tells the eclass the package has python code and forwards it to python-r1.eclass.
6 > PYTHON_ECLASS=""
7 > CATKIN_PYTHON_USEDEP=""
8 > if [ -n "${PYTHON_COMPAT}" ] ; then
9 > PYTHON_ECLASS="python-r1 python-utils-r1"
10 > fi
11
12 see python-r1.eclass:
13 """
14 # Please note that python-r1 will always inherit python-utils-r1 as
15 # well. Thus, all the functions defined there can be used
16 # in the packages using python-r1, and there is no need ever to inherit
17 # both.
18 """
19
20 > # @FUNCTION: ros-catkin_src_install_with_python
21 > # @DESCRIPTION:
22 > # Decorator around cmake-utils_src_install to ensure python scripts are properly handled w.r.t. python-exec2.
23 > ros-catkin_src_install_with_python() {
24 > python_export PYTHON_SCRIPTDIR
25 > cmake-utils_src_install
26 > if [ ! -f "${T}/.catkin_python_symlinks_generated" -a -d "${D}/${PYTHON_SCRIPTDIR}" ]; then
27 > dodir /usr/bin
28 > for i in "${D}/${PYTHON_SCRIPTDIR}"/* ; do
29 > dosym ../lib/python-exec/python-exec2 "/usr/bin/${i##*/}" || die
30 > done
31 > touch "${T}/.catkin_python_symlinks_generated"
32 > fi
33 > }
34
35 Maybe I don't understand the purpose, but this looks like a hack
36 that is trying to circumvent the python eclasses.
37
38 You probably should have a look at:
39 """
40 # @FUNCTION: python_replicate_script
41 # @USAGE: <path>...
42 # @DESCRIPTION:
43 # Copy the given script to variants for all enabled Python
44 # implementations, then replace it with a symlink to the wrapper.
45 #
46 # All specified files must start with a 'python' shebang. A file not
47 # having a matching shebang will be refused.
48 """
49
50
51 >
52 > # @FUNCTION: ros-catkin_src_compile
53 > # @DESCRIPTION:
54 > # Builds a catkin-based package.
55 > ros-catkin_src_compile() {
56 > if [ -n "${CATKIN_DO_PYTHON_MULTIBUILD}" ] ; then
57 > python_foreach_impl cmake-utils_src_compile
58 > else
59 > cmake-utils_src_compile
60 > fi
61 > }
62 >
63
64 >
65 > # @FUNCTION: ros-catkin_src_test
66 > # @DESCRIPTION:
67 > # Run the tests of a catkin-based package.
68 > ros-catkin_src_test() {
69 > if [ -n "${CATKIN_DO_PYTHON_MULTIBUILD}" ] ; then
70 > python_foreach_impl ros-catkin_src_test_internal
71 > else
72 > ros-catkin_src_test_internal
73 > fi
74 > }
75 >
76
77 >
78 > # @FUNCTION: ros-catkin_src_install
79 > # @DESCRIPTION:
80 > # Installs a catkin-based package.
81 > ros-catkin_src_install() {
82 > if [ -n "${CATKIN_DO_PYTHON_MULTIBUILD}" ] ; then
83 > python_foreach_impl ros-catkin_src_install_with_python
84 > else
85 > cmake-utils_src_install
86 > fi
87 > }
88 >
89
90 I think these functions should pass arguments through to cmake-utils_src_* functions,
91 so an ebuild might be able to do stuff like
92 ros-catkin_src_compile -j1
93 or other things if that is really needed.

Replies