Gentoo Archives: gentoo-commits

From: "Andreas Hüttel" <dilfridge@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Sat, 19 Dec 2015 21:50:40
Message-Id: 1450531038.177f867de74b5caa9795301899de6142c035017c.dilfridge@gentoo
1 commit: 177f867de74b5caa9795301899de6142c035017c
2 Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
3 AuthorDate: Thu Dec 3 22:00:34 2015 +0000
4 Commit: Andreas Hüttel <dilfridge <AT> gentoo <DOT> org>
5 CommitDate: Sat Dec 19 13:17:18 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=177f867d
7
8 perl-module.eclass: Introduce new DIST_ control variables for EAPI=6 and avoid MY_ magic
9
10 This eclass is full of magic of the type of "Set MY_xxx before inheriting,
11 and I'll automatically use it somehow instead of xxx". I think this is majorly
12 silly since 1) MY_xxx is no proper API, and 2) it was never documented anyway.
13 So, in EAPI=6 ignore MY_PN, MY_P, and MY_S and use DIST_PN and DIST_P
14 instead. In addition also replace MODULE_ control variables with their
15 DIST_ analogue.
16
17 The DIST_ prefix is more consistent with upstream terminology since
18 what we're downloading from CPAN are not actually "modules" (like CGI.pm)
19 but "module distributions" (like CGI.tar.gz containg a set of modules).
20 In addition it avoids clashes in case of kernel module build systems. We
21 can't use PERL_ since this is picked up by perl itself.
22
23 eclass/perl-module.eclass | 68 ++++++++++++++++++++++++++++++++++++++++-------
24 1 file changed, 58 insertions(+), 10 deletions(-)
25
26 diff --git a/eclass/perl-module.eclass b/eclass/perl-module.eclass
27 index 8916ad0..ea49de4 100644
28 --- a/eclass/perl-module.eclass
29 +++ b/eclass/perl-module.eclass
30 @@ -29,6 +29,13 @@ case "${EAPI:-0}" in
31 ;;
32 esac
33
34 +# @ECLASS-VARIABLE: GENTOO_DEPEND_ON_PERL
35 +# @DESCRIPTION:
36 +# This variable controls whether a runtime and build time dependency on
37 +# dev-lang/perl is automatically added by the eclass. It defaults to yes.
38 +# Set to no to disable, set to noslotop to add a perl dependency without
39 +# slot operator (EAPI=6). All packages installing into the vendor_perl
40 +# path must use yes here.
41
42 case "${EAPI:-0}" in
43 5)
44 @@ -95,17 +102,58 @@ esac
45
46 LICENSE="${LICENSE:-|| ( Artistic GPL-1+ )}"
47
48 -if [[ -n ${MY_PN} || -n ${MY_PV} || -n ${MODULE_VERSION} ]] ; then
49 - : ${MY_P:=${MY_PN:-${PN}}-${MY_PV:-${MODULE_VERSION:-${PV}}}}
50 - S=${MY_S:-${WORKDIR}/${MY_P}}
51 -fi
52 +# @ECLASS-VARIABLE: DIST_NAME
53 +# @DESCRIPTION:
54 +# (EAPI=6) This variable provides a way to override PN for the calculation of S,
55 +# SRC_URI, and HOMEPAGE. Defaults to PN.
56 +
57 +# @ECLASS-VARIABLE: DIST_VERSION
58 +# @DESCRIPTION:
59 +# (EAPI=6) This variable provides a way to override PV for the calculation of S and SRC_URI.
60 +# Use it to provide the non-normalized, upstream version number. Defaults to PV.
61 +# Named MODULE_VERSION in EAPI=5.
62 +
63 +# @ECLASS-VARIABLE: DIST_A_EXT
64 +# @DESCRIPTION:
65 +# (EAPI=6) This variable provides a way to override the distfile extension for the calculation of
66 +# SRC_URI. Defaults to tar.gz. Named MODULE_A_EXT in EAPI=5.
67
68 -[[ -z "${SRC_URI}" && -z "${MODULE_A}" ]] && \
69 - MODULE_A="${MY_P:-${P}}.${MODULE_A_EXT:-tar.gz}"
70 -[[ -z "${SRC_URI}" && -n "${MODULE_AUTHOR}" ]] && \
71 - SRC_URI="mirror://cpan/authors/id/${MODULE_AUTHOR:0:1}/${MODULE_AUTHOR:0:2}/${MODULE_AUTHOR}/${MODULE_SECTION:+${MODULE_SECTION}/}${MODULE_A}"
72 -[[ -z "${HOMEPAGE}" ]] && \
73 - HOMEPAGE="http://search.cpan.org/dist/${MY_PN:-${PN}}/"
74 +# @ECLASS-VARIABLE: DIST_A
75 +# @DESCRIPTION:
76 +# (EAPI=6) This variable provides a way to override the distfile name for the calculation of
77 +# SRC_URI. Defaults to ${DIST_NAME}-${DIST_VERSION}.${DIST_A_EXT} Named MODULE_A in EAPI=5.
78 +
79 +# @ECLASS-VARIABLE: DIST_AUTHOR
80 +# @DESCRIPTION:
81 +# (EAPI=6) This variable sets the module author name for the calculation of
82 +# SRC_URI. Named MODULE_AUTHOR in EAPI=5.
83 +
84 +if [[ ${EAPI:-0} = 5 ]] ; then
85 + if [[ -n ${MY_PN} || -n ${MY_PV} || -n ${MODULE_VERSION} ]] ; then
86 + : ${MY_P:=${MY_PN:-${PN}}-${MY_PV:-${MODULE_VERSION:-${PV}}}}
87 + S=${MY_S:-${WORKDIR}/${MY_P}}
88 + fi
89 + MODULE_NAME=${MY_PN:-${PN}}
90 + MODULE_P=${MY_P:-${P}}
91 +
92 + [[ -z "${SRC_URI}" && -z "${MODULE_A}" ]] && \
93 + MODULE_A="${MODULE_P}.${MODULE_A_EXT:-tar.gz}"
94 + [[ -z "${SRC_URI}" && -n "${MODULE_AUTHOR}" ]] && \
95 + SRC_URI="mirror://cpan/authors/id/${MODULE_AUTHOR:0:1}/${MODULE_AUTHOR:0:2}/${MODULE_AUTHOR}/${MODULE_SECTION:+${MODULE_SECTION}/}${MODULE_A}"
96 + [[ -z "${HOMEPAGE}" ]] && \
97 + HOMEPAGE="http://search.cpan.org/dist/${MODULE_NAME}/"
98 +else
99 + DIST_NAME=${DIST_NAME:-${PN}}
100 + DIST_P=${DIST_NAME}-${DIST_VERSION:-${PV}}
101 + S=${WORKDIR}/${DIST_P}
102 +
103 + [[ -z "${SRC_URI}" && -z "${DIST_A}" ]] && \
104 + DIST_A="${DIST_P}.${DIST_A_EXT:-tar.gz}"
105 + [[ -z "${SRC_URI}" && -n "${DIST_AUTHOR}" ]] && \
106 + SRC_URI="mirror://cpan/authors/id/${DIST_AUTHOR:0:1}/${DIST_AUTHOR:0:2}/${DIST_AUTHOR}/${DIST_SECTION:+${DIST_SECTION}/}${DIST_A}"
107 + [[ -z "${HOMEPAGE}" ]] && \
108 + HOMEPAGE="http://search.cpan.org/dist/${DIST_NAME}/"
109 +fi
110
111 SRC_PREP="no"
112 SRC_TEST="skip"