Gentoo Archives: gentoo-commits

From: Hans de Graaff <graaff@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/ruby/
Date: Tue, 11 Dec 2018 09:48:36
Message-Id: 1544521686.51ae16ec01c1575c8335066aa2620d8bc3bede0e.graaff@gentoo
1 commit: 51ae16ec01c1575c8335066aa2620d8bc3bede0e
2 Author: Hans de Graaff <graaff <AT> gentoo <DOT> org>
3 AuthorDate: Tue Dec 11 09:08:25 2018 +0000
4 Commit: Hans de Graaff <graaff <AT> gentoo <DOT> org>
5 CommitDate: Tue Dec 11 09:48:06 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=51ae16ec
7
8 dev-lang/ruby: 2.3 requires <dev-libs/openssl-1.1
9
10 Ruby 2.3 does not compile with dev-libs/openssl-1.1.0 or newer
11 and this will not be fixed upstream since ruby 2.3 is EOL in
12 March 2019 and currently only receives security fixes.
13
14 Thanks to candrews for the proposed approach to this.
15
16 Fixes: https://bugs.gentoo.org/646734
17 Package-Manager: Portage-2.3.51, Repoman-2.3.11
18 Signed-off-by: Hans de Graaff <graaff <AT> gentoo.org>
19
20 dev-lang/ruby/Manifest | 1 +
21 dev-lang/ruby/ruby-2.3.8-r1.ebuild | 242 +++++++++++++++++++++++++++++++++++++
22 2 files changed, 243 insertions(+)
23
24 diff --git a/dev-lang/ruby/Manifest b/dev-lang/ruby/Manifest
25 index e2c77634dfe..4f02cd756e3 100644
26 --- a/dev-lang/ruby/Manifest
27 +++ b/dev-lang/ruby/Manifest
28 @@ -3,4 +3,5 @@ DIST ruby-2.3.8.tar.xz 11465792 BLAKE2B b9c8ef5c943872e3d1426c30cbd720acc66d17cc
29 DIST ruby-2.4.5.tar.xz 10064712 BLAKE2B 0846125e617b43ea302b4c5309b20503577937865d445a6fee766323a188aa552d3a13740c3d38c7be812b19bffb2474021cb7b368cc144d51ea771552f62769 SHA512 658f676c623109f4c7499615e191c98c3dd72cfcaeeaf121337d0b8a33c5243145edd50ec5e2775f988e3cd19788984f105fa165e3049779066566f67172c1b4
30 DIST ruby-2.5.3.tar.xz 11453336 BLAKE2B 66c59448a23c22796b43f04a1f84359386b7bee7163da4255426ea75b1c7af0a7a7142991b870a75a72ded56ac49f47c51bc162ebf2be2af0d1b1608b60c02df SHA512 6dcae0e8d0bacdb2cbde636e2030596308b5af53f2eb85d3adccb67b02e6f8f9751e8117d12f8484829fdd9d995f6e327f701d9b433bcf94f1f59d13a1fd7518
31 DIST ruby-patches-2.3.7.tar.bz2 3030 BLAKE2B 7c1e80ff0569a03672f53820c665933056b46bcf791c9132cb9f358f72df693749f02da65ca7469c3dd0f652d7dc7bfaa03dccd4eb900562361876023fb65b42 SHA512 54cc3f2bfd1967b8558736e5a5240b886a56b22defca5813f45b1f4dca9af169b4d59d60b327ec8411e824970ac6da1cec53cfc31833403742e9d6941e5a78f1
32 +DIST ruby-patches-2.3.8-r1.tar.bz2 3030 BLAKE2B 7c1e80ff0569a03672f53820c665933056b46bcf791c9132cb9f358f72df693749f02da65ca7469c3dd0f652d7dc7bfaa03dccd4eb900562361876023fb65b42 SHA512 54cc3f2bfd1967b8558736e5a5240b886a56b22defca5813f45b1f4dca9af169b4d59d60b327ec8411e824970ac6da1cec53cfc31833403742e9d6941e5a78f1
33 DIST ruby-patches-2.3.8.tar.bz2 3030 BLAKE2B 7c1e80ff0569a03672f53820c665933056b46bcf791c9132cb9f358f72df693749f02da65ca7469c3dd0f652d7dc7bfaa03dccd4eb900562361876023fb65b42 SHA512 54cc3f2bfd1967b8558736e5a5240b886a56b22defca5813f45b1f4dca9af169b4d59d60b327ec8411e824970ac6da1cec53cfc31833403742e9d6941e5a78f1
34
35 diff --git a/dev-lang/ruby/ruby-2.3.8-r1.ebuild b/dev-lang/ruby/ruby-2.3.8-r1.ebuild
36 new file mode 100644
37 index 00000000000..6141a3902f9
38 --- /dev/null
39 +++ b/dev-lang/ruby/ruby-2.3.8-r1.ebuild
40 @@ -0,0 +1,242 @@
41 +# Copyright 1999-2018 Gentoo Authors
42 +# Distributed under the terms of the GNU General Public License v2
43 +
44 +EAPI=5
45 +
46 +#PATCHSET=1
47 +
48 +inherit autotools eutils flag-o-matic multilib versionator
49 +
50 +MY_P="${PN}-$(get_version_component_range 1-3)"
51 +S=${WORKDIR}/${MY_P}
52 +
53 +SLOT=$(get_version_component_range 1-2)
54 +MY_SUFFIX=$(delete_version_separator 1 ${SLOT})
55 +RUBYVERSION=2.3.0
56 +
57 +if [[ -n ${PATCHSET} ]]; then
58 + if [[ ${PVR} == ${PV} ]]; then
59 + PATCHSET="${PV}-r0.${PATCHSET}"
60 + else
61 + PATCHSET="${PVR}.${PATCHSET}"
62 + fi
63 +else
64 + PATCHSET="${PVR}"
65 +fi
66 +
67 +DESCRIPTION="An object-oriented scripting language"
68 +HOMEPAGE="https://www.ruby-lang.org/"
69 +SRC_URI="mirror://ruby/${SLOT}/${MY_P}.tar.xz
70 + https://dev.gentoo.org/~flameeyes/ruby-team/${PN}-patches-${PATCHSET}.tar.bz2"
71 +
72 +LICENSE="|| ( Ruby-BSD BSD-2 )"
73 +KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd"
74 +IUSE="berkdb debug doc examples gdbm ipv6 jemalloc libressl +rdoc rubytests socks5 ssl tk xemacs ncurses +readline"
75 +
76 +RDEPEND="
77 + berkdb? ( sys-libs/db:= )
78 + gdbm? ( sys-libs/gdbm:= )
79 + jemalloc? ( dev-libs/jemalloc )
80 + ssl? (
81 + !libressl? ( <dev-libs/openssl-1.1:0= )
82 + libressl? ( dev-libs/libressl )
83 + )
84 + socks5? ( >=net-proxy/dante-1.1.13 )
85 + tk? (
86 + dev-lang/tcl:0=[threads]
87 + dev-lang/tk:0=[threads]
88 + )
89 + ncurses? ( sys-libs/ncurses:0= )
90 + readline? ( sys-libs/readline:0= )
91 + dev-libs/libyaml
92 + virtual/libffi:=
93 + sys-libs/zlib
94 + >=app-eselect/eselect-ruby-20151229
95 + !<dev-ruby/rdoc-3.9.4
96 + !<dev-ruby/rubygems-1.8.10-r1"
97 +
98 +DEPEND="${RDEPEND}"
99 +
100 +BUNDLED_GEMS="
101 + >=dev-ruby/did_you_mean-1.0.0:1[ruby_targets_ruby23]
102 + >=dev-ruby/minitest-5.8.3[ruby_targets_ruby23]
103 + >=dev-ruby/net-telnet-0.1.1[ruby_targets_ruby23]
104 + >=dev-ruby/power_assert-0.2.6[ruby_targets_ruby23]
105 + >=dev-ruby/rake-10.4.2[ruby_targets_ruby23]
106 + >=dev-ruby/test-unit-3.1.5[ruby_targets_ruby23]
107 +"
108 +
109 +PDEPEND="
110 + ${BUNDLED_GEMS}
111 + virtual/rubygems[ruby_targets_ruby23]
112 + >=dev-ruby/json-1.8.3[ruby_targets_ruby23]
113 + rdoc? ( >=dev-ruby/rdoc-4.2.1[ruby_targets_ruby23] )
114 + xemacs? ( app-xemacs/ruby-modes )"
115 +
116 +src_prepare() {
117 + EPATCH_FORCE="yes" EPATCH_SUFFIX="patch" \
118 + epatch "${WORKDIR}/patches"
119 +
120 + einfo "Unbundling gems..."
121 + cd "$S"
122 + # Remove bundled gems that we will install via PDEPEND, bug
123 + # 539700. Use explicit version numbers to ensure rm fails when they
124 + # change so we can update dependencies accordingly.
125 + rm -f gems/{did_you_mean-1.0.0,minitest-5.8.3,net-telnet-0.1.1,power_assert-0.2.6,rake-10.4.2,test-unit-3.1.5}.gem || die
126 +
127 + # Fix a hardcoded lib path in configure script
128 + sed -i -e "s:\(RUBY_LIB_PREFIX=\"\${prefix}/\)lib:\1$(get_libdir):" \
129 + configure.in || die "sed failed"
130 +
131 + eautoreconf
132 +}
133 +
134 +src_configure() {
135 + local modules= myconf=
136 +
137 + # -fomit-frame-pointer makes ruby segfault, see bug #150413.
138 + filter-flags -fomit-frame-pointer
139 + # In many places aliasing rules are broken; play it safe
140 + # as it's risky with newer compilers to leave it as it is.
141 + append-flags -fno-strict-aliasing
142 + # SuperH needs this
143 + use sh && append-flags -mieee
144 +
145 + # Socks support via dante
146 + if use socks5 ; then
147 + # Socks support can't be disabled as long as SOCKS_SERVER is
148 + # set and socks library is present, so need to unset
149 + # SOCKS_SERVER in that case.
150 + unset SOCKS_SERVER
151 + fi
152 +
153 + # Increase GC_MALLOC_LIMIT if set (default is 8000000)
154 + if [ -n "${RUBY_GC_MALLOC_LIMIT}" ] ; then
155 + append-flags "-DGC_MALLOC_LIMIT=${RUBY_GC_MALLOC_LIMIT}"
156 + fi
157 +
158 + # ipv6 hack, bug 168939. Needs --enable-ipv6.
159 + use ipv6 || myconf="${myconf} --with-lookup-order-hack=INET"
160 +
161 + # Determine which modules *not* to build depending in the USE flags.
162 + if ! use readline ; then
163 + modules="${modules},readline"
164 + fi
165 + if ! use berkdb ; then
166 + modules="${modules},dbm"
167 + fi
168 + if ! use gdbm ; then
169 + modules="${modules},gdbm"
170 + fi
171 + if ! use ssl ; then
172 + modules="${modules},openssl"
173 + fi
174 + if ! use ncurses ; then
175 + modules="${modules},curses"
176 + fi
177 + if ! use tk ; then
178 + modules="${modules},tk"
179 + fi
180 +
181 + # Provide an empty LIBPATHENV because we disable rpath but we do not
182 + # need LD_LIBRARY_PATH by default since that breaks USE=multitarget
183 + # #564272
184 + INSTALL="${EPREFIX}/usr/bin/install -c" LIBPATHENV="" econf \
185 + --program-suffix=${MY_SUFFIX} \
186 + --with-soname=ruby${MY_SUFFIX} \
187 + --docdir=${EPREFIX}/usr/share/doc/${P} \
188 + --enable-shared \
189 + --enable-pthread \
190 + --disable-rpath \
191 + --with-out-ext="${modules}" \
192 + $(use_with jemalloc jemalloc) \
193 + $(use_enable socks5 socks) \
194 + $(use_enable doc install-doc) \
195 + --enable-ipv6 \
196 + $(use_enable debug) \
197 + ${myconf} \
198 + --enable-option-checking=no \
199 + || die "econf failed"
200 +}
201 +
202 +src_compile() {
203 + emake V=1 EXTLDFLAGS="${LDFLAGS}" || die "emake failed"
204 +}
205 +
206 +src_test() {
207 + emake -j1 V=1 test || die "make test failed"
208 +
209 + elog "Ruby's make test has been run. Ruby also ships with a make check"
210 + elog "that cannot be run until after ruby has been installed."
211 + elog
212 + if use rubytests; then
213 + elog "You have enabled rubytests, so they will be installed to"
214 + elog "/usr/share/${PN}-${SLOT}/test. To run them you must be a user other"
215 + elog "than root, and you must place them into a writeable directory."
216 + elog "Then call: "
217 + elog
218 + elog "ruby${MY_SUFFIX} -C /location/of/tests runner.rb"
219 + else
220 + elog "Enable the rubytests USE flag to install the make check tests"
221 + fi
222 +}
223 +
224 +src_install() {
225 + # Remove the remaining bundled gems. We do this late in the process
226 + # since they are used during the build to e.g. create the
227 + # documentation.
228 + rm -rf ext/json || die
229 +
230 + # Ruby is involved in the install process, we don't want interference here.
231 + unset RUBYOPT
232 +
233 + local MINIRUBY=$(echo -e 'include Makefile\ngetminiruby:\n\t@echo $(MINIRUBY)'|make -f - getminiruby)
234 +
235 + LD_LIBRARY_PATH="${S}:${D}/usr/$(get_libdir)${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}"
236 + RUBYLIB="${S}:${D}/usr/$(get_libdir)/ruby/${RUBYVERSION}"
237 + for d in $(find "${S}/ext" -type d) ; do
238 + RUBYLIB="${RUBYLIB}:$d"
239 + done
240 + export LD_LIBRARY_PATH RUBYLIB
241 +
242 + emake V=1 DESTDIR="${D}" install || die "make install failed"
243 +
244 + # Remove installed rubygems and rdoc copy
245 + rm -rf "${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}/rubygems" || die "rm rubygems failed"
246 + rm -rf "${ED}/usr/bin/"gem"${MY_SUFFIX}" || die "rm rdoc bins failed"
247 + rm -rf "${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}"/rdoc* || die "rm rdoc failed"
248 + rm -rf "${ED}/usr/bin/"{ri,rdoc}"${MY_SUFFIX}" || die "rm rdoc bins failed"
249 +
250 + if use doc; then
251 + make DESTDIR="${D}" install-doc || die "make install-doc failed"
252 + fi
253 +
254 + if use examples; then
255 + insinto /usr/share/doc/${PF}
256 + doins -r sample
257 + fi
258 +
259 + dodoc ChangeLog NEWS doc/NEWS* README* || die
260 +
261 + if use rubytests; then
262 + pushd test
263 + insinto /usr/share/${PN}-${SLOT}/test
264 + doins -r .
265 + popd
266 + fi
267 +}
268 +
269 +pkg_postinst() {
270 + if [[ ! -n $(readlink "${ROOT}"usr/bin/ruby) ]] ; then
271 + eselect ruby set ruby${MY_SUFFIX}
272 + fi
273 +
274 + elog
275 + elog "To switch between available Ruby profiles, execute as root:"
276 + elog "\teselect ruby set ruby(22|23|...)"
277 + elog
278 +}
279 +
280 +pkg_postrm() {
281 + eselect ruby cleanup
282 +}