1 |
commit: b253da1bd70f4bea8dc145164088a24cbb1567f2 |
2 |
Author: Hans de Graaff <graaff <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Oct 3 05:20:24 2020 +0000 |
4 |
Commit: Hans de Graaff <graaff <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Oct 3 05:20:24 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b253da1b |
7 |
|
8 |
dev-lang/ruby: add 2.7.2 |
9 |
|
10 |
Package-Manager: Portage-3.0.4, Repoman-3.0.1 |
11 |
Signed-off-by: Hans de Graaff <graaff <AT> gentoo.org> |
12 |
|
13 |
dev-lang/ruby/Manifest | 1 + |
14 |
dev-lang/ruby/ruby-2.7.2.ebuild | 237 ++++++++++++++++++++++++++++++++++++++++ |
15 |
2 files changed, 238 insertions(+) |
16 |
|
17 |
diff --git a/dev-lang/ruby/Manifest b/dev-lang/ruby/Manifest |
18 |
index f2fa1f24258..89d19b617cb 100644 |
19 |
--- a/dev-lang/ruby/Manifest |
20 |
+++ b/dev-lang/ruby/Manifest |
21 |
@@ -1,3 +1,4 @@ |
22 |
DIST ruby-2.5.8.tar.xz 11298404 BLAKE2B 3256c0448e72b63c0bd89f89a27fa9c09c8feed54d42cd79899b7d5cfe9dbc29ca708d12c630b3f52ff85b0c6a4011ae7ff0483d64b2fd445700a72a91028035 SHA512 2886be764a454425c5beef2777c64a70ee0d048b07896b327633d904f5077fea4299526689f9e2ac4dcd2fc4811cf9a6c8ce75367ed35d29dfe1a54222872e0d |
23 |
DIST ruby-2.6.6.tar.xz 11567284 BLAKE2B 45e910dd9b128c46bff3003834c4fdcbbc2e2e4d3e44f298ff4356a285de2c375d6b6021a3aa28d89336b32a1655fa4a7c086d07f4a0f6bcd578a11dd4a894da SHA512 86caf93dbf61d03781767ab5375a7edf4761f13ba08ccfefe16c0a7550499237e7390c2f72a95d42670d4fe76b2401b4218936187c62ec1572799e9e04c50d62 |
24 |
DIST ruby-2.7.1.tar.xz 12003684 BLAKE2B 90a35c3e246cfe982a146be29a3d121d6e2c251ed96703dbc46b98c21e0e43e5445132e6119e584ae35f7193f063ff1b14822f947a4e07037c37fbba5e4038da SHA512 79f98b1ea98e0b10ec79da1883e8fc84d48ffe5c09ae945cbebde94365e35a589d919aac965f74d70ca7e21370ecee631ac5a8f9c4eac61d62f5aa629f27bf31 |
25 |
+DIST ruby-2.7.2.tar.xz 12037052 BLAKE2B a4ad22295b3fed4e8064fc6e77adb8642d1fa7ae1f4ef912d7bde19c735cb25b1a3e3aefba53dad944046d844d608bcefba61c314cf1e52747f50d7d91f4c436 SHA512 7972278b096aa768c7adf2befd26003e18781a29ca317640317d30d93d6e963ded197724c8e2f1dfe1e838c5647176d414a74732a62e931fb50d6f2e0f777349 |
26 |
|
27 |
diff --git a/dev-lang/ruby/ruby-2.7.2.ebuild b/dev-lang/ruby/ruby-2.7.2.ebuild |
28 |
new file mode 100644 |
29 |
index 00000000000..e4e8048e083 |
30 |
--- /dev/null |
31 |
+++ b/dev-lang/ruby/ruby-2.7.2.ebuild |
32 |
@@ -0,0 +1,237 @@ |
33 |
+# Copyright 1999-2020 Gentoo Authors |
34 |
+# Distributed under the terms of the GNU General Public License v2 |
35 |
+ |
36 |
+EAPI=7 |
37 |
+ |
38 |
+inherit autotools flag-o-matic multilib |
39 |
+ |
40 |
+MY_P="${PN}-$(ver_cut 1-3)" |
41 |
+S=${WORKDIR}/${MY_P} |
42 |
+ |
43 |
+SLOT=$(ver_cut 1-2) |
44 |
+MY_SUFFIX=$(ver_rs 1 '' ${SLOT}) |
45 |
+RUBYVERSION=${SLOT}.0 |
46 |
+ |
47 |
+DESCRIPTION="An object-oriented scripting language" |
48 |
+HOMEPAGE="https://www.ruby-lang.org/" |
49 |
+SRC_URI="https://cache.ruby-lang.org/pub/ruby/${SLOT}/${MY_P}.tar.xz" |
50 |
+ |
51 |
+LICENSE="|| ( Ruby-BSD BSD-2 )" |
52 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86" |
53 |
+IUSE="berkdb debug doc examples gdbm ipv6 jemalloc jit libressl +rdoc rubytests socks5 +ssl static-libs systemtap tk xemacs" |
54 |
+ |
55 |
+RDEPEND=" |
56 |
+ berkdb? ( sys-libs/db:= ) |
57 |
+ gdbm? ( sys-libs/gdbm:= ) |
58 |
+ jemalloc? ( dev-libs/jemalloc ) |
59 |
+ jit? ( || ( sys-devel/gcc:* sys-devel/clang:* ) ) |
60 |
+ ssl? ( |
61 |
+ !libressl? ( dev-libs/openssl:0= ) |
62 |
+ libressl? ( dev-libs/libressl ) |
63 |
+ ) |
64 |
+ socks5? ( >=net-proxy/dante-1.1.13 ) |
65 |
+ systemtap? ( dev-util/systemtap ) |
66 |
+ tk? ( |
67 |
+ dev-lang/tcl:0=[threads] |
68 |
+ dev-lang/tk:0=[threads] |
69 |
+ ) |
70 |
+ dev-libs/libyaml |
71 |
+ dev-libs/libffi:= |
72 |
+ sys-libs/readline:0= |
73 |
+ sys-libs/zlib |
74 |
+ >=app-eselect/eselect-ruby-20191222 |
75 |
+" |
76 |
+ |
77 |
+DEPEND="${RDEPEND}" |
78 |
+ |
79 |
+BUNDLED_GEMS=" |
80 |
+ >=dev-ruby/minitest-5.13.0[ruby_targets_ruby27] |
81 |
+ >=dev-ruby/net-telnet-0.2.0[ruby_targets_ruby27] |
82 |
+ >=dev-ruby/power_assert-1.1.7[ruby_targets_ruby27] |
83 |
+ >=dev-ruby/rake-13.0.1[ruby_targets_ruby27] |
84 |
+ >=dev-ruby/test-unit-3.3.4[ruby_targets_ruby27] |
85 |
+ >=dev-ruby/xmlrpc-0.3.0[ruby_targets_ruby27] |
86 |
+" |
87 |
+ |
88 |
+PDEPEND=" |
89 |
+ ${BUNDLED_GEMS} |
90 |
+ virtual/rubygems[ruby_targets_ruby27] |
91 |
+ >=dev-ruby/bundler-2.1.4[ruby_targets_ruby27] |
92 |
+ >=dev-ruby/did_you_mean-1.3.1[ruby_targets_ruby27] |
93 |
+ >=dev-ruby/json-2.0.2[ruby_targets_ruby27] |
94 |
+ rdoc? ( >=dev-ruby/rdoc-6.1.2[ruby_targets_ruby27] ) |
95 |
+ xemacs? ( app-xemacs/ruby-modes )" |
96 |
+ |
97 |
+src_prepare() { |
98 |
+ # 005 does not compile bigdecimal and is questionable because it |
99 |
+ # compiles ruby in a non-standard way, may be dropped |
100 |
+ eapply "${FILESDIR}"/2.7/010*.patch |
101 |
+ |
102 |
+ einfo "Unbundling gems..." |
103 |
+ cd "$S" |
104 |
+ # Remove bundled gems that we will install via PDEPEND, bug |
105 |
+ # 539700. |
106 |
+ rm -fr gems/* || die |
107 |
+ # Don't install CLI tools since they will clash with the gem |
108 |
+ rm -f bin/{racc,racc2y,y2racc} || die |
109 |
+ sed -i -e '/executables/ s:^:#:' lib/racc/racc.gemspec || die |
110 |
+ |
111 |
+ einfo "Removing bundled libraries..." |
112 |
+ rm -fr ext/fiddle/libffi-3.2.1 || die |
113 |
+ |
114 |
+ eapply_user |
115 |
+ |
116 |
+ eautoreconf |
117 |
+} |
118 |
+ |
119 |
+src_configure() { |
120 |
+ local modules= myconf= |
121 |
+ |
122 |
+ # -fomit-frame-pointer makes ruby segfault, see bug #150413. |
123 |
+ filter-flags -fomit-frame-pointer |
124 |
+ # In many places aliasing rules are broken; play it safe |
125 |
+ # as it's risky with newer compilers to leave it as it is. |
126 |
+ append-flags -fno-strict-aliasing |
127 |
+ |
128 |
+ # Socks support via dante |
129 |
+ if use socks5 ; then |
130 |
+ # Socks support can't be disabled as long as SOCKS_SERVER is |
131 |
+ # set and socks library is present, so need to unset |
132 |
+ # SOCKS_SERVER in that case. |
133 |
+ unset SOCKS_SERVER |
134 |
+ fi |
135 |
+ |
136 |
+ # Increase GC_MALLOC_LIMIT if set (default is 8000000) |
137 |
+ if [ -n "${RUBY_GC_MALLOC_LIMIT}" ] ; then |
138 |
+ append-flags "-DGC_MALLOC_LIMIT=${RUBY_GC_MALLOC_LIMIT}" |
139 |
+ fi |
140 |
+ |
141 |
+ # ipv6 hack, bug 168939. Needs --enable-ipv6. |
142 |
+ use ipv6 || myconf="${myconf} --with-lookup-order-hack=INET" |
143 |
+ |
144 |
+ # Determine which modules *not* to build depending in the USE flags. |
145 |
+ if ! use berkdb ; then |
146 |
+ modules="${modules},dbm" |
147 |
+ fi |
148 |
+ if ! use gdbm ; then |
149 |
+ modules="${modules},gdbm" |
150 |
+ fi |
151 |
+ if ! use ssl ; then |
152 |
+ modules="${modules},openssl" |
153 |
+ fi |
154 |
+ if ! use tk ; then |
155 |
+ modules="${modules},tk" |
156 |
+ fi |
157 |
+ |
158 |
+ # Provide an empty LIBPATHENV because we disable rpath but we do not |
159 |
+ # need LD_LIBRARY_PATH by default since that breaks USE=multitarget |
160 |
+ # #564272 |
161 |
+ INSTALL="${EPREFIX}/usr/bin/install -c" LIBPATHENV="" econf \ |
162 |
+ --program-suffix=${MY_SUFFIX} \ |
163 |
+ --with-soname=ruby${MY_SUFFIX} \ |
164 |
+ --enable-shared \ |
165 |
+ --enable-pthread \ |
166 |
+ --disable-rpath \ |
167 |
+ --with-out-ext="${modules}" \ |
168 |
+ $(use_with jemalloc jemalloc) \ |
169 |
+ $(use_enable jit jit-support ) \ |
170 |
+ $(use_enable socks5 socks) \ |
171 |
+ $(use_enable systemtap dtrace) \ |
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 |
+ |
181 |
+ # Makefile is broken because it lacks -ldl |
182 |
+ rm -rf ext/-test-/popen_deadlock || die |
183 |
+} |
184 |
+ |
185 |
+src_compile() { |
186 |
+ emake V=1 EXTLDFLAGS="${LDFLAGS}" MJIT_CFLAGS="${CFLAGS}" MJIT_OPTFLAGS="" MJIT_DEBUGFLAGS="" |
187 |
+} |
188 |
+ |
189 |
+src_test() { |
190 |
+ emake -j1 V=1 test |
191 |
+ |
192 |
+ elog "Ruby's make test has been run. Ruby also ships with a make check" |
193 |
+ elog "that cannot be run until after ruby has been installed." |
194 |
+ elog |
195 |
+ if use rubytests; then |
196 |
+ elog "You have enabled rubytests, so they will be installed to" |
197 |
+ elog "/usr/share/${PN}-${SLOT}/test. To run them you must be a user other" |
198 |
+ elog "than root, and you must place them into a writeable directory." |
199 |
+ elog "Then call: " |
200 |
+ elog |
201 |
+ elog "ruby${MY_SUFFIX} -C /location/of/tests runner.rb" |
202 |
+ else |
203 |
+ elog "Enable the rubytests USE flag to install the make check tests" |
204 |
+ fi |
205 |
+} |
206 |
+ |
207 |
+src_install() { |
208 |
+ # Remove the remaining bundled gems. We do this late in the process |
209 |
+ # since they are used during the build to e.g. create the |
210 |
+ # documentation. |
211 |
+ rm -rf ext/json || die |
212 |
+ rm -rf lib/bundler* lib/rdoc/rdoc.gemspec || die |
213 |
+ |
214 |
+ # Ruby is involved in the install process, we don't want interference here. |
215 |
+ unset RUBYOPT |
216 |
+ |
217 |
+ local MINIRUBY=$(echo -e 'include Makefile\ngetminiruby:\n\t@echo $(MINIRUBY)'|make -f - getminiruby) |
218 |
+ |
219 |
+ LD_LIBRARY_PATH="${S}:${ED}/usr/$(get_libdir)${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}" |
220 |
+ RUBYLIB="${S}:${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}" |
221 |
+ for d in $(find "${S}/ext" -type d) ; do |
222 |
+ RUBYLIB="${RUBYLIB}:$d" |
223 |
+ done |
224 |
+ export LD_LIBRARY_PATH RUBYLIB |
225 |
+ |
226 |
+ # Create directory for the default gems |
227 |
+ local gem_home="${EPREFIX}/usr/$(get_libdir)/ruby/gems/${RUBYVERSION}" |
228 |
+ mkdir -p "${D}/${gem_home}" || die "mkdir gem home failed" |
229 |
+ |
230 |
+ emake V=1 DESTDIR="${D}" GEM_DESTDIR=${gem_home} install |
231 |
+ |
232 |
+ # Remove installed rubygems and rdoc copy |
233 |
+ rm -rf "${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}/rubygems" || die "rm rubygems failed" |
234 |
+ rm -rf "${ED}/usr/bin/"gem"${MY_SUFFIX}" || die "rm rdoc bins failed" |
235 |
+ rm -rf "${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}"/rdoc* || die "rm rdoc failed" |
236 |
+ rm -rf "${ED}/usr/bin/"{bundle,bundler,ri,rdoc}"${MY_SUFFIX}" || die "rm rdoc bins failed" |
237 |
+ |
238 |
+ if use doc; then |
239 |
+ emake DESTDIR="${D}" GEM_DESTDIR=${gem_home} install-doc |
240 |
+ fi |
241 |
+ |
242 |
+ if use examples; then |
243 |
+ dodoc -r sample |
244 |
+ fi |
245 |
+ |
246 |
+ dodoc ChangeLog NEWS doc/NEWS* README* |
247 |
+ |
248 |
+ if use rubytests; then |
249 |
+ pushd test |
250 |
+ insinto /usr/share/${PN}-${SLOT}/test |
251 |
+ doins -r . |
252 |
+ popd |
253 |
+ fi |
254 |
+} |
255 |
+ |
256 |
+pkg_postinst() { |
257 |
+ if [[ ! -n $(readlink "${EROOT}"/usr/bin/ruby) ]] ; then |
258 |
+ eselect ruby set ruby${MY_SUFFIX} |
259 |
+ fi |
260 |
+ |
261 |
+ elog |
262 |
+ elog "To switch between available Ruby profiles, execute as root:" |
263 |
+ elog "\teselect ruby set ruby(23|24|...)" |
264 |
+ elog |
265 |
+} |
266 |
+ |
267 |
+pkg_postrm() { |
268 |
+ eselect ruby cleanup |
269 |
+} |