Gentoo Archives: gentoo-commits

From: "Hans de Graaff (graaff)" <graaff@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-lang/ruby: ChangeLog ruby-2.2.1.ebuild
Date: Tue, 03 Mar 2015 18:19:39
Message-Id: 20150303181907.A40EA12F7A@oystercatcher.gentoo.org
1 graaff 15/03/03 18:19:07
2
3 Modified: ChangeLog
4 Added: ruby-2.2.1.ebuild
5 Log:
6 Version bump.
7
8 (Portage version: 2.2.14/cvs/Linux x86_64, signed Manifest commit with key 0x8883FA56A308A8D7!)
9
10 Revision Changes Path
11 1.702 dev-lang/ruby/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/ruby/ChangeLog?rev=1.702&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/ruby/ChangeLog?rev=1.702&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/ruby/ChangeLog?r1=1.701&r2=1.702
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/dev-lang/ruby/ChangeLog,v
20 retrieving revision 1.701
21 retrieving revision 1.702
22 diff -u -r1.701 -r1.702
23 --- ChangeLog 25 Feb 2015 16:26:02 -0000 1.701
24 +++ ChangeLog 3 Mar 2015 18:19:07 -0000 1.702
25 @@ -1,6 +1,11 @@
26 # ChangeLog for dev-lang/ruby
27 # Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/ruby/ChangeLog,v 1.701 2015/02/25 16:26:02 graaff Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/ruby/ChangeLog,v 1.702 2015/03/03 18:19:07 graaff Exp $
30 +
31 +*ruby-2.2.1 (03 Mar 2015)
32 +
33 + 03 Mar 2015; Hans de Graaff <graaff@g.o> +ruby-2.2.1.ebuild:
34 + Version bump.
35
36 *ruby-2.0.0_p643 (25 Feb 2015)
37
38
39
40
41 1.1 dev-lang/ruby/ruby-2.2.1.ebuild
42
43 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/ruby/ruby-2.2.1.ebuild?rev=1.1&view=markup
44 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/ruby/ruby-2.2.1.ebuild?rev=1.1&content-type=text/plain
45
46 Index: ruby-2.2.1.ebuild
47 ===================================================================
48 # Copyright 1999-2015 Gentoo Foundation
49 # Distributed under the terms of the GNU General Public License v2
50 # $Header: /var/cvsroot/gentoo-x86/dev-lang/ruby/ruby-2.2.1.ebuild,v 1.1 2015/03/03 18:19:07 graaff Exp $
51
52 EAPI=5
53
54 #PATCHSET=1
55
56 inherit autotools eutils flag-o-matic multilib versionator
57
58 MY_P="${PN}-$(get_version_component_range 1-3)"
59 S=${WORKDIR}/${MY_P}
60
61 SLOT=$(get_version_component_range 1-2)
62 MY_SUFFIX=$(delete_version_separator 1 ${SLOT})
63 RUBYVERSION=2.2.0
64
65 if [[ -n ${PATCHSET} ]]; then
66 if [[ ${PVR} == ${PV} ]]; then
67 PATCHSET="${PV}-r0.${PATCHSET}"
68 else
69 PATCHSET="${PVR}.${PATCHSET}"
70 fi
71 else
72 PATCHSET="${PVR}"
73 fi
74
75 DESCRIPTION="An object-oriented scripting language"
76 HOMEPAGE="http://www.ruby-lang.org/"
77 SRC_URI="mirror://ruby/2.2/${MY_P}.tar.xz
78 http://dev.gentoo.org/~flameeyes/ruby-team/${PN}-patches-${PATCHSET}.tar.bz2"
79
80 LICENSE="|| ( Ruby-BSD BSD-2 )"
81 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd"
82 IUSE="berkdb debug doc examples gdbm ipv6 jemalloc +rdoc rubytests socks5 ssl xemacs ncurses +readline"
83
84 RDEPEND="
85 berkdb? ( sys-libs/db )
86 gdbm? ( sys-libs/gdbm )
87 jemalloc? ( dev-libs/jemalloc )
88 ssl? ( dev-libs/openssl )
89 socks5? ( >=net-proxy/dante-1.1.13 )
90 ncurses? ( sys-libs/ncurses )
91 readline? ( sys-libs/readline )
92 dev-libs/libyaml
93 virtual/libffi
94 sys-libs/zlib
95 >=app-admin/eselect-ruby-20141227
96 !<dev-ruby/rdoc-3.9.4
97 !<dev-ruby/rubygems-1.8.10-r1"
98
99 DEPEND="${RDEPEND}"
100
101 BUNDLED_GEMS="
102 >=dev-ruby/minitest-5.4.3[ruby_targets_ruby22]
103 >=dev-ruby/power_assert-0.2.2[ruby_targets_ruby22]
104 >=dev-ruby/test-unit-3.0.8[ruby_targets_ruby22]
105 "
106
107 PDEPEND="
108 ${BUNDLED_GEMS}
109 virtual/rubygems[ruby_targets_ruby22]
110 >=dev-ruby/json-1.8.1[ruby_targets_ruby22]
111 >=dev-ruby/rake-0.9.6[ruby_targets_ruby22]
112 rdoc? ( >=dev-ruby/rdoc-4.0.1[ruby_targets_ruby22] )
113 xemacs? ( app-xemacs/ruby-modes )"
114
115 src_prepare() {
116 EPATCH_FORCE="yes" EPATCH_SUFFIX="patch" \
117 epatch "${WORKDIR}/patches"
118
119 # We can no longer unbundle all of rake because rubygems now depends
120 # on this. We leave the actual rake code around to bootstrap
121 # rubygems, but remove the bits that would cause a file collision.
122 einfo "Unbundling gems..."
123 cd "$S"
124 rm -r \
125 {bin,lib}/rake lib/rake.rb man/rake.1 \
126 bin/gem || die "removal failed"
127 # Remove bundled gems that we will install via PDEPEND, bug
128 # 539700. Use explicit version numbers to ensure rm fails when they
129 # change so we can update dependencies accordingly.
130 rm gems/{minitest-5.4.3,power_assert-0.2.2,test-unit-3.0.8}.gem || die
131
132 # Fix a hardcoded lib path in configure script
133 sed -i -e "s:\(RUBY_LIB_PREFIX=\"\${prefix}/\)lib:\1$(get_libdir):" \
134 configure.in || die "sed failed"
135
136 eautoreconf
137 }
138
139 src_configure() {
140 local myconf=
141
142 # The Tk module can no longer be built because the module code is no
143 # longer compatible with newer stable versions.
144 # https://bugs.gentoo.org/show_bug.cgi?id=500894
145 local modules="tk"
146
147 # -fomit-frame-pointer makes ruby segfault, see bug #150413.
148 filter-flags -fomit-frame-pointer
149 # In many places aliasing rules are broken; play it safe
150 # as it's risky with newer compilers to leave it as it is.
151 append-flags -fno-strict-aliasing
152 # SuperH needs this
153 use sh && append-flags -mieee
154
155 # Socks support via dante
156 if use socks5 ; then
157 # Socks support can't be disabled as long as SOCKS_SERVER is
158 # set and socks library is present, so need to unset
159 # SOCKS_SERVER in that case.
160 unset SOCKS_SERVER
161 fi
162
163 # Increase GC_MALLOC_LIMIT if set (default is 8000000)
164 if [ -n "${RUBY_GC_MALLOC_LIMIT}" ] ; then
165 append-flags "-DGC_MALLOC_LIMIT=${RUBY_GC_MALLOC_LIMIT}"
166 fi
167
168 # ipv6 hack, bug 168939. Needs --enable-ipv6.
169 use ipv6 || myconf="${myconf} --with-lookup-order-hack=INET"
170
171 # Determine which modules *not* to build depending in the USE flags.
172 if ! use readline ; then
173 modules="${modules},readline"
174 fi
175 if ! use berkdb ; then
176 modules="${modules},dbm"
177 fi
178 if ! use gdbm ; then
179 modules="${modules},gdbm"
180 fi
181 if ! use ssl ; then
182 modules="${modules},openssl"
183 fi
184 if ! use ncurses ; then
185 modules="${modules},curses"
186 fi
187
188 INSTALL="${EPREFIX}/usr/bin/install -c" econf \
189 --program-suffix=${MY_SUFFIX} \
190 --with-soname=ruby${MY_SUFFIX} \
191 --docdir=${EPREFIX}/usr/share/doc/${P} \
192 --enable-shared \
193 --enable-pthread \
194 --disable-rpath \
195 --with-out-ext="${modules}" \
196 $(use_enable jemalloc jemalloc) \
197 $(use_enable socks5 socks) \
198 $(use_enable doc install-doc) \
199 --enable-ipv6 \
200 $(use_enable debug) \
201 ${myconf} \
202 --enable-option-checking=no \
203 || die "econf failed"
204 }
205
206 src_compile() {
207 emake V=1 EXTLDFLAGS="${LDFLAGS}" || die "emake failed"
208 }
209
210 src_test() {
211 emake -j1 V=1 test || die "make test failed"
212
213 elog "Ruby's make test has been run. Ruby also ships with a make check"
214 elog "that cannot be run until after ruby has been installed."
215 elog
216 if use rubytests; then
217 elog "You have enabled rubytests, so they will be installed to"
218 elog "/usr/share/${PN}-${SLOT}/test. To run them you must be a user other"
219 elog "than root, and you must place them into a writeable directory."
220 elog "Then call: "
221 elog
222 elog "ruby${MY_SUFFIX} -C /location/of/tests runner.rb"
223 else
224 elog "Enable the rubytests USE flag to install the make check tests"
225 fi
226 }
227
228 src_install() {
229 # Remove the remaining bundled gems. We do this late in the process
230 # since they are used during the build to e.g. create the
231 # documentation.
232 rm -rf ext/json || die
233
234 # Ruby is involved in the install process, we don't want interference here.
235 unset RUBYOPT
236
237 local MINIRUBY=$(echo -e 'include Makefile\ngetminiruby:\n\t@echo $(MINIRUBY)'|make -f - getminiruby)
238
239 LD_LIBRARY_PATH="${D}/usr/$(get_libdir)${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}"
240 RUBYLIB="${S}:${D}/usr/$(get_libdir)/ruby/${RUBYVERSION}"
241 for d in $(find "${S}/ext" -type d) ; do
242 RUBYLIB="${RUBYLIB}:$d"
243 done
244 export LD_LIBRARY_PATH RUBYLIB
245
246 emake V=1 DESTDIR="${D}" install || die "make install failed"
247
248 # Remove installed rubygems copy
249 rm -r "${D}/usr/$(get_libdir)/ruby/${RUBYVERSION}/rubygems" || die "rm rubygems failed"
250 rm -r "${D}/usr/$(get_libdir)/ruby/${RUBYVERSION}"/rdoc* || die "rm rdoc failed"
251 rm -r "${D}/usr/bin/"{ri,rdoc}"${MY_SUFFIX}" || die "rm rdoc bins failed"
252
253 if use doc; then
254 make DESTDIR="${D}" install-doc || die "make install-doc failed"
255 fi
256
257 if use examples; then
258 insinto /usr/share/doc/${PF}
259 doins -r sample
260 fi
261
262 dodoc ChangeLog NEWS doc/NEWS* README* || die
263
264 if use rubytests; then
265 pushd test
266 insinto /usr/share/${PN}-${SLOT}/test
267 doins -r .
268 popd
269 fi
270 }
271
272 pkg_postinst() {
273 if [[ ! -n $(readlink "${ROOT}"usr/bin/ruby) ]] ; then
274 eselect ruby set ruby${MY_SUFFIX}
275 fi
276
277 elog
278 elog "To switch between available Ruby profiles, execute as root:"
279 elog "\teselect ruby set ruby(19|20|...)"
280 elog
281 }
282
283 pkg_postrm() {
284 eselect ruby cleanup
285 }