Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/musl:master commit in: dev-lang/ruby/, dev-lang/ruby/files/
Date: Sun, 27 Mar 2016 17:16:32
Message-Id: 1459099367.4511add6557997292e266f4a40eb7f4432215093.blueness@gentoo
1 commit: 4511add6557997292e266f4a40eb7f4432215093
2 Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
3 AuthorDate: Sun Mar 27 17:22:47 2016 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Sun Mar 27 17:22:47 2016 +0000
6 URL: https://gitweb.gentoo.org/proj/musl.git/commit/?id=4511add6
7
8 Revert "dev-lang/ruby: in tree versions works"
9
10 This reverts commit 500765d83e9879dfa854ff4d661a6216fe538adf.
11
12 There are still some uses for ruby-2.0.0
13
14 dev-lang/ruby/Manifest | 5 +
15 dev-lang/ruby/files/ruby-add-asm_ioctl_h.patch | 11 ++
16 dev-lang/ruby/metadata.xml | 28 +++
17 dev-lang/ruby/ruby-2.0.0_p647-r1.ebuild | 231 +++++++++++++++++++++++++
18 4 files changed, 275 insertions(+)
19
20 diff --git a/dev-lang/ruby/Manifest b/dev-lang/ruby/Manifest
21 new file mode 100644
22 index 0000000..8565f6a
23 --- /dev/null
24 +++ b/dev-lang/ruby/Manifest
25 @@ -0,0 +1,5 @@
26 +AUX ruby-add-asm_ioctl_h.patch 338 SHA256 82fa2b35c1a1ae05aaf7e849bd7b6068951f65609a35de1f88fcf83f254666f2 SHA512 eba8f362cda01fed4d38515a1ce03e4c462ddb6adf686de76b3d91bc5d5484661b7be5a9080624a9fa87fffff27b65c746d7ec94d4e27dbef2f9b321fc286be1 WHIRLPOOL 9c1ac98344cd44a3f9523e7dc723ab6dceab3c1c569d2656d03fdbe7677207bbe52ed5436dcd405c33c16d623333219aa6492dcb76d94b0cf833305589312ae2
27 +DIST ruby-2.0.0-p647.tar.xz 8301008 SHA256 9f793880df1209ea4e5c10ee9d8ef79caa0e73ee769f745f1c191505255e2847 SHA512 38fd2ad631588a0e8adf9a7ae01cb5274eca4fd794c5ed7030e5fae9e53cd8920eaac9d388c73b844a154c7eb56fa6fed8e2ee5df5617efd624b6a568ea4953b WHIRLPOOL c8ec19ed900e6578f1f6e08d1e2a5c015cfa6e81379fb0437a1167ffb8bc56561d02b4b5b35a674039f7adcd2c43b222b89e139cb0ea702e8bfec886872c8e6a
28 +DIST ruby-patches-2.0.0_p647-r1.tar.bz2 3341 SHA256 7d82403fed6216baed59ac1fbba888e2b9a4a9cb742ffd01531753bae07ab6b8 SHA512 40d07275a391df3e0a7a0c2705913c8120a548e223032dc39993f8f873c8d0639646cf728dc95f1400352a13766623ac6d69a1b1ff03183df6fabf32946dd7a6 WHIRLPOOL ed7ea6b1c1fd3570ea85b885f7455d8273cff2a9db2540c9e89faca867bd5eed2b4de52c7d21a96bb33ae0beedce113c68bb6c8cee4688650ff5169bd9c265fd
29 +EBUILD ruby-2.0.0_p647-r1.ebuild 6412 SHA256 793e794ac8333125eba8bace90d0dae825ba66f64088ae07f8aa019079668ff1 SHA512 3052910cd789ec498bfc9312944d18b69517313ebb18e193094503c8d510c132da3225895fa52bffc1c5320c5e21d27199052ad88df74b521d9ef1a41c56ceb9 WHIRLPOOL d9aa2192d62c7cd29857c10fedb8f0750503d6b9b6ea4d61a162721155b3552cc56f9090a40f16b41f58389102d3bc28b1e0ca13cfd5a1530fcef4ffe426807a
30 +MISC metadata.xml 977 SHA256 fc9d7cc6e682821e89141cdfcb007bc889c6cc522f662631e28dc280935a6624 SHA512 274ff4d66139d0e4fb91f339b834e77938e51508e712a5005fbb67e6b16fa04879cbb30ad6ee61cd60b16f01b6e311deee461dbb15ffcd1d9b45119484295750 WHIRLPOOL 44dbd829673c75af5459d1e440aa53be46e8ebc95d91faf0af31b9ad8608dac920d9dc13c11ca24af1646a31d0c5fa6800669fa7ba34c709814dffde226b4418
31
32 diff --git a/dev-lang/ruby/files/ruby-add-asm_ioctl_h.patch b/dev-lang/ruby/files/ruby-add-asm_ioctl_h.patch
33 new file mode 100644
34 index 0000000..9fef9e8
35 --- /dev/null
36 +++ b/dev-lang/ruby/files/ruby-add-asm_ioctl_h.patch
37 @@ -0,0 +1,11 @@
38 +diff -Nuar ruby-2.0.0-p353.orig/io.c ruby-2.0.0-p353/io.c
39 +--- ruby-2.0.0-p353.orig/io.c 2013-10-04 17:30:50.000000000 +0000
40 ++++ ruby-2.0.0-p353/io.c 2014-02-23 13:22:06.038406133 +0000
41 +@@ -19,6 +19,7 @@
42 + #include "id.h"
43 + #include <ctype.h>
44 + #include <errno.h>
45 ++#include <asm/ioctl.h>
46 + #include "ruby_atomic.h"
47 +
48 + #define free(x) xfree(x)
49
50 diff --git a/dev-lang/ruby/metadata.xml b/dev-lang/ruby/metadata.xml
51 new file mode 100644
52 index 0000000..249178b
53 --- /dev/null
54 +++ b/dev-lang/ruby/metadata.xml
55 @@ -0,0 +1,28 @@
56 +<?xml version="1.0" encoding="UTF-8"?>
57 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
58 +<pkgmetadata>
59 + <maintainer type="project">
60 + <email>ruby@g.o</email>
61 + <name>Gentoo Ruby Project</name>
62 + </maintainer>
63 + <use>
64 + <flag name="rubytests">
65 + Install ruby tests that can only be run after ruby is installed
66 + </flag>
67 + <flag name="readline">
68 + Use the <pkg>sys-libs/readline</pkg> library to provide the
69 + readline extension, used for instance by the irb tool. This flag
70 + is meaningful only if the libedit USE flag is disabled.
71 +
72 + If neither libedit nor readline USE flags are enabled, the
73 + readline extension will not be built (and irb will lose line
74 + editing functionality).
75 + </flag>
76 + <flag name="rdoc">
77 + Install <pkg>dev-ruby/rdoc</pkg> after installing Ruby.
78 + </flag>
79 + <flag name="jemalloc">
80 + Use <pkg>dev-libs/jemalloc</pkg> for memory allocation.
81 + </flag>
82 + </use>
83 +</pkgmetadata>
84
85 diff --git a/dev-lang/ruby/ruby-2.0.0_p647-r1.ebuild b/dev-lang/ruby/ruby-2.0.0_p647-r1.ebuild
86 new file mode 100644
87 index 0000000..5908fd1
88 --- /dev/null
89 +++ b/dev-lang/ruby/ruby-2.0.0_p647-r1.ebuild
90 @@ -0,0 +1,231 @@
91 +# Copyright 1999-2015 Gentoo Foundation
92 +# Distributed under the terms of the GNU General Public License v2
93 +# $Id$
94 +
95 +EAPI=5
96 +
97 +#PATCHSET=1
98 +
99 +inherit autotools eutils flag-o-matic multilib versionator
100 +
101 +RUBYPL=$(get_version_component_range 4)
102 +
103 +MY_P="${PN}-$(get_version_component_range 1-3)-${RUBYPL:-0}"
104 +S=${WORKDIR}/${MY_P}
105 +
106 +SLOT=$(get_version_component_range 1-2)
107 +MY_SUFFIX=$(delete_version_separator 1 ${SLOT})
108 +RUBYVERSION=2.0.0
109 +
110 +if [[ -n ${PATCHSET} ]]; then
111 + if [[ ${PVR} == ${PV} ]]; then
112 + PATCHSET="${PV}-r0.${PATCHSET}"
113 + else
114 + PATCHSET="${PVR}.${PATCHSET}"
115 + fi
116 +else
117 + PATCHSET="${PVR}"
118 +fi
119 +
120 +DESCRIPTION="An object-oriented scripting language"
121 +HOMEPAGE="http://www.ruby-lang.org/"
122 +SRC_URI="mirror://ruby/2.0/${MY_P}.tar.xz
123 + https://dev.gentoo.org/~flameeyes/ruby-team/${PN}-patches-${PATCHSET}.tar.bz2"
124 +
125 +LICENSE="|| ( Ruby-BSD BSD-2 )"
126 +KEYWORDS="amd64 arm ~mips ppc x86"
127 +IUSE="berkdb debug doc examples gdbm ipv6 +rdoc rubytests socks5 ssl xemacs ncurses +readline cpu_flags_x86_sse2"
128 +
129 +RDEPEND="
130 + berkdb? ( sys-libs/db:= )
131 + gdbm? ( sys-libs/gdbm )
132 + ssl? ( dev-libs/openssl:0 )
133 + socks5? ( >=net-proxy/dante-1.1.13 )
134 + ncurses? ( sys-libs/ncurses:0= )
135 + readline? ( sys-libs/readline:0 )
136 + dev-libs/libyaml
137 + virtual/libffi
138 + sys-libs/zlib
139 + >=app-eselect/eselect-ruby-20100402
140 + !<dev-ruby/rdoc-3.9.4
141 + !<dev-ruby/rubygems-1.8.10-r1"
142 +
143 +DEPEND="${RDEPEND}"
144 +PDEPEND="
145 + virtual/rubygems[ruby_targets_ruby20]
146 + >=dev-ruby/json-1.7.7[ruby_targets_ruby20]
147 + >=dev-ruby/rake-0.9.6[ruby_targets_ruby20]
148 + rdoc? ( >=dev-ruby/rdoc-4.0.0[ruby_targets_ruby20] )
149 + xemacs? ( app-xemacs/ruby-modes )"
150 +
151 +src_prepare() {
152 + if use cpu_flags_x86_sse2 ; then
153 + excluded_patches="012_no_forced_sse2.patch"
154 + fi
155 +
156 + EPATCH_EXCLUDE="${excluded_patches}" EPATCH_FORCE="yes" EPATCH_SUFFIX="patch" \
157 + epatch "${WORKDIR}/patches"
158 +
159 + epatch "${FILESDIR}"/${PN}-add-asm_ioctl_h.patch
160 + # We can no longer unbundle all of rake because rubygems now depends
161 + # on this. We leave the actual rake code around to bootstrap
162 + # rubygems, but remove the bits that would cause a file collision.
163 + einfo "Unbundling gems..."
164 + cd "$S"
165 + rm -r \
166 + {bin,lib}/rake lib/rake.rb man/rake.1 \
167 + bin/gem || die "removal failed"
168 +
169 + # Fix a hardcoded lib path in configure script
170 + sed -i -e "s:\(RUBY_LIB_PREFIX=\"\${prefix}/\)lib:\1$(get_libdir):" \
171 + configure.in || die "sed failed"
172 +
173 + eautoreconf
174 +}
175 +
176 +src_configure() {
177 + local myconf=
178 +
179 + # The Tk module can no longer be built because the module code is no
180 + # longer compatible with newer stable versions.
181 + # https://bugs.gentoo.org/show_bug.cgi?id=500894
182 + local modules="tk"
183 +
184 + # -fomit-frame-pointer makes ruby segfault, see bug #150413.
185 + filter-flags -fomit-frame-pointer
186 + # In many places aliasing rules are broken; play it safe
187 + # as it's risky with newer compilers to leave it as it is.
188 + append-flags -fno-strict-aliasing
189 + # SuperH needs this
190 + use sh && append-flags -mieee
191 +
192 + # Socks support via dante
193 + if use socks5 ; then
194 + # Socks support can't be disabled as long as SOCKS_SERVER is
195 + # set and socks library is present, so need to unset
196 + # SOCKS_SERVER in that case.
197 + unset SOCKS_SERVER
198 + fi
199 +
200 + # Increase GC_MALLOC_LIMIT if set (default is 8000000)
201 + if [ -n "${RUBY_GC_MALLOC_LIMIT}" ] ; then
202 + append-flags "-DGC_MALLOC_LIMIT=${RUBY_GC_MALLOC_LIMIT}"
203 + fi
204 +
205 + # ipv6 hack, bug 168939. Needs --enable-ipv6.
206 + use ipv6 || myconf="${myconf} --with-lookup-order-hack=INET"
207 +
208 + # Determine which modules *not* to build depending in the USE flags.
209 + if ! use readline ; then
210 + modules="${modules},readline"
211 + fi
212 + if ! use berkdb ; then
213 + modules="${modules},dbm"
214 + fi
215 + if ! use gdbm ; then
216 + modules="${modules},gdbm"
217 + fi
218 + if ! use ssl ; then
219 + modules="${modules},openssl"
220 + fi
221 + if ! use ncurses ; then
222 + modules="${modules},curses"
223 + fi
224 +
225 + INSTALL="${EPREFIX}/usr/bin/install -c" econf \
226 + --program-suffix=${MY_SUFFIX} \
227 + --with-soname=ruby${MY_SUFFIX} \
228 + --docdir=${EPREFIX}/usr/share/doc/${P} \
229 + --enable-shared \
230 + --enable-pthread \
231 + --disable-rpath \
232 + --with-out-ext="${modules}" \
233 + $(use_enable socks5 socks) \
234 + $(use_enable doc install-doc) \
235 + --enable-ipv6 \
236 + $(use_enable debug) \
237 + ${myconf} \
238 + --enable-option-checking=no \
239 + || die "econf failed"
240 +}
241 +
242 +src_compile() {
243 + emake V=1 EXTLDFLAGS="${LDFLAGS}" || die "emake failed"
244 +}
245 +
246 +src_test() {
247 + emake -j1 V=1 test || die "make test failed"
248 +
249 + elog "Ruby's make test has been run. Ruby also ships with a make check"
250 + elog "that cannot be run until after ruby has been installed."
251 + elog
252 + if use rubytests; then
253 + elog "You have enabled rubytests, so they will be installed to"
254 + elog "/usr/share/${PN}-${SLOT}/test. To run them you must be a user other"
255 + elog "than root, and you must place them into a writeable directory."
256 + elog "Then call: "
257 + elog
258 + elog "ruby${MY_SUFFIX} -C /location/of/tests runner.rb"
259 + else
260 + elog "Enable the rubytests USE flag to install the make check tests"
261 + fi
262 +}
263 +
264 +src_install() {
265 + # Remove the remaining bundled gems. We do this late in the process
266 + # since they are used during the build to e.g. create the
267 + # documentation.
268 + rm -rf ext/json || die
269 +
270 + # Ruby is involved in the install process, we don't want interference here.
271 + unset RUBYOPT
272 +
273 + local MINIRUBY=$(echo -e 'include Makefile\ngetminiruby:\n\t@echo $(MINIRUBY)'|make -f - getminiruby)
274 +
275 + LD_LIBRARY_PATH="${D}/usr/$(get_libdir)${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}"
276 + RUBYLIB="${S}:${D}/usr/$(get_libdir)/ruby/${RUBYVERSION}"
277 + for d in $(find "${S}/ext" -type d) ; do
278 + RUBYLIB="${RUBYLIB}:$d"
279 + done
280 + export LD_LIBRARY_PATH RUBYLIB
281 +
282 + emake V=1 DESTDIR="${D}" install || die "make install failed"
283 +
284 + # Remove installed rubygems copy
285 + rm -r "${D}/usr/$(get_libdir)/ruby/${RUBYVERSION}/rubygems" || die "rm rubygems failed"
286 + rm -r "${D}/usr/$(get_libdir)/ruby/${RUBYVERSION}"/rdoc* || die "rm rdoc failed"
287 + rm -r "${D}/usr/bin/"{ri,rdoc}"${MY_SUFFIX}" || die "rm rdoc bins failed"
288 +
289 + if use doc; then
290 + make DESTDIR="${D}" install-doc || die "make install-doc failed"
291 + fi
292 +
293 + if use examples; then
294 + insinto /usr/share/doc/${PF}
295 + doins -r sample
296 + fi
297 +
298 + dodoc ChangeLog NEWS doc/NEWS* README* || die
299 +
300 + if use rubytests; then
301 + pushd test
302 + insinto /usr/share/${PN}-${SLOT}/test
303 + doins -r .
304 + popd
305 + fi
306 +}
307 +
308 +pkg_postinst() {
309 + if [[ ! -n $(readlink "${ROOT}"usr/bin/ruby) ]] ; then
310 + eselect ruby set ruby${MY_SUFFIX}
311 + fi
312 +
313 + elog
314 + elog "To switch between available Ruby profiles, execute as root:"
315 + elog "\teselect ruby set ruby(19|20|...)"
316 + elog
317 +}
318 +
319 +pkg_postrm() {
320 + eselect ruby cleanup
321 +}