Gentoo Archives: gentoo-dev

From: Matt Turner <mattst88@g.o>
To: gentoo-dev@l.g.o
Cc: Matt Turner <mattst88@g.o>
Subject: [gentoo-dev] [PATCH] gnome2.eclass: Add EAPI=7 support
Date: Mon, 07 Dec 2020 01:57:07
Message-Id: 20201207015700.1957552-1-mattst88@gentoo.org
In Reply to: [gentoo-dev] [PATCH] gnome2.eclass: Add EAPI=7 support by Matt Turner
1 Closes: https://bugs.gentoo.org/658638
2 Closes: https://bugs.gentoo.org/717100
3 Signed-off-by: Matt Turner <mattst88@g.o>
4 ---
5 leio noted that banning GNOME2_LA_PUNT from EAPI 7 would mean adding
6
7 src_install() { gnome2_src_install }
8
9 to a bunch of ebuilds, which we don't want to do. Implement
10 GNOME2_LA_PUNT with find ... -delete in EAPI 7.
11
12 eclass/gnome2.eclass | 29 ++++++++++++++++++-----------
13 1 file changed, 18 insertions(+), 11 deletions(-)
14
15 diff --git a/eclass/gnome2.eclass b/eclass/gnome2.eclass
16 index 341802f8c80..27ea9f96c0d 100644
17 --- a/eclass/gnome2.eclass
18 +++ b/eclass/gnome2.eclass
19 @@ -4,7 +4,7 @@
20 # @ECLASS: gnome2.eclass
21 # @MAINTAINER:
22 # gnome@g.o
23 -# @SUPPORTED_EAPIS: 5 6
24 +# @SUPPORTED_EAPIS: 5 6 7
25 # @BLURB: Provides phases for Gnome/Gtk+ based packages.
26 # @DESCRIPTION:
27 # Exports portage base functions used by ebuilds written for packages using the
28 @@ -17,13 +17,14 @@
29 GNOME2_EAUTORECONF=${GNOME2_EAUTORECONF:-""}
30
31 [[ ${GNOME2_EAUTORECONF} == 'yes' ]] && inherit autotools
32 -inherit eutils libtool ltprune gnome.org gnome2-utils xdg
33 +[[ ${EAPI} == [56] ]] && inherit eutils ltprune
34 +inherit libtool gnome.org gnome2-utils xdg
35
36 case ${EAPI:-0} in
37 5)
38 EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install pkg_preinst pkg_postinst pkg_postrm
39 ;;
40 - 6)
41 + 6|7)
42 EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install pkg_preinst pkg_postinst pkg_postrm
43 ;;
44 *) die "EAPI=${EAPI} is not supported" ;;
45 @@ -70,8 +71,8 @@ fi
46
47 # @ECLASS-VARIABLE: GNOME2_LA_PUNT
48 # @DESCRIPTION:
49 -# It relies on prune_libtool_files (from ltprune.eclass)
50 -# for this. Available values for GNOME2_LA_PUNT:
51 +# In EAPIs 5 and 6, it relies on prune_libtool_files (from ltprune.eclass) for
52 +# this. Later EAPIs use find ... -delete. Available values for GNOME2_LA_PUNT:
53 # - "no": will not clean any .la files
54 # - "yes": will run prune_libtool_files --modules
55 # - If it is not set, it will run prune_libtool_files
56 @@ -85,7 +86,7 @@ gnome2_src_unpack() {
57 unpack ${A}
58 cd "${S}"
59 else
60 - die "gnome2_src_unpack is banned from eapi6"
61 + die "gnome2_src_unpack is banned since eapi6"
62 fi
63 }
64
65 @@ -264,11 +265,17 @@ gnome2_src_install() {
66 rm -fr "${ED}/usr/share/applications/mimeinfo.cache"
67
68 # Delete all .la files
69 - case "${GNOME2_LA_PUNT}" in
70 - yes) prune_libtool_files --modules;;
71 - no) ;;
72 - *) prune_libtool_files;;
73 - esac
74 + if has ${EAPI} 5 6; then
75 + case "${GNOME2_LA_PUNT}" in
76 + yes) prune_libtool_files --modules;;
77 + no) ;;
78 + *) prune_libtool_files;;
79 + esac
80 + else
81 + if [[ ${GNOME2_LA_PUNT} != 'no' ]]; then
82 + find "${ED}" -name '*.la' -delete || die
83 + fi
84 + fi
85 }
86
87 # @FUNCTION: gnome2_pkg_preinst
88 --
89 2.26.2