/[gentoo-x86]/eclass/ruby-ng-gnome2.eclass
Gentoo

Contents of /eclass/ruby-ng-gnome2.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.9 - (show annotations) (download)
Sun Sep 18 02:06:04 2011 UTC (2 years, 9 months ago) by naota
Branch: MAIN
Changes since 1.8: +4 -1 lines
Add common dependencies

1 # Copyright 1999-2011 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/eclass/ruby-ng-gnome2.eclass,v 1.8 2011/08/22 04:46:32 vapier Exp $
4
5 # @ECLASS: ruby-ng-gnome2.eclass
6 # @MAINTAINER:
7 # Ruby herd <ruby@gentoo.org>
8 # @AUTHOR:
9 # Author: Hans de Graaff <graaff@gentoo.org>
10 # @BLURB: An eclass to simplify handling of various ruby-gnome2 parts.
11 # @DESCRIPTION:
12 # This eclass simplifies installation of the various pieces of
13 # ruby-gnome2 since they share a very common installation procedure.
14
15 inherit ruby-ng multilib versionator
16
17 IUSE=""
18
19 # Define EPREFIX if needed
20 has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
21
22 subbinding=${PN#ruby-}
23 if [ $(get_version_component_range "1-2") == "0.19" ]; then
24 subbinding=${subbinding/%2}
25 else
26 subbinding=${subbinding/-/_}
27 fi
28 S=${WORKDIR}/ruby-gnome2-all-${PV}/${subbinding}
29 SRC_URI="mirror://sourceforge/ruby-gnome2/ruby-gnome2-all-${PV}.tar.gz"
30 HOMEPAGE="http://ruby-gnome2.sourceforge.jp/"
31 LICENSE="Ruby"
32 SLOT="0"
33
34 ruby_add_bdepend "dev-ruby/pkg-config
35 dev-ruby/rubygems"
36
37 # @FUNCTION: each_ruby_configure
38 # @DESCRIPTION:
39 # Run the configure script in the subbinding for each specific ruby target.
40 each_ruby_configure() {
41 ${RUBY} extconf.rb || die "extconf.rb failed"
42 }
43
44 # @FUNCTION: each_ruby_compile
45 # @DESCRIPTION:
46 # Compile the C bindings in the subbinding for each specific ruby target.
47 each_ruby_compile() {
48 # We have injected --no-undefined in Ruby as a safety precaution
49 # against broken ebuilds, but the Ruby-Gnome bindings
50 # unfortunately rely on the lazy load of other extensions; see bug
51 # #320545.
52 find . -name Makefile -print0 | xargs -0 \
53 sed -i -e 's:-Wl,--no-undefined ::' \
54 -e "s/^ldflags = /ldflags = $\(LDFLAGS\) /" \
55 || die "--no-undefined removal failed"
56
57 emake || die "emake failed"
58 }
59
60 # @FUNCTION: each_ruby_install
61 # @DESCRIPTION:
62 # Install the files in the subbinding for each specific ruby target.
63 each_ruby_install() {
64 # Create the directories, or the package will create them as files.
65 local archdir=$(ruby_rbconfig_value "sitearchdir")
66 dodir ${archdir#${EPREFIX}} /usr/$(get_libdir)/pkgconfig
67
68 emake DESTDIR="${D}" install || die "make install failed"
69 }
70
71 # @FUNCTION: all_ruby_install
72 # @DESCRIPTION:
73 # Install the files common to all ruby targets.
74 all_ruby_install() {
75 for doc in ../AUTHORS ../NEWS ChangeLog README; do
76 [ -s "$doc" ] && dodoc $doc
77 done
78 if [[ -d sample ]]; then
79 insinto /usr/share/doc/${PF}
80 doins -r sample || die "sample install failed"
81 fi
82 }

  ViewVC Help
Powered by ViewVC 1.1.20