1 |
Hi, everybody. |
2 |
|
3 |
I've recently worked on writing setup.py for Portage so that we could |
4 |
start installing it like proper Python package. For my work, I've |
5 |
written an ebuild that you can find in ::mgorny overlay [1]. Sadly, |
6 |
a few things don't work properly. |
7 |
|
8 |
I know I've pretty much screwed up python-r1 and made it overcomplex. |
9 |
I'm looking for your suggestions how I could improve it, or at least |
10 |
make my Portage ebuild work :). |
11 |
|
12 |
The issue is that the Python script wrapping in distutils-r1 has been |
13 |
designed for the common distutils concept of single scriptdir. However, |
14 |
in case of Portage we're installing scripts to three different |
15 |
locations -- one involving subdirectories. |
16 |
|
17 |
The usual wrapping code assumes that passing --install-scripts= will |
18 |
cause scripts to be installed in python-exec directory. However, |
19 |
in Portage this variable isn't used. Even if it were, we wouldn't know |
20 |
how to split the scripts into original directories afterwards. So I |
21 |
think we can only do manual wrapping here. |
22 |
|
23 |
However, the proper is that the script collide once merged to ${D}. We |
24 |
install to sub-root but it is merged before leaving |
25 |
distutils-r1_python_install. So we either need to hack that around even |
26 |
more, or disable parallel install (== make it very slow for Portage). |
27 |
|
28 |
A few possibilities that come to my mind include: |
29 |
|
30 |
1. make whole python_install() work on sub-root, merge after leaving |
31 |
it. This will be an incompatible change since ${D} will have to be |
32 |
replaced by a custom variable. |
33 |
|
34 |
2. add some implicit extra script wrapping support. Like |
35 |
DISTUTILS_SCRIPT_DIRECTORIES=() that can specify additional locations |
36 |
to look for scripts. Seems a bit overkill for a single case. |
37 |
|
38 |
Any other ideas? |
39 |
|
40 |
[1]:http://git.overlays.gentoo.org/gitweb/?p=dev/mgorny.git;a=blob;f=sys-apps/portage/portage-9999.ebuild |
41 |
|
42 |
-- |
43 |
Best regards, |
44 |
Michał Górny |