Gentoo Archives: gentoo-dev

From: Naohiro Aota <naota@g.o>
To: gentoo-dev@l.g.o
Cc: ruby@g.o, Naohiro Aota <naota@g.o>
Subject: [gentoo-dev] [PATCH v2 08/10] ruby-ng-gnome2.eclass: support non-build packages
Date: Mon, 04 May 2020 02:27:35
Message-Id: 20200504022243.2439148-8-naota@gentoo.org
In Reply to: [gentoo-dev] [PATCH v2 01/10] ruby-ng-gnome2.eclass: drop support for 0.19.x by Naohiro Aota
1 Some ruby-gnome2 ebuild does not build C bindings, so there is no need to
2 call each_ruby_{configure,compile} and emake install of this eclass. Check
3 if "extconf.rb" and "Makefile" to decide what to do.
4
5 Signed-off-by: Naohiro Aota <naota@g.o>
6 ---
7 eclass/ruby-ng-gnome2.eclass | 14 ++++++++++----
8 1 file changed, 10 insertions(+), 4 deletions(-)
9
10 diff --git a/eclass/ruby-ng-gnome2.eclass b/eclass/ruby-ng-gnome2.eclass
11 index 3ba1a11c21d0..7ffe57d1a9ff 100644
12 --- a/eclass/ruby-ng-gnome2.eclass
13 +++ b/eclass/ruby-ng-gnome2.eclass
14 @@ -53,6 +53,8 @@ SLOT="0"
15 # @DESCRIPTION:
16 # Run the configure script in the subbinding for each specific ruby target.
17 each_ruby_configure() {
18 + [[ -e extconf.rb ]] || return
19 +
20 ${RUBY} extconf.rb || die "extconf.rb failed"
21 }
22
23 @@ -60,6 +62,8 @@ each_ruby_configure() {
24 # @DESCRIPTION:
25 # Compile the C bindings in the subbinding for each specific ruby target.
26 each_ruby_compile() {
27 + [[ -e Makefile ]] || return
28 +
29 # We have injected --no-undefined in Ruby as a safety precaution
30 # against broken ebuilds, but the Ruby-Gnome bindings
31 # unfortunately rely on the lazy load of other extensions; see bug
32 @@ -76,11 +80,13 @@ each_ruby_compile() {
33 # @DESCRIPTION:
34 # Install the files in the subbinding for each specific ruby target.
35 each_ruby_install() {
36 - # Create the directories, or the package will create them as files.
37 - local archdir=$(ruby_rbconfig_value "sitearchdir")
38 - dodir ${archdir#${EPREFIX}} /usr/$(get_libdir)/pkgconfig
39 + if [[ -e Makefile ]]; then
40 + # Create the directories, or the package will create them as files.
41 + local archdir=$(ruby_rbconfig_value "sitearchdir")
42 + dodir ${archdir#${EPREFIX}} /usr/$(get_libdir)/pkgconfig
43
44 - emake DESTDIR="${D}" install || die "make install failed"
45 + emake DESTDIR="${D}" install || die "make install failed"
46 + fi
47
48 each_fakegem_install
49 }
50 --
51 2.26.2

Replies