/[gentoo-x86]/dev-lang/ruby/ruby-1.9.3_p194-r1.ebuild
Gentoo

Contents of /dev-lang/ruby/ruby-1.9.3_p194-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.12 - (show annotations) (download)
Sun Jun 30 07:55:19 2013 UTC (17 months, 3 weeks ago) by graaff
Branch: MAIN
CVS Tags: HEAD
Changes since 1.11: +1 -1 lines
FILE REMOVED
Cleanup. Remove vulnerable versions.

(Portage version: 2.1.12.2/cvs/Linux x86_64, signed Manifest commit with key 0x8883FA56A308A8D7!)

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

  ViewVC Help
Powered by ViewVC 1.1.20