Gentoo Archives: gentoo-dev

From: graaff@g.o
To: gentoo-dev@l.g.o
Cc: Hans de Graaff <graaff@g.o>
Subject: [gentoo-dev] [PATCH 1/2] ruby-ng.eclass: drop support for EAPI 2 and EAPI 3
Date: Thu, 18 Jul 2019 07:56:18
Message-Id: 20190718075607.26832-1-graaff@gentoo.org
1 From: Hans de Graaff <graaff@g.o>
2
3 Signed-off-by: Hans de Graaff <graaff@g.o>
4 ---
5 eclass/ruby-ng.eclass | 43 ++++++++++---------------------------------
6 1 file changed, 10 insertions(+), 33 deletions(-)
7
8 diff --git a/eclass/ruby-ng.eclass b/eclass/ruby-ng.eclass
9 index 90c36cd86e40..facb0bea95d7 100644
10 --- a/eclass/ruby-ng.eclass
11 +++ b/eclass/ruby-ng.eclass
12 @@ -8,7 +8,7 @@
13 # Author: Diego E. Pettenò <flameeyes@g.o>
14 # Author: Alex Legler <a3li@g.o>
15 # Author: Hans de Graaff <graaff@g.o>
16 -# @SUPPORTED_EAPIS: 2 3 4 5 6
17 +# @SUPPORTED_EAPIS: 4 5 6
18 # @BLURB: An eclass for installing Ruby packages with proper support for multiple Ruby slots.
19 # @DESCRIPTION:
20 # The Ruby eclass is designed to allow an easier installation of Ruby packages
21 @@ -68,7 +68,7 @@
22
23 local inherits=""
24 case ${EAPI} in
25 - 2|3|4|5)
26 + 4|5)
27 inherits="eutils"
28 ;;
29 esac
30 @@ -78,9 +78,8 @@ inherit ${inherits} java-utils-2 multilib toolchain-funcs ruby-utils
31 EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_test src_install pkg_setup
32
33 case ${EAPI} in
34 - 0|1)
35 + 0|1|2|3)
36 die "Unsupported EAPI=${EAPI} (too old) for ruby-ng.eclass" ;;
37 - 2|3) ;;
38 4|5|6)
39 # S is no longer automatically assigned when it doesn't exist.
40 S="${WORKDIR}"
41 @@ -302,40 +301,21 @@ IUSE+=" $(ruby_get_use_targets)"
42 if [[ ${RUBY_OPTIONAL} != yes ]]; then
43 DEPEND="${DEPEND} $(ruby_implementations_depend)"
44 RDEPEND="${RDEPEND} $(ruby_implementations_depend)"
45 -
46 - case ${EAPI:-0} in
47 - 4|5|6)
48 - REQUIRED_USE+=" || ( $(ruby_get_use_targets) )"
49 - ;;
50 - esac
51 + REQUIRED_USE+=" || ( $(ruby_get_use_targets) )"
52 fi
53
54 _ruby_invoke_environment() {
55 old_S=${S}
56 - case ${EAPI} in
57 - 4|5|6)
58 - if [ -z "${RUBY_S}" ]; then
59 - sub_S=${P}
60 - else
61 - sub_S=${RUBY_S}
62 - fi
63 - ;;
64 - *)
65 - sub_S=${S#${WORKDIR}/}
66 - ;;
67 - esac
68 + if [ -z "${RUBY_S}" ]; then
69 + sub_S=${P}
70 + else
71 + sub_S=${RUBY_S}
72 + fi
73
74 # Special case, for the always-lovely GitHub fetches. With this,
75 # we allow the star glob to just expand to whatever directory it's
76 # called.
77 if [[ "${sub_S}" = *"*"* ]]; then
78 - case ${EAPI} in
79 - 2|3)
80 - #The old method of setting S depends on undefined package
81 - # manager behaviour, so encourage upgrading to EAPI=4.
82 - eqawarn "Using * expansion of S is deprecated. Use EAPI and RUBY_S instead."
83 - ;;
84 - esac
85 pushd "${WORKDIR}"/all &>/dev/null || die
86 # use an array to trigger filename expansion
87 # fun fact: this expansion fails in src_unpack() but the original
88 @@ -425,7 +405,7 @@ ruby-ng_src_unpack() {
89
90 _ruby_apply_patches() {
91 case ${EAPI} in
92 - 2|3|4|5)
93 + 4|5)
94 for patch in "${RUBY_PATCHES[@]}"; do
95 if [ -f "${patch}" ]; then
96 epatch "${patch}"
97 @@ -524,8 +504,6 @@ _each_ruby_check_install() {
98 # we have a Mach-O object here
99 [[ ${CHOST} == *-darwin ]] && scancmd=scanmacho
100
101 - has "${EAPI}" 2 && ! use prefix && EPREFIX=
102 -
103 local libruby_basename=$(${RUBY} -rrbconfig -e 'puts RbConfig::CONFIG["LIBRUBY_SO"]')
104 local libruby_soname=$(basename $(${scancmd} -F "%S#F" -qS "${EPREFIX}/usr/$(get_libdir)/${libruby_basename}") 2>/dev/null)
105 local sitedir=$(${RUBY} -rrbconfig -e 'puts RbConfig::CONFIG["sitedir"]')
106 @@ -578,7 +556,6 @@ ruby_rbconfig_value() {
107 # Installs the specified file(s) into the sitelibdir of the Ruby interpreter in ${RUBY}.
108 doruby() {
109 [[ -z ${RUBY} ]] && die "\$RUBY is not set"
110 - has "${EAPI}" 2 && ! use prefix && EPREFIX=
111 ( # don't want to pollute calling env
112 sitelibdir=$(ruby_rbconfig_value 'sitelibdir')
113 insinto ${sitelibdir#${EPREFIX}}
114 --
115 2.21.0

Replies