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