Gentoo Archives: gentoo-dev

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH v2] font.eclass: Port to EAPI-7
Date: Tue, 15 Oct 2019 22:00:27
Message-Id: 2203231.Pmfk29c62c@tuxbrain
In Reply to: Re: [gentoo-dev] [PATCH] font.eclass: Port to EAPI-7 by "Michał Górny"
1 On Wednesday, 10 April 2019 15:21:35 CEST Michał Górny wrote:
2 > On Tue, 2019-04-09 at 21:41 +0200, Andreas Sturmlechner wrote:
3 > > On Sonntag, 24. März 2019 19:41:24 CEST Michał Górny wrote:
4 > > > -U9999, please. This is a huge eclass and probably requires more work
5 > > > than you're showing us ;-).
6 > >
7 > > As requested, without any changes to v2 - and if this does not receive
8 > > a reply I'll assume silent ack by fonts proj.
9
10 One more time - happy testing, and if anyone answers, font proj is invited as
11 well.
12
13 --- a/eclass/font.eclass
14 +++ b/eclass/font.eclass
15 @@ -4,16 +4,15 @@
16 # @ECLASS: font.eclass
17 # @MAINTAINER:
18 # fonts@g.o
19 -# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6
20 +# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 7
21 # @BLURB: Eclass to make font installation uniform
22
23 case ${EAPI:-0} in
24 - 0|1|2|3|4|5|6) ;;
25 - *) die "EAPI ${EAPI} is not supported by font.eclass." ;;
26 + 0|1|2|3|4|5|6) inherit eutils ;;
27 + 7) ;;
28 + *) die "EAPI ${EAPI} is not supported by font.eclass." ;;
29 esac
30
31 -inherit eutils
32 -
33 EXPORT_FUNCTIONS pkg_setup src_install pkg_postinst pkg_postrm
34
35 # @ECLASS-VARIABLE: FONT_SUFFIX
36 @@ -67,18 +66,18 @@ fi
37 # Generate Xorg font files (mkfontscale/mkfontdir).
38 font_xfont_config() {
39 local dir_name
40 - if has X ${IUSE//+} && use X ; then
41 + if in_iuse X && use X ; then
42 dir_name="${1:-${FONT_PN}}"
43 - ebegin "Creating fonts.scale & fonts.dir in ${dir_name##*/}"
44 - rm -f "${ED}${FONTDIR}/${1//${S}/}"/{fonts.
45 {dir,scale},encodings.dir}
46 - mkfontscale "${ED}${FONTDIR}/${1//${S}/}"
47 + rm -f "${ED%/}/${FONTDIR}/${1//${S}/}"/{fonts.
48 {dir,scale},encodings.dir} \
49 + || die "failed to prepare ${FONTDIR}/${1//${S}/}"
50 + einfo "Creating fonts.scale & fonts.dir in ${dir_name##*/}"
51 + mkfontscale "${ED%/}/${FONTDIR}/${1//${S}/}" || eerror "failed to
52 create fonts.scale"
53 mkfontdir \
54 -e ${EPREFIX}/usr/share/fonts/encodings \
55 -e ${EPREFIX}/usr/share/fonts/encodings/large \
56 - "${ED}${FONTDIR}/${1//${S}/}"
57 - eend $?
58 - if [[ -e fonts.alias ]] ; then
59 - doins fonts.alias
60 + "${ED%/}/${FONTDIR}/${1//${S}/}" || eerror "failed to create
61 fonts.dir"
62 + if [[ -e fonts.alias ]]; then
63 + doins fonts.alias || die "failed to install fonts.alias" #
64 TODO old EAPI cleanup
65 fi
66 fi
67 }
68 @@ -91,7 +90,9 @@ font_fontconfig() {
69 if [[ -n ${FONT_CONF[@]} ]]; then
70 insinto /etc/fonts/conf.avail/
71 for conffile in "${FONT_CONF[@]}"; do
72 - [[ -e ${conffile} ]] && doins ${conffile}
73 + if [[ -e ${conffile} ]]; then
74 + doins ${conffile} || die "failed to install conf file"
75 # TODO old EAPI cleanup
76 + fi
77 done
78 fi
79 }
80 @@ -105,20 +106,18 @@ font_cleanup_dirs() {
81 local d f g generated candidate otherfile