kde5.eclass: Cleanup obsolete blocker
[gentoo.git] / eclass / ruby-ng-gnome2.eclass
1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 # @ECLASS: ruby-ng-gnome2.eclass
5 # @MAINTAINER:
6 # Ruby herd <ruby@gentoo.org>
7 # @AUTHOR:
8 # Author: Hans de Graaff <graaff@gentoo.org>
9 # @BLURB: An eclass to simplify handling of various ruby-gnome2 parts.
10 # @DESCRIPTION:
11 # This eclass simplifies installation of the various pieces of
12 # ruby-gnome2 since they share a very common installation procedure.
13
14 RUBY_FAKEGEM_NAME="${RUBY_FAKEGEM_NAME:-${PN#ruby-}}"
15 RUBY_FAKEGEM_TASK_TEST=""
16 RUBY_FAKEGEM_TASK_DOC=""
17
18 inherit ruby-fakegem multilib versionator
19
20 IUSE=""
21
22 # Define EPREFIX if needed
23 has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
24
25 subbinding=${PN#ruby-}
26 if [ $(get_version_component_range "1-2") == "0.19" ]; then
27         subbinding=${subbinding/%2}
28 else
29         subbinding=${subbinding/-/_}
30         DEPEND="virtual/pkgconfig"
31         ruby_add_bdepend "dev-ruby/pkg-config"
32 fi
33 if has "${EAPI:-0}" 0 1 2 3 ; then
34         S=${WORKDIR}/ruby-gnome2-all-${PV}/${subbinding}
35 else
36         RUBY_S=ruby-gnome2-all-${PV}/${subbinding}
37 fi
38 SRC_URI="mirror://sourceforge/ruby-gnome2/ruby-gnome2-all-${PV}.tar.gz"
39 HOMEPAGE="http://ruby-gnome2.sourceforge.jp/"
40 LICENSE="Ruby"
41 SLOT="0"
42
43 # @FUNCTION: each_ruby_configure
44 # @DESCRIPTION:
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"
48 }
49
50 # @FUNCTION: each_ruby_compile
51 # @DESCRIPTION:
52 # Compile the C bindings in the subbinding for each specific ruby target.
53 each_ruby_compile() {
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
57         # #320545.
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"
62
63         emake V=1 || die "emake failed"
64 }
65
66 # @FUNCTION: each_ruby_install
67 # @DESCRIPTION:
68 # Install the files in the subbinding for each specific ruby target.
69 each_ruby_install() {
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
73
74         emake DESTDIR="${D}" install || die "make install failed"
75
76         each_fakegem_install
77 }
78
79 # @FUNCTION: all_ruby_install
80 # @DESCRIPTION:
81 # Install the files common to all ruby targets.
82 all_ruby_install() {
83         for doc in ../AUTHORS ../NEWS ChangeLog README; do
84                 [ -s "$doc" ] && dodoc $doc
85         done
86         if [[ -d sample ]]; then
87                 insinto /usr/share/doc/${PF}
88                 doins -r sample || die "sample install failed"
89         fi
90
91         all_fakegem_install
92 }