| 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.10 2011/09/18 03:45:21 naota 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 |
RUBY_FAKEGEM_NAME="${PN#ruby-}" |
| 16 |
RUBY_FAKEGEM_TASK_TEST="" |
| 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="dev-util/pkgconfig" |
| 31 |
ruby_add_bdepend "dev-ruby/pkg-config |
| 32 |
dev-ruby/rubygems" |
| 33 |
fi |
| 34 |
S=${WORKDIR}/ruby-gnome2-all-${PV}/${subbinding} |
| 35 |
SRC_URI="mirror://sourceforge/ruby-gnome2/ruby-gnome2-all-${PV}.tar.gz" |
| 36 |
HOMEPAGE="http://ruby-gnome2.sourceforge.jp/" |
| 37 |
LICENSE="Ruby" |
| 38 |
SLOT="0" |
| 39 |
|
| 40 |
# @FUNCTION: each_ruby_configure |
| 41 |
# @DESCRIPTION: |
| 42 |
# Run the configure script in the subbinding for each specific ruby target. |
| 43 |
each_ruby_configure() { |
| 44 |
${RUBY} extconf.rb || die "extconf.rb failed" |
| 45 |
} |
| 46 |
|
| 47 |
# @FUNCTION: each_ruby_compile |
| 48 |
# @DESCRIPTION: |
| 49 |
# Compile the C bindings in the subbinding for each specific ruby target. |
| 50 |
each_ruby_compile() { |
| 51 |
# We have injected --no-undefined in Ruby as a safety precaution |
| 52 |
# against broken ebuilds, but the Ruby-Gnome bindings |
| 53 |
# unfortunately rely on the lazy load of other extensions; see bug |
| 54 |
# #320545. |
| 55 |
find . -name Makefile -print0 | xargs -0 \ |
| 56 |
sed -i -e 's:-Wl,--no-undefined ::' \ |
| 57 |
-e "s/^ldflags = /ldflags = $\(LDFLAGS\) /" \ |
| 58 |
|| die "--no-undefined removal failed" |
| 59 |
|
| 60 |
emake || die "emake failed" |
| 61 |
} |
| 62 |
|
| 63 |
# @FUNCTION: each_ruby_install |
| 64 |
# @DESCRIPTION: |
| 65 |
# Install the files in the subbinding for each specific ruby target. |
| 66 |
each_ruby_install() { |
| 67 |
# Create the directories, or the package will create them as files. |
| 68 |
local archdir=$(ruby_rbconfig_value "sitearchdir") |
| 69 |
dodir ${archdir#${EPREFIX}} /usr/$(get_libdir)/pkgconfig |
| 70 |
|
| 71 |
emake DESTDIR="${D}" install || die "make install failed" |
| 72 |
|
| 73 |
each_fakegem_install |
| 74 |
} |
| 75 |
|
| 76 |
# @FUNCTION: all_ruby_install |
| 77 |
# @DESCRIPTION: |
| 78 |
# Install the files common to all ruby targets. |
| 79 |
all_ruby_install() { |
| 80 |
for doc in ../AUTHORS ../NEWS ChangeLog README; do |
| 81 |
[ -s "$doc" ] && dodoc $doc |
| 82 |
done |
| 83 |
if [[ -d sample ]]; then |
| 84 |
insinto /usr/share/doc/${PF} |
| 85 |
doins -r sample || die "sample install failed" |
| 86 |
fi |
| 87 |
|
| 88 |
all_fakegem_install |
| 89 |
} |