Gentoo Archives: gentoo-dev

From: David Michael <fedora.dm0@×××××.com>
To: gentoo-dev@l.g.o
Cc: base-system@g.o
Subject: [gentoo-dev] [PATCH] fcaps.eclass: support EAPI 8
Date: Wed, 16 Jun 2021 23:28:12
Message-Id: 87im2dcruj.fsf@gmail.com
1 This defines the native install-time libcap dependency as:
2
3 - EAPI < 7: RDEPEND
4 Only regular ROOT=/ builds can be expected to work.
5
6 - EAPI = 7: RDEPEND + BDEPEND
7 Also install the native setcap at built time, so cross-
8 compiling will work, but not installing binpkgs in ROOTs.
9
10 - EAPI > 7: IDEPEND
11 Install native setcap at install-time; it works everywhere.
12
13 Since all remaining users are EAPI 6 and above, declare eclass
14 compatibility with EAPIs 6, 7, and 8.
15
16 Signed-off-by: David Michael <fedora.dm0@×××××.com>
17 ---
18
19 Hi,
20
21 This is from https://github.com/gentoo/gentoo/pull/21239 .
22
23 I noticed a note in the PMS about how ebuilds with later EAPIs should be
24 remain source-able by old package managers for EAPI parsing. Does that
25 extend to eclasses? It would seem unfortunate for global scope to be
26 permanently restricted to bash 3.0 syntax.
27
28 Thanks.
29
30 David
31
32 eclass/fcaps.eclass | 16 +++++++---------
33 1 file changed, 7 insertions(+), 9 deletions(-)
34
35 diff --git a/eclass/fcaps.eclass b/eclass/fcaps.eclass
36 index 4bef00d40ac..291157fb4a6 100644
37 --- a/eclass/fcaps.eclass
38 +++ b/eclass/fcaps.eclass
39 @@ -1,9 +1,10 @@
40 -# Copyright 1999-2020 Gentoo Authors
41 +# Copyright 1999-2021 Gentoo Authors
42 # Distributed under the terms of the GNU General Public License v2
43
44 # @ECLASS: fcaps.eclass
45 # @MAINTAINER:
46 # base-system@g.o
47 +# @SUPPORTED_EAPIS: 6 7 8
48 # @BLURB: function to set POSIX file-based capabilities
49 # @DESCRIPTION:
50 # This eclass provides a function to set file-based capabilities on binaries.
51 @@ -33,15 +34,12 @@ _FCAPS_ECLASS=1
52
53 IUSE="+filecaps"
54
55 -# Since it is needed in pkg_postinst() it must be in RDEPEND
56 +# Since it is needed in pkg_postinst() it must be in IDEPEND
57 case "${EAPI:-0}" in
58 - [0-6])
59 - RDEPEND="filecaps? ( sys-libs/libcap )"
60 - ;;
61 - *)
62 - BDEPEND="filecaps? ( sys-libs/libcap )"
63 - RDEPEND="${BDEPEND}"
64 - ;;
65 + 7) BDEPEND="filecaps? ( sys-libs/libcap )" ;&
66 + 6) RDEPEND="filecaps? ( sys-libs/libcap )" ;;
67 + 8) IDEPEND="filecaps? ( sys-libs/libcap )" ;;
68 + *) die "EAPI ${EAPI:-0} is unsupported" ;;
69 esac
70
71 # @ECLASS-VARIABLE: FILECAPS
72 --
73 2.31.1

Replies

Subject Author
Re: [gentoo-dev] [PATCH] fcaps.eclass: support EAPI 8 Ulrich Mueller <ulm@g.o>