1 |
DISTUTILS_OPTIONAL seems to work fine, tested with |
2 |
sci-libs/geographiclib::rion |
3 |
|
4 |
> If a particular package uses distutils part only conditionally |
5 |
> (e.g. with USE=python), you can do something like: |
6 |
> |
7 |
> DISTUTILS_OPTIONAL=1 |
8 |
> RDEPEND="python? ( ${PYTHON_DEPS} )" |
9 |
> src_compile() { cd python; use python && distutils-r1_src_compile; } |
10 |
> src_test() { cd python; use python && distutils-r1_src_test; } |
11 |
> src_install() { cd python; use python && distutils-r1_src_install; } |
12 |
> --- |
13 |
> gx86/eclass/distutils-r1.eclass | 22 +++++++++++++++++++--- |
14 |
> 1 file changed, 19 insertions(+), 3 deletions(-) |
15 |
> |
16 |
> diff --git a/gx86/eclass/distutils-r1.eclass |
17 |
> b/gx86/eclass/distutils-r1.eclass |
18 |
> index 6a062ae..80734c5 100644 |
19 |
> --- a/gx86/eclass/distutils-r1.eclass |
20 |
> +++ b/gx86/eclass/distutils-r1.eclass |
21 |
> @@ -54,18 +54,34 @@ case "${EAPI:-0}" in |
22 |
> ;; |
23 |
> esac |
24 |
> +# @ECLASS-VARIABLE: DISTUTILS_OPTIONAL |
25 |
> +# @DEFAULT_UNSET |
26 |
> +# @DESCRIPTION: |
27 |
> +# If set to a non-null value, distutils part in the ebuild will |
28 |
> +# be considered optional. No dependencies will be added and no phase |
29 |
> +# functions will be exported. |
30 |
> +# |
31 |
> +# If you enable DISTUTILS_OPTIONAL, you have to set proper dependencies |
32 |
> +# for your package (using ${PYTHON_DEPS}) and to either call |
33 |
> +# distutils-r1 default phase functions or call the build system |
34 |
> +# manually. |
35 |
> + |
36 |
> if [[ ! ${_DISTUTILS_R1} ]]; then |
37 |
> inherit eutils multiprocessing python-r1 |
38 |
> fi |
39 |
> -EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test |
40 |
> src_install |
41 |
> +if [[ ! ${DISTUTILS_OPTIONAL} ]]; then |
42 |
> + EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test |
43 |
> src_install |
44 |
> +fi |
45 |
> if [[ ! ${_DISTUTILS_R1} ]]; then |
46 |
> -RDEPEND=${PYTHON_DEPS} |
47 |
> -DEPEND=${PYTHON_DEPS} |
48 |
> +if [[ ! ${DISTUTILS_OPTIONAL} ]]; then |
49 |
> + RDEPEND=${PYTHON_DEPS} |
50 |
> + DEPEND=${PYTHON_DEPS} |
51 |
> +fi |
52 |
> # @ECLASS-VARIABLE: DISTUTILS_JOBS |
53 |
> # @DEFAULT_UNSET |