| 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.5 2010/12/15 12:38:47 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 ::' \
|
| 47 |
-e "s/^ldflags = /ldflags = $\(LDFLAGS\) /" \
|
| 48 |
|| die "--no-undefined removal failed"
|
| 49 |
|
| 50 |
emake || die "emake failed"
|
| 51 |
}
|
| 52 |
|
| 53 |
# @FUNCTION: each_ruby_install
|
| 54 |
# @DESCRIPTION:
|
| 55 |
# Install the files in the subbinding for each specific ruby target.
|
| 56 |
each_ruby_install() {
|
| 57 |
# Create the directories, or the package will create them as files.
|
| 58 |
local archdir=$(ruby_rbconfig_value "sitearchdir")
|
| 59 |
dodir ${archdir#${EPREFIX}} /usr/$(get_libdir)/pkgconfig
|
| 60 |
|
| 61 |
emake DESTDIR="${D}" install || die "make install failed"
|
| 62 |
}
|
| 63 |
|
| 64 |
# @FUNCTION: all_ruby_install
|
| 65 |
# @DESCRIPTION:
|
| 66 |
# Install the files common to all ruby targets.
|
| 67 |
all_ruby_install() {
|
| 68 |
for doc in ../AUTHORS ../NEWS ChangeLog README; do
|
| 69 |
[ -s "$doc" ] && dodoc $doc
|
| 70 |
done
|
| 71 |
if [[ -d sample ]]; then
|
| 72 |
insinto /usr/share/doc/${PF}
|
| 73 |
doins -r sample || die "sample install failed"
|
| 74 |
fi
|
| 75 |
}
|