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