| 1 | # Copyright 1999-2010 Gentoo Foundation |
1 | # Copyright 1999-2010 Gentoo Foundation |
| 2 | # Distributed under the terms of the GNU General Public License v2 |
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.1 2010/01/13 18:33:32 graaff Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/ruby-ng-gnome2.eclass,v 1.6 2011/05/29 13:43:16 naota Exp $ |
| 4 | # |
4 | # |
| 5 | # @ECLASS: ruby-ng-gnome2.eclass |
5 | # @ECLASS: ruby-ng-gnome2.eclass |
| 6 | # @MAINTAINER: |
6 | # @MAINTAINER: |
| 7 | # Ruby herd <ruby@gentoo.org> |
7 | # Ruby herd <ruby@gentoo.org> |
| 8 | # |
8 | # |
| 9 | # Author: Hans de Graaff <graaff@gentoo.org> |
9 | # Author: Hans de Graaff <graaff@gentoo.org> |
| 10 | # |
10 | # |
| 11 | # @BLURB: |
11 | # @BLURB: An eclass to simplify handling of various ruby-gnome2 parts. |
|
|
12 | # @DESCRIPTION: |
| 12 | # This eclass simplifies installation of the various pieces of |
13 | # This eclass simplifies installation of the various pieces of |
| 13 | # ruby-gnome2 since they share a very common installation procedure. |
14 | # ruby-gnome2 since they share a very common installation procedure. |
| 14 | |
15 | |
| 15 | inherit ruby-ng multilib |
16 | inherit ruby-ng multilib |
| 16 | |
17 | |
| 17 | IUSE="" |
18 | IUSE="" |
|
|
19 | |
|
|
20 | # Define EPREFIX if needed |
|
|
21 | has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX= |
| 18 | |
22 | |
| 19 | subbinding=${PN#ruby-} ; subbinding=${subbinding%2} |
23 | subbinding=${PN#ruby-} ; subbinding=${subbinding%2} |
| 20 | S=${WORKDIR}/ruby-gnome2-all-${PV}/${subbinding} |
24 | S=${WORKDIR}/ruby-gnome2-all-${PV}/${subbinding} |
| 21 | SRC_URI="mirror://sourceforge/ruby-gnome2/ruby-gnome2-all-${PV}.tar.gz" |
25 | SRC_URI="mirror://sourceforge/ruby-gnome2/ruby-gnome2-all-${PV}.tar.gz" |
| 22 | HOMEPAGE="http://ruby-gnome2.sourceforge.jp/" |
26 | HOMEPAGE="http://ruby-gnome2.sourceforge.jp/" |
| … | |
… | |
| 32 | |
36 | |
| 33 | # @FUNCTION: each_ruby_compile |
37 | # @FUNCTION: each_ruby_compile |
| 34 | # @DESCRIPTION: |
38 | # @DESCRIPTION: |
| 35 | # Compile the C bindings in the subbinding for each specific ruby target. |
39 | # Compile the C bindings in the subbinding for each specific ruby target. |
| 36 | each_ruby_compile() { |
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 | |
| 37 | emake || die "emake failed" |
50 | emake || die "emake failed" |
| 38 | } |
51 | } |
| 39 | |
52 | |
| 40 | # @FUNCTION: each_ruby_install |
53 | # @FUNCTION: each_ruby_install |
| 41 | # @DESCRIPTION: |
54 | # @DESCRIPTION: |
| 42 | # Install the files in the subbinding for each specific ruby target. |
55 | # Install the files in the subbinding for each specific ruby target. |
| 43 | each_ruby_install() { |
56 | each_ruby_install() { |
| 44 | # Create the directories, or the package will create them as files. |
57 | # Create the directories, or the package will create them as files. |
| 45 | dodir $(${RUBY} -r rbconfig -e 'print Config::CONFIG["sitearchdir"]') /usr/$(get_libdir)/pkgconfig |
58 | local archdir=$(ruby_rbconfig_value "sitearchdir") |
|
|
59 | dodir ${archdir#${EPREFIX}} /usr/$(get_libdir)/pkgconfig |
| 46 | |
60 | |
| 47 | emake DESTDIR="${D}" install || die "make install failed" |
61 | emake DESTDIR="${D}" install || die "make install failed" |
| 48 | } |
62 | } |
| 49 | |
63 | |
| 50 | # @FUNCTION: all_ruby_install |
64 | # @FUNCTION: all_ruby_install |
| … | |
… | |
| 53 | all_ruby_install() { |
67 | all_ruby_install() { |
| 54 | for doc in ../AUTHORS ../NEWS ChangeLog README; do |
68 | for doc in ../AUTHORS ../NEWS ChangeLog README; do |
| 55 | [ -s "$doc" ] && dodoc $doc |
69 | [ -s "$doc" ] && dodoc $doc |
| 56 | done |
70 | done |
| 57 | if [[ -d sample ]]; then |
71 | if [[ -d sample ]]; then |
| 58 | dodir /usr/share/doc/${PF} |
72 | insinto /usr/share/doc/${PF} |
| 59 | cp -a sample "${D}"/usr/share/doc/${PF} || die "cp failed" |
73 | doins -r sample || die "sample install failed" |
| 60 | fi |
74 | fi |
| 61 | } |
75 | } |