Gentoo Archives: gentoo-dev

From: Ulrich Mueller <ulm@g.o>
To: gentoo-dev@l.g.o
Cc: "Marty E. Plummer" <hanetzer@×××××××××.com>
Subject: Re: [gentoo-dev] [PATCH 1/2] gnome2-utils.eclass: make EAPI 7 ready
Date: Mon, 18 Jun 2018 14:14:24
Message-Id: 23335.48691.50178.732053@a1i15.kph.uni-mainz.de
In Reply to: Re: [gentoo-dev] [PATCH 1/2] gnome2-utils.eclass: make EAPI 7 ready by Mart Raudsepp
1 >>>>> On Mon, 18 Jun 2018, Mart Raudsepp wrote:
2
3 > Ühel kenal päeval, E, 18.06.2018 kell 08:01, kirjutas Ulrich Mueller:
4 >> > > > > > On Sun, 17 Jun 2018, Marty E Plummer wrote:
5 >> > Signed-off-by: Marty E. Plummer <hanetzer@×××××××××.com>
6 >>
7 >> Please don't yet use Signed-off-by. Our policy on this (GLEP 76) is
8 >> still a draft and subject to change.
9 >>
10 >> > -DEPEND=">=sys-apps/sed-4"
11 >> > -
12 >> > +# sed needs to be executable on the build system
13 >> > +BDEPEND=">=sys-apps/sed-4"
14 >> > +[[ ${EAPI:-0} == [0123456] ]] && DEPEND="${BDEPEND}"
15 >>
16 >> These >=sed-4 dependencies are a relic from the time when there
17 >> was a sed-3. It left the tree in 2003 though.
18 >>
19 >> So I suggest to remove this build-time dependency altogether.
20
21 > I prefer being explicit, but that's probably a lost "battle" for sed,
22 > so, OK, we can remove it instead.
23
24 sed is guaranteed to be available in the ebuild environment (as well
25 as bash, patch, and find):
26 https://projects.gentoo.org/pms/7/pms.html#x1-11800012.1.1
27
28 So in this special case the dependency is entirely redundant.
29
30 > Otherwise as a generic question for EAPI-7 support in other eclasses:
31 > Doesn't this case leak a BDEPEND variable to ebuilds for lower EAPIs,
32 > as there's no "unset BDEPEND" for the lower EAPIs. And is that OK?
33
34 IMHO it is not OK. Also "unset BDEPEND" in global scope is not
35 entirely clean, because BDEPEND is just a normal variable in older
36 EAPIs, and could be used by an ebuild.
37
38 For the eclasses that I have updated, I have done something along
39 these lines:
40
41 DEPEND="cat-foo/bar"
42 case ${EAPI:-0} in
43 0|1|2|3|4|5|6) ;;
44 *) BDEPEND="${DEPEND}"; DEPEND="" ;;
45 esac
46
47 It simply assigns DEPEND in older EAPIs, and in EAPI 7 it assigns
48 BDEPEND. The additional DEPEND="" assignment should not harm, because
49 DEPEND is treated specially by the package manager and accumulated
50 across eclasses.
51
52 Ulrich