/[gentoo-x86]/dev-lang/ruby/ruby-1.8.7_p352.ebuild
Gentoo

Contents of /dev-lang/ruby/ruby-1.8.7_p352.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations) (download)
Sat Oct 22 12:07:43 2011 UTC (2 years, 10 months ago) by armin76
Branch: MAIN
Changes since 1.6: +2 -2 lines
alpha/ia64/s390/sh/sparc stable wrt #386369

(Portage version: 2.1.10.11/cvs/Linux ia64)

1 # Copyright 1999-2011 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-lang/ruby/ruby-1.8.7_p352.ebuild,v 1.6 2011/10/15 22:14:40 maekke Exp $
4
5 EAPI=2
6
7 inherit autotools eutils flag-o-matic multilib versionator
8
9 MY_P="${PN}-$(replace_version_separator 3 '-')"
10 S=${WORKDIR}/${MY_P}
11
12 SLOT=$(get_version_component_range 1-2)
13 MY_SUFFIX=$(delete_version_separator 1 ${SLOT})
14 # 1.8 and 1.9 series disagree on this
15 RUBYVERSION=$(get_version_component_range 1-2)
16
17 if [[ -n ${PATCHSET} ]]; then
18 if [[ ${PVR} == ${PV} ]]; then
19 PATCHSET="${PV}-r0.${PATCHSET}"
20 else
21 PATCHSET="${PVR}.${PATCHSET}"
22 fi
23 else
24 PATCHSET="${PVR}"
25 fi
26
27 DESCRIPTION="An object-oriented scripting language"
28 HOMEPAGE="http://www.ruby-lang.org/"
29 SRC_URI="mirror://ruby/${SLOT}/${MY_P}.tar.bz2
30 http://dev.gentoo.org/~flameeyes/ruby-team/${PN}-patches-${PATCHSET}.tar.bz2"
31
32 LICENSE="|| ( Ruby GPL-2 )"
33 KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
34 IUSE="+berkdb debug doc examples +gdbm ipv6 rubytests socks5 ssl threads tk xemacs ncurses +readline libedit"
35
36 RDEPEND="
37 berkdb? ( sys-libs/db )
38 gdbm? ( sys-libs/gdbm )
39 ssl? ( >=dev-libs/openssl-0.9.8m )
40 socks5? ( >=net-proxy/dante-1.1.13 )
41 tk? ( dev-lang/tk[threads=] )
42 ncurses? ( sys-libs/ncurses )
43 libedit? ( dev-libs/libedit )
44 !libedit? ( readline? ( sys-libs/readline ) )
45 sys-libs/zlib
46 >=app-admin/eselect-ruby-20100603
47 !=dev-lang/ruby-cvs-${SLOT}*
48 !<dev-ruby/rdoc-2
49 !dev-ruby/rexml"
50 DEPEND="${RDEPEND}"
51 PDEPEND="xemacs? ( app-xemacs/ruby-modes )"
52
53 src_prepare() {
54 EPATCH_FORCE="yes" EPATCH_SUFFIX="patch" \
55 epatch "${WORKDIR}/patches"
56
57 # Fix a hardcoded lib path in configure script
58 sed -i -e "s:\(RUBY_LIB_PREFIX=\"\${prefix}/\)lib:\1$(get_libdir):" \
59 configure.in || die "sed failed"
60
61 eautoreconf
62 }
63
64 src_configure() {
65 local myconf=
66
67 # -fomit-frame-pointer makes ruby segfault, see bug #150413.
68 filter-flags -fomit-frame-pointer
69 # In many places aliasing rules are broken; play it safe
70 # as it's risky with newer compilers to leave it as it is.
71 append-flags -fno-strict-aliasing
72
73 # Socks support via dante
74 if use socks5 ; then
75 # Socks support can't be disabled as long as SOCKS_SERVER is
76 # set and socks library is present, so need to unset
77 # SOCKS_SERVER in that case.
78 unset SOCKS_SERVER
79 fi
80
81 # Increase GC_MALLOC_LIMIT if set (default is 8000000)
82 if [ -n "${RUBY_GC_MALLOC_LIMIT}" ] ; then
83 append-flags "-DGC_MALLOC_LIMIT=${RUBY_GC_MALLOC_LIMIT}"
84 fi
85
86 # ipv6 hack, bug 168939. Needs --enable-ipv6.
87 use ipv6 || myconf="${myconf} --with-lookup-order-hack=INET"
88
89 if use libedit; then
90 einfo "Using libedit to provide readline extension"
91 myconf="${myconf} --enable-libedit --with-readline"
92 elif use readline; then
93 einfo "Using readline to provide readline extension"
94 myconf="${myconf} --with-readline"
95 else
96 myconf="${myconf} --without-readline"
97 fi
98
99 econf \
100 --program-suffix="${MY_SUFFIX}" \
101 --enable-shared \
102 $(use_enable socks5 socks) \
103 $(use_enable doc install-doc) \
104 $(use_enable threads pthread) \
105 --enable-ipv6 \
106 $(use_enable debug) \
107 $(use_with berkdb dbm) \
108 $(use_with gdbm) \
109 $(use_with ssl openssl) \
110 $(use_with tk) \
111 $(use_with ncurses curses) \
112 ${myconf} \
113 --with-sitedir=/usr/$(get_libdir)/ruby/site_ruby \
114 --enable-option-checking=no \
115 || die "econf failed"
116 }
117
118 src_compile() {
119 emake EXTLDFLAGS="${LDFLAGS}" || die "emake failed"
120 }
121
122 src_test() {
123 emake -j1 test || die "make test failed"
124
125 elog "Ruby's make test has been run. Ruby also ships with a make check"
126 elog "that cannot be run until after ruby has been installed."
127 elog
128 if use rubytests; then
129 elog "You have enabled rubytests, so they will be installed to"
130 elog "/usr/share/${PN}-${SLOT}/test. To run them you must be a user other"
131 elog "than root, and you must place them into a writeable directory."
132 elog "Then call: "
133 elog
134 elog "ruby${MY_SUFFIX} -C /location/of/tests runner.rb"
135 else
136 elog "Enable the rubytests USE flag to install the make check tests"
137 fi
138 }
139
140 src_install() {
141 # Ruby is involved in the install process, we don't want interference here.
142 unset RUBYOPT
143
144 local MINIRUBY=$(echo -e 'include Makefile\ngetminiruby:\n\t@echo $(MINIRUBY)'|make -f - getminiruby)
145
146 LD_LIBRARY_PATH="${D}/usr/$(get_libdir)${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}"
147 RUBYLIB="${S}:${D}/usr/$(get_libdir)/ruby/${RUBYVERSION}"
148 for d in $(find "${S}/ext" -type d) ; do
149 RUBYLIB="${RUBYLIB}:$d"
150 done
151 export LD_LIBRARY_PATH RUBYLIB
152
153 emake DESTDIR="${D}" install || die "make install failed"
154
155 keepdir $(${MINIRUBY} -rrbconfig -e "print Config::CONFIG['sitelibdir']")
156 keepdir $(${MINIRUBY} -rrbconfig -e "print Config::CONFIG['sitearchdir']")
157
158 if use doc; then
159 make DESTDIR="${D}" install-doc || die "make install-doc failed"
160 fi
161
162 if use examples; then
163 insinto /usr/share/doc/${PF}
164 doins -r sample
165 fi
166
167 dosym "libruby${MY_SUFFIX}$(get_libname ${PV%_*})" \
168 "/usr/$(get_libdir)/libruby$(get_libname ${PV%.*})"
169 dosym "libruby${MY_SUFFIX}$(get_libname ${PV%_*})" \
170 "/usr/$(get_libdir)/libruby$(get_libname ${PV%_*})"
171
172 dodoc ChangeLog NEWS README* ToDo || die
173
174 if use rubytests; then
175 pushd test
176 insinto /usr/share/${PN}-${SLOT}/test
177 doins -r .
178 popd
179 fi
180 }
181
182 pkg_postinst() {
183 if [[ ! -n $(readlink "${ROOT}"usr/bin/ruby) ]] ; then
184 eselect ruby set ruby${MY_SUFFIX}
185 fi
186
187 elog
188 elog "To switch between available Ruby profiles, execute as root:"
189 elog "\teselect ruby set ruby(18|19|...)"
190 elog
191 }
192
193 pkg_postrm() {
194 eselect ruby cleanup
195 }

  ViewVC Help
Powered by ViewVC 1.1.20