1 # Copyright 1999-2018 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 # @ECLASS: ruby-ng-gnome2.eclass
6 # Ruby herd <ruby@gentoo.org>
8 # Author: Hans de Graaff <graaff@gentoo.org>
9 # @SUPPORTED_EAPIS: 0 1 2 3 4 5 6
10 # @BLURB: An eclass to simplify handling of various ruby-gnome2 parts.
12 # This eclass simplifies installation of the various pieces of
13 # ruby-gnome2 since they share a very common installation procedure.
19 die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
23 RUBY_FAKEGEM_NAME="${RUBY_FAKEGEM_NAME:-${PN#ruby-}}"
24 RUBY_FAKEGEM_TASK_TEST=""
25 RUBY_FAKEGEM_TASK_DOC=""
27 inherit ruby-fakegem multilib versionator
31 # Define EPREFIX if needed
32 has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
34 subbinding=${PN#ruby-}
35 if [ $(get_version_component_range "1-2") == "0.19" ]; then
36 subbinding=${subbinding/%2}
38 subbinding=${subbinding/-/_}
39 DEPEND="virtual/pkgconfig"
40 ruby_add_bdepend "dev-ruby/pkg-config"
42 if has "${EAPI:-0}" 0 1 2 3 ; then
43 S=${WORKDIR}/ruby-gnome2-all-${PV}/${subbinding}
45 RUBY_S=ruby-gnome2-all-${PV}/${subbinding}
47 SRC_URI="mirror://sourceforge/ruby-gnome2/ruby-gnome2-all-${PV}.tar.gz"
48 HOMEPAGE="https://ruby-gnome2.osdn.jp/"
52 # @FUNCTION: each_ruby_configure
54 # Run the configure script in the subbinding for each specific ruby target.
55 each_ruby_configure() {
56 ${RUBY} extconf.rb || die "extconf.rb failed"
59 # @FUNCTION: each_ruby_compile
61 # Compile the C bindings in the subbinding for each specific ruby target.
63 # We have injected --no-undefined in Ruby as a safety precaution
64 # against broken ebuilds, but the Ruby-Gnome bindings
65 # unfortunately rely on the lazy load of other extensions; see bug
67 find . -name Makefile -print0 | xargs -0 \
68 sed -i -e 's:-Wl,--no-undefined ::' \
69 -e "s/^ldflags = /ldflags = $\(LDFLAGS\) /" \
70 || die "--no-undefined removal failed"
72 emake V=1 || die "emake failed"
75 # @FUNCTION: each_ruby_install
77 # Install the files in the subbinding for each specific ruby target.
79 # Create the directories, or the package will create them as files.
80 local archdir=$(ruby_rbconfig_value "sitearchdir")
81 dodir ${archdir#${EPREFIX}} /usr/$(get_libdir)/pkgconfig
83 emake DESTDIR="${D}" install || die "make install failed"
88 # @FUNCTION: all_ruby_install
90 # Install the files common to all ruby targets.
92 for doc in ../AUTHORS ../NEWS ChangeLog README; do
93 [ -s "$doc" ] && dodoc $doc
95 if [[ -d sample ]]; then
96 insinto /usr/share/doc/${PF}
97 doins -r sample || die "sample install failed"