3 |
|
|
4 |
# default to build modules for multiple python versions (atm python2 and python3) |
# default to build modules for multiple python versions (atm python2 and python3) |
5 |
: ${PYPI_MULTIPLE_PYTHON_VERSIONS=1} |
: ${PYPI_MULTIPLE_PYTHON_VERSIONS=1} |
6 |
|
# which python version should be enabled |
7 |
|
: ${PYPI_ENABLED_PYTHON_VERSION2=0} |
8 |
|
: ${PYPI_ENABLED_PYTHON_VERSION3=1} |
9 |
|
|
10 |
# needs python |
# needs python |
11 |
sminclude python |
sminclude python |
29 |
|
|
30 |
if [[ ${PYPI_MULTIPLE_PYTHON_VERSIONS} = 1 ]] |
if [[ ${PYPI_MULTIPLE_PYTHON_VERSIONS} = 1 ]] |
31 |
then |
then |
32 |
sminclude python2 python3 |
SPLIT_PACKAGES="" |
|
SPLIT_PACKAGES="python2-${SPLIT_PNAME} python3-${SPLIT_PNAME}" |
|
33 |
|
|
34 |
eval "split_info_python2-${SPLIT_PNAME}() |
if [[ ${PYPI_ENABLED_PYTHON_VERSION2} = 1 ]] |
35 |
{ |
then |
36 |
DEPEND=\"\${DEPEND} |
sminclude python2 |
37 |
\${PYTHON2_DEPEND} |
SPLIT_PACKAGES+=" python2-${SPLIT_PNAME}" |
|
>= dev-lang/python2-2.7\" |
|
|
}" |
|
38 |
|
|
39 |
eval "split_info_python3-${SPLIT_PNAME}() |
eval "split_info_python2-${SPLIT_PNAME}() |
40 |
{ |
{ |
41 |
DEPEND=\"\${DEPEND} |
DEPEND=\"\${DEPEND} |
42 |
\${PYTHON3_DEPEND} |
\${PYTHON2_DEPEND} |
43 |
>= dev-lang/python3-3.6\" |
>= dev-lang/python2-2.7\" |
44 |
}" |
}" |
45 |
|
fi |
46 |
|
|
47 |
|
if [[ ${PYPI_ENABLED_PYTHON_VERSION3} = 1 ]] |
48 |
|
then |
49 |
|
sminclude python3 |
50 |
|
SPLIT_PACKAGES+=" python3-${SPLIT_PNAME}" |
51 |
|
|
52 |
|
eval "split_info_python3-${SPLIT_PNAME}() |
53 |
|
{ |
54 |
|
DEPEND=\"\${DEPEND} |
55 |
|
\${PYTHON3_DEPEND} |
56 |
|
>= dev-lang/python3-3.11\" |
57 |
|
|
58 |
|
SDEPEND=\"\${SDEPEND} |
59 |
|
>= dev-python/python-flit-core-3.9 |
60 |
|
>= dev-python/python-wheel-0.40\" |
61 |
|
}" |
62 |
|
fi |
63 |
|
|
64 |
else |
else |
65 |
DEPEND="${DEPEND} |
DEPEND="${DEPEND} |
66 |
>= dev-lang/python-2.7" |
>= dev-lang/python-3" |
67 |
|
SDEPEND="${SDEPEND} |
68 |
|
>= dev-python/python-flit-core-3.9 |
69 |
|
>= dev-python/python-wheel-0.40" |
70 |
fi |
fi |
71 |
|
|
72 |
SRC_URI=( |
SRC_URI=( |
83 |
{ |
{ |
84 |
if [[ ${PYPI_MULTIPLE_PYTHON_VERSIONS} = 1 ]] |
if [[ ${PYPI_MULTIPLE_PYTHON_VERSIONS} = 1 ]] |
85 |
then |
then |
86 |
python2_src_prepare || die |
if [[ ${PYPI_ENABLED_PYTHON_VERSION2} = 1 ]] |
87 |
python3_src_prepare || die |
then |
88 |
|
python2_src_prepare || die |
89 |
|
fi |
90 |
|
|
91 |
|
if [[ ${PYPI_ENABLED_PYTHON_VERSION3} = 1 ]] |
92 |
|
then |
93 |
|
python3_src_prepare || die |
94 |
|
fi |
95 |
else |
else |
96 |
python_src_prepare || die |
python_src_prepare || die |
97 |
fi |
fi |
101 |
{ |
{ |
102 |
if [[ ${PYPI_MULTIPLE_PYTHON_VERSIONS} = 1 ]] |
if [[ ${PYPI_MULTIPLE_PYTHON_VERSIONS} = 1 ]] |
103 |
then |
then |
104 |
python2_multilib_src_prepare || die |
if [[ ${PYPI_ENABLED_PYTHON_VERSION2} = 1 ]] |
105 |
python3_multilib_src_prepare || die |
then |
106 |
|
python2_multilib_src_prepare || die |
107 |
|
fi |
108 |
|
|
109 |
|
if [[ ${PYPI_ENABLED_PYTHON_VERSION3} = 1 ]] |
110 |
|
then |
111 |
|
python3_multilib_src_prepare || die |
112 |
|
fi |
113 |
else |
else |
114 |
python_multilib_src_prepare || die |
python_multilib_src_prepare || die |
115 |
fi |
fi |
121 |
|
|
122 |
if [[ ${PYPI_MULTIPLE_PYTHON_VERSIONS} = 1 ]] |
if [[ ${PYPI_MULTIPLE_PYTHON_VERSIONS} = 1 ]] |
123 |
then |
then |
124 |
python2_src_compile ${configure_opts} || die |
if [[ ${PYPI_ENABLED_PYTHON_VERSION2} = 1 ]] |
125 |
python3_src_compile ${configure_opts} || die |
then |
126 |
|
python2_src_compile ${configure_opts} || die |
127 |
|
fi |
128 |
|
|
129 |
|
if [[ ${PYPI_ENABLED_PYTHON_VERSION3} = 1 ]] |
130 |
|
then |
131 |
|
python3_src_compile ${configure_opts} || die |
132 |
|
fi |
133 |
else |
else |
134 |
python_src_compile ${configure_opts} || die |
python_src_compile ${configure_opts} || die |
135 |
fi |
fi |
141 |
|
|
142 |
if [[ ${PYPI_MULTIPLE_PYTHON_VERSIONS} = 1 ]] |
if [[ ${PYPI_MULTIPLE_PYTHON_VERSIONS} = 1 ]] |
143 |
then |
then |
144 |
python2_multilib_src_compile ${configure_opts} || die |
if [[ ${PYPI_ENABLED_PYTHON_VERSION2} = 1 ]] |
145 |
python3_multilib_src_compile ${configure_opts} || die |
then |
146 |
|
python2_multilib_src_compile ${configure_opts} || die |
147 |
|
fi |
148 |
|
|
149 |
|
if [[ ${PYPI_ENABLED_PYTHON_VERSION3} = 1 ]] |
150 |
|
then |
151 |
|
python3_multilib_src_compile ${configure_opts} || die |
152 |
|
fi |
153 |
else |
else |
154 |
python_multilib_src_compile ${configure_opts} || die |
python_multilib_src_compile ${configure_opts} || die |
155 |
fi |
fi |
160 |
python_src_install || die |
python_src_install || die |
161 |
} |
} |
162 |
|
|
163 |
eval "pypi_src_install_python2-${SPLIT_PNAME}() |
if [[ ${PYPI_ENABLED_PYTHON_VERSION2} = 1 ]] |
164 |
{ |
then |
165 |
python2_src_install || die |
eval "pypi_src_install_python2-${SPLIT_PNAME}() |
166 |
}" |
{ |
167 |
|
python2_src_install || die |
168 |
|
}" |
169 |
|
fi |
170 |
|
|
171 |
eval "pypi_src_install_python3-${SPLIT_PNAME}() |
if [[ ${PYPI_ENABLED_PYTHON_VERSION3} = 1 ]] |
172 |
{ |
then |
173 |
python3_src_install || die |
eval "pypi_src_install_python3-${SPLIT_PNAME}() |
174 |
}" |
{ |
175 |
|
python3_src_install || die |
176 |
|
}" |
177 |
|
fi |
178 |
|
|
179 |
pypi_multilib_src_install() |
pypi_multilib_src_install() |
180 |
{ |
{ |
181 |
python_multilib_src_install || die |
python_multilib_src_install || die |
182 |
} |
} |
183 |
|
|
184 |
eval "pypi_multilib_src_install_python2-${SPLIT_PNAME}() |
if [[ ${PYPI_ENABLED_PYTHON_VERSION2} = 1 ]] |
185 |
{ |
then |
186 |
python2_multilib_src_install || die |
eval "pypi_multilib_src_install_python2-${SPLIT_PNAME}() |
187 |
}" |
{ |
188 |
|
python2_multilib_src_install || die |
189 |
|
}" |
190 |
|
fi |
191 |
|
|
192 |
eval "pypi_multilib_src_install_python3-${SPLIT_PNAME}() |
if [[ ${PYPI_ENABLED_PYTHON_VERSION3} = 1 ]] |
193 |
{ |
then |
194 |
python3_multilib_src_install || die |
eval "pypi_multilib_src_install_python3-${SPLIT_PNAME}() |
195 |
}" |
{ |
196 |
|
python3_multilib_src_install || die |
197 |
|
}" |
198 |
|
fi |
199 |
|
|
200 |
if [[ ${MULTILIB_BUILD} = true ]] |
if [[ ${MULTILIB_BUILD} = true ]] |
201 |
then |
then |
202 |
if [[ ${PYPI_MULTIPLE_PYTHON_VERSIONS} = 1 ]] |
if [[ ${PYPI_MULTIPLE_PYTHON_VERSIONS} = 1 ]] |
203 |
then |
then |
204 |
export_inherits pypi_multilib src_prepare src_compile src_install_python2-${SPLIT_PNAME} src_install_python3-${SPLIT_PNAME} |
export_inherits pypi_multilib src_prepare src_compile |
205 |
|
|
206 |
|
if [[ ${PYPI_ENABLED_PYTHON_VERSION2} = 1 ]] |
207 |
|
then |
208 |
|
export_inherits pypi_multilib src_install_python2-${SPLIT_PNAME} |
209 |
|
fi |
210 |
|
|
211 |
|
if [[ ${PYPI_ENABLED_PYTHON_VERSION3} = 1 ]] |
212 |
|
then |
213 |
|
export_inherits pypi_multilib src_install_python3-${SPLIT_PNAME} |
214 |
|
fi |
215 |
else |
else |
216 |
export_inherits pypi_multilib src_prepare src_compile src_install |
export_inherits pypi_multilib src_prepare src_compile src_install |
217 |
fi |
fi |
218 |
else |
else |
219 |
if [[ ${PYPI_MULTIPLE_PYTHON_VERSIONS} = 1 ]] |
if [[ ${PYPI_MULTIPLE_PYTHON_VERSIONS} = 1 ]] |
220 |
then |
then |
221 |
export_inherits pypi src_prepare src_compile src_install_python2-${SPLIT_PNAME} src_install_python3-${SPLIT_PNAME} |
export_inherits pypi src_prepare src_compile |
222 |
|
|
223 |
|
if [[ ${PYPI_ENABLED_PYTHON_VERSION2} = 1 ]] |
224 |
|
then |
225 |
|
export_inherits pypi src_install_python2-${SPLIT_PNAME} |
226 |
|
fi |
227 |
|
|
228 |
|
if [[ ${PYPI_ENABLED_PYTHON_VERSION3} = 1 ]] |
229 |
|
then |
230 |
|
export_inherits pypi src_install_python3-${SPLIT_PNAME} |
231 |
|
fi |
232 |
else |
else |
233 |
export_inherits pypi src_prepare src_compile src_install |
export_inherits pypi src_prepare src_compile src_install |
234 |
fi |
fi |