1 # Copyright 1999-2014 Gentoo Foundation
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 # @BLURB: An eclass to simplify handling of various ruby-gnome2 parts.
11 # This eclass simplifies installation of the various pieces of
12 # ruby-gnome2 since they share a very common installation procedure.
14 RUBY_FAKEGEM_NAME="${RUBY_FAKEGEM_NAME:-${PN#ruby-}}"
15 RUBY_FAKEGEM_TASK_TEST=""
16 RUBY_FAKEGEM_TASK_DOC=""
18 inherit ruby-fakegem multilib versionator
22 # Define EPREFIX if needed
23 has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
25 subbinding=${PN#ruby-}
26 if [ $(get_version_component_range "1-2") == "0.19" ]; then
27 subbinding=${subbinding/%2}
29 subbinding=${subbinding/-/_}
30 DEPEND="virtual/pkgconfig"
31 ruby_add_bdepend "dev-ruby/pkg-config"
33 if has "${EAPI:-0}" 0 1 2 3 ; then
34 S=${WORKDIR}/ruby-gnome2-all-${PV}/${subbinding}
36 RUBY_S=ruby-gnome2-all-${PV}/${subbinding}
38 SRC_URI="mirror://sourceforge/ruby-gnome2/ruby-gnome2-all-${PV}.tar.gz"
39 HOMEPAGE="http://ruby-gnome2.sourceforge.jp/"
43 # @FUNCTION: each_ruby_configure
45 # Run the configure script in the subbinding for each specific ruby target.
46 each_ruby_configure() {
47 ${RUBY} extconf.rb || die "extconf.rb failed"
50 # @FUNCTION: each_ruby_compile
52 # Compile the C bindings in the subbinding for each specific ruby target.
54 # We have injected --no-undefined in Ruby as a safety precaution
55 # against broken ebuilds, but the Ruby-Gnome bindings
56 # unfortunately rely on the lazy load of other extensions; see bug
58 find . -name Makefile -print0 | xargs -0 \
59 sed -i -e 's:-Wl,--no-undefined ::' \
60 -e "s/^ldflags = /ldflags = $\(LDFLAGS\) /" \
61 || die "--no-undefined removal failed"
63 emake V=1 || die "emake failed"
66 # @FUNCTION: each_ruby_install
68 # Install the files in the subbinding for each specific ruby target.
70 # Create the directories, or the package will create them as files.
71 local archdir=$(ruby_rbconfig_value "sitearchdir")
72 dodir ${archdir#${EPREFIX}} /usr/$(get_libdir)/pkgconfig
74 emake DESTDIR="${D}" install || die "make install failed"
79 # @FUNCTION: all_ruby_install
81 # Install the files common to all ruby targets.
83 for doc in ../AUTHORS ../NEWS ChangeLog README; do
84 [ -s "$doc" ] && dodoc $doc
86 if [[ -d sample ]]; then
87 insinto /usr/share/doc/${PF}
88 doins -r sample || die "sample install failed"