/[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.16 - (hide annotations) (download)
Sat Aug 18 07:28:39 2012 UTC (2 years ago) by graaff
Branch: MAIN
CVS Tags: HEAD
Changes since 1.15: +6 -2 lines
Support EAPI=4 (with RUBY_S).

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

  ViewVC Help
Powered by ViewVC 1.1.20