Merge pull request #3703 from nxhack/icu-update-to-v58_2
[feed/packages.git] / lang / ruby / Makefile
1 #
2 # Copyright (C) 2006-2016 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # To Do:
8 # - dirs not removed when uninstalling!
9 #
10 include $(TOPDIR)/rules.mk
11
12 PKG_NAME:=ruby
13 PKG_VERSION:=2.4.0
14 PKG_RELEASE:=1
15
16 PKG_LIBVER:=2.4
17
18 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
19 PKG_SOURCE_URL:=http://cache.ruby-lang.org/pub/ruby/$(PKG_LIBVER)/
20 PKG_MD5SUM:=440bbbdc49d08d3650f340dccb35986d9399177ad69a204def56e5d3954600cf
21 PKG_MAINTAINER:=Luiz Angelo Daros de Luca <luizluca@gmail.com>
22 PKG_LICENSE:=BSD-2-Clause
23 PKG_LICENSE_FILES:=COPYING
24
25 PKG_BUILD_DEPENDS:=ruby/host
26 PKG_INSTALL:=1
27 PKG_BUILD_PARALLEL:=1
28 PKG_FIXUP:=autoreconf
29
30 include $(INCLUDE_DIR)/host-build.mk
31 include $(INCLUDE_DIR)/package.mk
32 include $(INCLUDE_DIR)/nls.mk
33
34 HOST_CONFIGURE_ARGS += \
35 --disable-install-doc \
36 --disable-install-rdoc \
37 --disable-install-capi \
38 --without-gmp \
39 --with-out-ext=-test-/array/resize,-test-/bignum,-test-/bug-3571,-test-/bug-5832,-test-/bug_reporter,-test-/class,-test-/debug,-test-/dln/empty,-test-/exception,-test-/fatal,-test-/file,-test-/float,-test-/funcall,-test-/gvl/call_without_gvl,-test-/hash,-test-/integer,-test-/iseq_load,-test-/iter,-test-/load/dot.dot,-test-/marshal/compat,-test-/marshal/internal_ivar,-test-/marshal/usr,-test-/memory_status,-test-/method,-test-/notimplement,-test-/num2int,-test-/path_to_class,-test-/popen_deadlock,-test-/postponed_job,-test-/printf,-test-/proc,-test-/rational,-test-/recursion,-test-/st/foreach,-test-/st/numhash,-test-/st/update,-test-/string,-test-/struct,-test-/symbol,-test-/time,-test-/tracepoint,-test-/typeddata,-test-/vm,-test-/wait_for_single_fd,-test-/win32/console,-test-/win32/dln,-test-/win32/fd_setsize,bigdecimal,cgi/escape,continuation,coverage,dbm,etc,fcntl,fiber,fiddle,gdbm,io/console,io/nonblock,io/wait,json,json/generator,json/parser,mathn/complex,mathn/rational,nkf,objspace,openssl,pathname,pty,racc/cparse,rbconfig/sizeof,readline,ripper,rubyvm,sdbm,socket,syslog,win32,win32ole,win32/resolv,zlib
40
41 # Does not compile with this. Workaround is --without-gmp
42 # https://bugs.ruby-lang.org/issues/11940
43 #--with-static-linked-ext \
44
45 # even not used, host build with restricted exts results in gems not being
46 # compiled for target (probably some cross compiling problem like checking
47 # host for selecting target features)
48 # --with-out-ext \
49 # --with-ext=thread,stringio \
50
51 CONFIGURE_ARGS += \
52 --enable-shared \
53 --enable-static \
54 --disable-rpath \
55 $(call autoconf_bool,CONFIG_IPV6,ipv6) \
56 --disable-install-doc \
57 --disable-install-capi \
58 --with-ruby-version=minor \
59 --with-iconv-dir=$(ICONV_PREFIX) \
60 --with-out-ext=win32,win32ole
61
62 ifndef CONFIG_RUBY_DIGEST_USE_OPENSSL
63 CONFIGURE_ARGS += \
64 --with-bundled-sha1\
65 --with-bundled-md5\
66 --with-bundled-rmd160\
67 --with-bundled-sha2 \
68
69 endif
70
71 TARGET_LDFLAGS += -L$(PKG_BUILD_DIR)
72
73 # Ruby uses DLDFLAGS and not LDFLAGS for libraries. LDFLAGS is only for execs.
74 # However, DLDFLAGS from configure is not passed to Makefile when target is linux.
75 # XLDFLAGS is used by both libraries and execs. This is somehow brute force but
76 # it will fix when some LD_FLAGS is needef for libraries. As side effect, it will
77 # duplicate ld args for binaries.
78 CONFIGURE_VARS += XLDFLAGS="$(TARGET_LDFLAGS)"
79
80 MAKE_FLAGS += \
81 DESTDIR="$(PKG_INSTALL_DIR)" \
82 SHELL="/bin/bash"
83
84 define Build/InstallDev
85 ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
86 . \
87 ) | ( cd $(1); $(TAR) -xf - )
88 endef
89
90 define Host/Install
91 # When ruby version is updated, make install asks in some cases before replace
92 # an existing different file. Remove them before install and avoid the interaction
93 rm -f $(HOST_BUILD_PREFIX)/bin/rake
94 $(call Host/Install/Default)
95 endef
96
97 define Package/ruby/Default
98 SUBMENU:=Ruby
99 SECTION:=lang
100 CATEGORY:=Languages
101 TITLE:=Ruby scripting language
102 URL:=http://www.ruby-lang.org/
103 endef
104
105 define Package/ruby/Default/description
106 Ruby is the interpreted scripting language for quick and easy
107 object-oriented programming. It has many features to process text files
108 and to do system management tasks (as in perl). It is simple,
109 straight-forward, and extensible.
110
111 endef
112
113 define Package/ruby
114 $(call Package/ruby/Default)
115 TITLE+= (interpreter)
116 DEPENDS:=+libruby
117 endef
118
119 define Package/ruby/description
120 $(call Package/ruby/Default/description)
121 endef
122
123 define RubyDependency
124 $(eval \
125 $(call Package/Default)
126 $(call Package/ruby-$(1))
127 FILTER_CONFIG:=$$(strip \
128 $$(foreach config_dep, \
129 $$(filter @%, \
130 $$(foreach v, \
131 $$(DEPENDS), \
132 $$(if $$(findstring :,$$v),,$$v) \
133 ) \
134 ), \
135 $$(subst @,,$$(config_dep)) \
136 ) \
137 )
138 ifneq (,$$(FILTER_CONFIG))
139 FILTER_CONFIG:=($$(subst $$(space),&&,$$(FILTER_CONFIG))):
140 endif
141 ) \
142 +$(FILTER_CONFIG)ruby-$(1)
143 endef
144
145 define Package/ruby/config
146 comment "Standard Library"
147 depends on PACKAGE_ruby
148
149 config PACKAGE_ruby-stdlib
150 depends on PACKAGE_ruby
151 default m if ALL
152 prompt "Select Ruby Complete Standard Library (ruby-stdlib)"
153
154 endef
155
156 define Package/ruby/install
157 $(INSTALL_DIR) $(1)/usr/bin
158 $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
159 $(INSTALL_DIR) $(1)/usr/lib/ruby/vendor_ruby/$(PKG_LIBVER)
160 $(INSTALL_DIR) $(1)/usr/lib/ruby/site_ruby/$(PKG_LIBVER)
161 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ruby $(1)/usr/lib/ruby/ruby$(PKG_LIBVER)-bin
162 $(INSTALL_BIN) ./files/ruby $(1)/usr/bin/ruby
163 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/vendor_ruby/$(PKG_LIBVER)/* $(1)/usr/lib/ruby/vendor_ruby/$(PKG_LIBVER)/
164 $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/site_ruby/$(PKG_LIBVER)/* $(1)/usr/lib/ruby/site_ruby/$(PKG_LIBVER)/
165 $(SED) "s%@RUBY_LIBPATH@%/usr/lib/ruby/$(PKG_LIBVER)%" $(1)/usr/bin/ruby
166 $(SED) "s%@RUBY_BINPATH@%/usr/lib/ruby/ruby$(PKG_LIBVER)-bin%" $(1)/usr/bin/ruby
167 endef
168
169 define Package/libruby
170 $(call Package/ruby/Default)
171 SUBMENU:=
172 SECTION:=libs
173 CATEGORY:=Libraries
174 TITLE+= (shared library)
175 DEPENDS+= +libpthread +librt +libgmp
176 ABI_VERSION:=$(PKG_LIBVER)
177 endef
178 define Package/libruby/install
179 $(INSTALL_DIR) $(1)/usr/lib
180 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libruby.so.* $(1)/usr/lib/
181 endef
182
183 RUBY_STDLIB :=
184 define Package/ruby-stdlib
185 $(call Package/ruby/Default)
186 TITLE:=Ruby standard libraries (metadata for all stdlib subsets)
187 DEPENDS:=ruby $(foreach subpackage,$(RUBY_STDLIB),$(strip $(call RubyDependency,$(subpackage))))
188 HIDDEN:=1
189 endef
190
191 define Package/ruby-stdlib/description
192 This metapackage currently install all ruby-* packages,
193 providing a complete Ruby Standard Library.
194
195 endef
196
197 # nothing to do
198 define Package/ruby-stdlib/install
199 /bin/true
200 endef
201
202 define Package/ruby-bigdecimal/files
203 /usr/lib/ruby/$(PKG_LIBVER)/*/bigdecimal.so
204 /usr/lib/ruby/$(PKG_LIBVER)/bigdecimal/
205 /usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/default/bigdecimal-*.gemspec
206 endef
207
208 define Package/ruby-cgi/files
209 /usr/lib/ruby/$(PKG_LIBVER)/cgi
210 /usr/lib/ruby/$(PKG_LIBVER)/cgi.rb
211 /usr/lib/ruby/$(PKG_LIBVER)/*/cgi/escape.so
212 endef
213
214 define Package/ruby-csv/files
215 /usr/lib/ruby/$(PKG_LIBVER)/csv.rb
216 endef
217
218 define Package/ruby-datetime/files
219 /usr/lib/ruby/$(PKG_LIBVER)/time.rb
220 /usr/lib/ruby/$(PKG_LIBVER)/date.rb
221 /usr/lib/ruby/$(PKG_LIBVER)/*/date_core.so
222 endef
223
224 define Package/ruby-dbm/description
225 The DBM class provides a wrapper to a Unix-style dbm or Database Manager library.
226 This package provides dbm.so file.
227
228 endef
229 define Package/ruby-dbm/files
230 /usr/lib/ruby/$(PKG_LIBVER)/*/dbm.so
231 endef
232
233 define Package/ruby-debuglib/files
234 /usr/lib/ruby/$(PKG_LIBVER)/profile.rb
235 /usr/lib/ruby/$(PKG_LIBVER)/profiler.rb
236 /usr/lib/ruby/$(PKG_LIBVER)/debug.rb
237 /usr/lib/ruby/$(PKG_LIBVER)/tracer.rb
238 /usr/lib/ruby/$(PKG_LIBVER)/benchmark.rb
239 /usr/lib/ruby/$(PKG_LIBVER)/*/objspace.so
240 endef
241
242 define Package/ruby-did-you-mean/files
243 /usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/did_you_mean-*.gemspec
244 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/did_you_mean-*/
245 endef
246 define Package/ruby-did-you-mean/files-excluded
247 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/did_you_mean-*/benchmark
248 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/did_you_mean-*/doc
249 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/did_you_mean-*/evaluation
250 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/did_you_mean-*/test
251 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/did_you_mean-*/*.md
252 endef
253
254 define Package/ruby-digest/description
255 Provides digest* files. Can be configured to use OpenSSL or
256 bundled hash functions.
257
258 endef
259 define Package/ruby-digest/config
260
261 config RUBY_DIGEST_USE_OPENSSL
262 bool "Use OpenSSL functions for ruby digest hash functions"
263 depends on PACKAGE_ruby-digest
264 help
265 Ruby can use OpenSSL hash functions or compile alternative implementations. Using
266 OpenSSL saves about 30KBytes (less when compressed) but requires OpenSSL (that
267 is way bigger than that). However, if OpenSSL is already needed by another usage,
268 as ruby-openssl or any other non ruby package, it is better to mark this option.
269 default n
270
271 endef
272 define Package/ruby-digest/files
273 /usr/lib/ruby/$(PKG_LIBVER)/digest
274 /usr/lib/ruby/$(PKG_LIBVER)/digest.rb
275 /usr/lib/ruby/$(PKG_LIBVER)/*/digest.so
276 /usr/lib/ruby/$(PKG_LIBVER)/*/digest/*
277 endef
278
279 define Package/ruby-drb/files
280 /usr/lib/ruby/$(PKG_LIBVER)/drb.rb
281 /usr/lib/ruby/$(PKG_LIBVER)/drb
282 endef
283
284 define Package/ruby-enc/files
285 /usr/lib/ruby/$(PKG_LIBVER)/*/enc/encdb.so
286 /usr/lib/ruby/$(PKG_LIBVER)/*/enc/iso_8859_1.so
287 /usr/lib/ruby/$(PKG_LIBVER)/*/enc/utf_*.so
288 /usr/lib/ruby/$(PKG_LIBVER)/*/enc/euc_jp.so
289 endef
290
291 define Package/ruby-enc-extra/files
292 /usr/lib/ruby/$(PKG_LIBVER)/*/enc
293 endef
294 define Package/ruby-enc-extra/files-excluded
295 $(call Package/ruby-enc/files)
296 endef
297
298 define Package/ruby-erb/files
299 /usr/bin/erb
300 /usr/lib/ruby/$(PKG_LIBVER)/erb.rb
301 endef
302
303 define Package/ruby-fiddle/files
304 /usr/lib/ruby/$(PKG_LIBVER)/fiddle.rb
305 /usr/lib/ruby/$(PKG_LIBVER)/fiddle/
306 /usr/lib/ruby/$(PKG_LIBVER)/*/fiddle.so
307 endef
308
309 define Package/ruby-filelib/files
310 /usr/lib/ruby/$(PKG_LIBVER)/tmpdir.rb
311 /usr/lib/ruby/$(PKG_LIBVER)/tempfile.rb
312 /usr/lib/ruby/$(PKG_LIBVER)/pathname.rb
313 /usr/lib/ruby/$(PKG_LIBVER)/*/pathname.so
314 /usr/lib/ruby/$(PKG_LIBVER)/find.rb
315 /usr/lib/ruby/$(PKG_LIBVER)/fileutils.rb
316 endef
317
318 define Package/ruby-gdbm/files
319 /usr/lib/ruby/$(PKG_LIBVER)/*/gdbm.so
320 endef
321
322 define Package/ruby-gems/files
323 /usr/lib/ruby/$(PKG_LIBVER)/ubygems.rb
324 /usr/lib/ruby/$(PKG_LIBVER)/rubygems.rb
325 /usr/lib/ruby/$(PKG_LIBVER)/rubygems
326 endef
327 define Package/ruby-gems/files-excluded
328 /usr/lib/ruby/$(PKG_LIBVER)/rubygems/test_case.rb
329 /usr/lib/ruby/$(PKG_LIBVER)/rubygems/package/tar_test_case.rb
330 /usr/lib/ruby/$(PKG_LIBVER)/rubygems/installer_test_case.rb
331 endef
332 define Package/ruby-gems/install
333 $(INSTALL_DIR) $(1)/usr/bin
334 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gem $(1)/usr/bin/
335 $(INSTALL_DIR) $(1)/usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/default
336 $(INSTALL_DIR) $(1)/usr/lib/ruby/gems/$(PKG_LIBVER)/gems
337 $(INSTALL_DIR) $(1)/usr/lib/ruby/gems/$(PKG_LIBVER)/doc
338 $(INSTALL_DIR) $(1)/usr/lib/ruby/gems/$(PKG_LIBVER)/cache
339 $(INSTALL_DIR) $(1)/usr/lib/ruby/gems/$(PKG_LIBVER)/extensions
340 $(INSTALL_DIR) $(1)/usr/lib/ruby/gems/$(PKG_LIBVER)/build_info
341 $(call RubyBuildPackage/install,gems,$(1))
342 endef
343
344 define Package/ruby-io-console/files
345 /usr/lib/ruby/$(PKG_LIBVER)/*/io/console.so
346 /usr/lib/ruby/$(PKG_LIBVER)/io/console/
347 /usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/default/io-console-*.gemspec
348 endef
349
350 define Package/ruby-irb/files
351 /usr/lib/ruby/$(PKG_LIBVER)/irb
352 /usr/lib/ruby/$(PKG_LIBVER)/irb.rb
353 endef
354 define Package/ruby-irb/install
355 $(INSTALL_DIR) $(1)/usr/bin
356 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/irb $(1)/usr/bin/
357 $(call RubyBuildPackage/install,irb,$(1))
358 endef
359
360 define Package/ruby-json/files
361 /usr/lib/ruby/$(PKG_LIBVER)/json.rb
362 /usr/lib/ruby/$(PKG_LIBVER)/json
363 /usr/lib/ruby/$(PKG_LIBVER)/*/json
364 /usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/default/json-*.gemspec
365 endef
366 define Package/ruby-json/files-excluded
367 $(call Package/ruby-psych/files)
368 endef
369
370 define Package/ruby-logger/files
371 /usr/lib/ruby/$(PKG_LIBVER)/logger.rb
372 /usr/lib/ruby/$(PKG_LIBVER)/syslog/logger.rb
373 /usr/lib/ruby/$(PKG_LIBVER)/*/syslog.so
374 endef
375
376 define Package/ruby-math/files
377 /usr/lib/ruby/$(PKG_LIBVER)/prime.rb
378 /usr/lib/ruby/$(PKG_LIBVER)/mathn.rb
379 /usr/lib/ruby/$(PKG_LIBVER)/cmath.rb
380 /usr/lib/ruby/$(PKG_LIBVER)/*/mathn
381 /usr/lib/ruby/$(PKG_LIBVER)/matrix.rb
382 /usr/lib/ruby/$(PKG_LIBVER)/matrix
383 endef
384
385 define Package/ruby-minitest/files
386 /usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/minitest-*.gemspec
387 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/minitest-*
388 endef
389 define Package/ruby-minitest/files-excluded
390 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/minitest-*/test
391 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/minitest-*/*.rdoc
392 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/minitest-*/*.txt
393 endef
394
395 define Package/ruby-misc/files
396 /usr/lib/ruby/$(PKG_LIBVER)/English.rb
397 /usr/lib/ruby/$(PKG_LIBVER)/abbrev.rb
398 /usr/lib/ruby/$(PKG_LIBVER)/base64.rb
399 /usr/lib/ruby/$(PKG_LIBVER)/delegate.rb
400 /usr/lib/ruby/$(PKG_LIBVER)/e2mmap.rb
401 /usr/lib/ruby/$(PKG_LIBVER)/expect.rb
402 /usr/lib/ruby/$(PKG_LIBVER)/getoptlong.rb
403 /usr/lib/ruby/$(PKG_LIBVER)/open3.rb
404 /usr/lib/ruby/$(PKG_LIBVER)/ostruct.rb
405 /usr/lib/ruby/$(PKG_LIBVER)/scanf.rb
406 /usr/lib/ruby/$(PKG_LIBVER)/securerandom.rb
407 /usr/lib/ruby/$(PKG_LIBVER)/set.rb
408 /usr/lib/ruby/$(PKG_LIBVER)/shellwords.rb
409 /usr/lib/ruby/$(PKG_LIBVER)/tsort.rb
410 /usr/lib/ruby/$(PKG_LIBVER)/weakref.rb
411 /usr/lib/ruby/$(PKG_LIBVER)/*/continuation.so
412 /usr/lib/ruby/$(PKG_LIBVER)/*/coverage.so
413 /usr/lib/ruby/$(PKG_LIBVER)/*/etc.so
414 /usr/lib/ruby/$(PKG_LIBVER)/*/fcntl.so
415 /usr/lib/ruby/$(PKG_LIBVER)/*/fiber.so
416 /usr/lib/ruby/$(PKG_LIBVER)/*/pty.so
417 /usr/lib/ruby/$(PKG_LIBVER)/*/stringio.so
418 /usr/lib/ruby/$(PKG_LIBVER)/*/strscan.so
419 endef
420
421 define Package/ruby-mkmf/files
422 /usr/lib/ruby/$(PKG_LIBVER)/mkmf.rb
423 /usr/lib/ruby/$(PKG_LIBVER)/un.rb
424 endef
425
426 define Package/ruby-multithread/files
427 /usr/lib/ruby/$(PKG_LIBVER)/monitor.rb
428 /usr/lib/ruby/$(PKG_LIBVER)/timeout.rb
429 /usr/lib/ruby/$(PKG_LIBVER)/thwait.rb
430 /usr/lib/ruby/$(PKG_LIBVER)/mutex_m.rb
431 /usr/lib/ruby/$(PKG_LIBVER)/sync.rb
432 /usr/lib/ruby/$(PKG_LIBVER)/*/io/wait.so
433 /usr/lib/ruby/$(PKG_LIBVER)/*/io/nonblock.so
434 endef
435
436 define Package/ruby-net/files
437 /usr/lib/ruby/$(PKG_LIBVER)/open-uri.rb
438 /usr/lib/ruby/$(PKG_LIBVER)/net/*
439 endef
440
441 define Package/ruby-net-telnet/files
442 /usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/net-telnet-*.gemspec
443 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/net-telnet-*/
444 endef
445 define Package/ruby-net-telnet/files-excluded
446 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/net-telnet-*/*.md
447 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/net-telnet-*/*.txt
448 endef
449
450 define Package/ruby-nkf/files
451 /usr/lib/ruby/$(PKG_LIBVER)/kconv.rb
452 /usr/lib/ruby/$(PKG_LIBVER)/*/nkf.so
453 endef
454
455 define Package/ruby-openssl/files
456 /usr/lib/ruby/$(PKG_LIBVER)/openssl
457 /usr/lib/ruby/$(PKG_LIBVER)/openssl.rb
458 /usr/lib/ruby/$(PKG_LIBVER)/*/openssl.so
459 /usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/default/openssl-*.gemspec
460 endef
461
462 define Package/ruby-optparse/files
463 /usr/lib/ruby/$(PKG_LIBVER)/optparse.rb
464 /usr/lib/ruby/$(PKG_LIBVER)/optionparser.rb
465 /usr/lib/ruby/$(PKG_LIBVER)/optparse
466 endef
467
468 define Package/ruby-patterns/files
469 /usr/lib/ruby/$(PKG_LIBVER)/observer.rb
470 /usr/lib/ruby/$(PKG_LIBVER)/singleton.rb
471 /usr/lib/ruby/$(PKG_LIBVER)/forwardable.rb
472 /usr/lib/ruby/$(PKG_LIBVER)/forwardable
473 endef
474
475 define Package/ruby-powerassert/files
476 /usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/power_assert-*.gemspec
477 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/power_assert-*
478 endef
479 define Package/ruby-powerassert/files-excluded
480 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/power_assert-*/test
481 endef
482
483 define Package/ruby-prettyprint/files
484 /usr/lib/ruby/$(PKG_LIBVER)/pp.rb
485 /usr/lib/ruby/$(PKG_LIBVER)/prettyprint.rb
486 endef
487
488 define Package/ruby-pstore/files
489 /usr/lib/ruby/$(PKG_LIBVER)/pstore.rb
490 endef
491
492 define Package/ruby-psych/files
493 /usr/lib/ruby/$(PKG_LIBVER)/psych
494 /usr/lib/ruby/$(PKG_LIBVER)/psych.rb
495 /usr/lib/ruby/$(PKG_LIBVER)/*/psych.so
496 /usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/default/psych-*.gemspec
497 endef
498
499 define Package/ruby-racc/files
500 /usr/lib/ruby/$(PKG_LIBVER)/racc
501 /usr/lib/ruby/$(PKG_LIBVER)/*/racc/*.so
502 endef
503
504 define Package/ruby-rake/files
505 /usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/rake-*.gemspec
506 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/rake-*/
507 endef
508 define Package/ruby-rake/files-excluded
509 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/rake-*/doc
510 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/rake-*/*.rdoc
511 endef
512 define Package/ruby-rake/install
513 $(INSTALL_DIR) $(1)/usr/bin
514 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/rake $(1)/usr/bin/;
515 $(call RubyBuildPackage/install,rake,$(1))
516 endef
517
518 define Package/ruby-rbconfig/files
519 /usr/lib/ruby/$(PKG_LIBVER)/*/rbconfig.rb
520 /usr/lib/ruby/$(PKG_LIBVER)/rbconfig/*
521 /usr/lib/ruby/$(PKG_LIBVER)/*/rbconfig/*.so
522 endef
523
524 define Package/ruby-rdoc/files
525 /usr/lib/ruby/$(PKG_LIBVER)/rdoc.rb
526 /usr/lib/ruby/$(PKG_LIBVER)/rdoc
527 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/rdoc-*
528 /usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/default/rdoc-*.gemspec
529 endef
530 define Package/ruby-rdoc/files-excluded
531 /usr/lib/ruby/$(PKG_LIBVER)/rdoc/test_case.rb
532 /usr/lib/ruby/$(PKG_LIBVER)/rdoc/markup/formatter_test_case.rb
533 /usr/lib/ruby/$(PKG_LIBVER)/rdoc/markup/text_formatter_test_case.rb
534 endef
535 define Package/ruby-rdoc/install
536 $(INSTALL_DIR) $(1)/usr/bin
537 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/rdoc $(1)/usr/bin/
538 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ri $(1)/usr/bin/
539 $(call RubyBuildPackage/install,rdoc,$(1))
540 endef
541
542 define Package/ruby-readline/files
543 /usr/lib/ruby/$(PKG_LIBVER)/*/readline.so
544 endef
545
546 define Package/ruby-rexml/files
547 /usr/lib/ruby/$(PKG_LIBVER)/rexml
548 endef
549
550 define Package/ruby-rinda/files
551 /usr/lib/ruby/$(PKG_LIBVER)/rinda
552 endef
553
554 define Package/ruby-ripper/files
555 /usr/lib/ruby/$(PKG_LIBVER)/ripper.rb
556 /usr/lib/ruby/$(PKG_LIBVER)/ripper
557 /usr/lib/ruby/$(PKG_LIBVER)/*/ripper.so
558 endef
559
560 define Package/ruby-rss/files
561 /usr/lib/ruby/$(PKG_LIBVER)/rss
562 /usr/lib/ruby/$(PKG_LIBVER)/rss.rb
563 endef
564
565 define Package/ruby-sdbm/files
566 /usr/lib/ruby/$(PKG_LIBVER)/*/sdbm.so
567 endef
568
569 define Package/ruby-shell/files
570 /usr/lib/ruby/$(PKG_LIBVER)/shell.rb
571 /usr/lib/ruby/$(PKG_LIBVER)/shell
572 endef
573
574 define Package/ruby-socket/files
575 /usr/lib/ruby/$(PKG_LIBVER)/ipaddr.rb
576 /usr/lib/ruby/$(PKG_LIBVER)/resolv-replace.rb
577 /usr/lib/ruby/$(PKG_LIBVER)/resolv.rb
578 /usr/lib/ruby/$(PKG_LIBVER)/socket.rb
579 /usr/lib/ruby/$(PKG_LIBVER)/*/socket.so
580 endef
581
582 define Package/ruby-testunit/files
583 /usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/test-unit-*.gemspec
584 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/test-unit-*
585 endef
586 define Package/ruby-testunit/files-excluded
587 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/test-unit-*/doc
588 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/test-unit-*/test
589 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/test-unit-*/sample
590 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/test-unit-*/*.md
591 endef
592
593 define Package/ruby-unicodenormalize/files
594 /usr/lib/ruby/$(PKG_LIBVER)/unicode_normalize.rb
595 /usr/lib/ruby/$(PKG_LIBVER)/unicode_normalize
596 endef
597
598 define Package/ruby-uri/files
599 /usr/lib/ruby/$(PKG_LIBVER)/uri.rb
600 /usr/lib/ruby/$(PKG_LIBVER)/uri
601 endef
602
603 define Package/ruby-webrick/files
604 /usr/lib/ruby/$(PKG_LIBVER)/webrick
605 /usr/lib/ruby/$(PKG_LIBVER)/webrick.rb
606 endef
607
608 define Package/ruby-xmlrpc/files
609 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/xmlrpc-*
610 /usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/xmlrpc-*.gemspec
611 endef
612 define Package/ruby-xmlrpc/files-excluded
613 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/xmlrpc-0.2.1/*.md
614 /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/xmlrpc-0.2.1/*.txt
615 endef
616
617 define Package/ruby-yaml/files
618 /usr/lib/ruby/$(PKG_LIBVER)/yaml
619 /usr/lib/ruby/$(PKG_LIBVER)/yaml.rb
620 endef
621
622 define Package/ruby-zlib/files
623 /usr/lib/ruby/$(PKG_LIBVER)/*/zlib.so
624 endef
625
626 RUBY_FILES = $(strip $(call Package/ruby-$(1)/files))
627 RUBY_FILES_EXCLUDED = $(strip $(call Package/ruby-$(1)/files-excluded))
628
629 # 1: short name
630 # 2: install dir
631 define RubyBuildPackage/install
632 ( \
633 cd $(PKG_INSTALL_DIR) && \
634 $(TAR) -cf - \
635 $(if $(RUBY_FILES_EXCLUDED),--exclude-from <(ls -1d $(patsubst /%,%,$(RUBY_FILES_EXCLUDED)))) \
636 --files-from <(ls -1d $(patsubst /%,%,$(RUBY_FILES))) \
637 ) | ( \
638 [ -n "$(2)" ] && cd $(2) && $(TAR) -xf - \
639 )
640 endef
641
642 # 1: short name
643 # 2: description
644 # 3: dependencies on other packages
645 define RubyBuildPackage
646 RUBY_STDLIB += $(1)
647
648 # Package definition
649 ifndef Package/ruby-$(1)
650 define Package/ruby-$(1)
651 $(call Package/ruby/Default)
652 TITLE:=Ruby $(2)
653 DEPENDS:=ruby $(3)
654 endef
655 endif
656
657 ifndef Package/ruby-$(1)/description
658 define Package/ruby-$(1)/description
659 This package contains the ruby $(2).
660
661 endef
662 endif
663
664 # Description
665 ifndef Package/ruby-$(1)/install
666 ifndef Package/ruby-$(1)/files
667 $$(error It must exists either a Package/ruby-$(1)/install or Package/ruby-$(1)/files)
668 endif
669
670 define Package/ruby-$(1)/description +=
671
672 Provides:
673 $(patsubst /%,
674 - /%,$(RUBY_FILES))
675
676 endef
677
678 ifneq ($(RUBY_FILES_EXCLUDED),)
679 define Package/ruby-$(1)/description +=
680
681 Except:
682 $(patsubst /%,
683 - /%,$(RUBY_FILES_EXCLUDED))
684
685 endef
686 endif
687
688 Package/ruby-$(1)/install=$(call RubyBuildPackage/install,$(1),$$(1))
689 endif
690
691 $$(eval $$(call BuildPackage,ruby-$(1)))
692 endef
693
694 $(eval $(call BuildPackage,libruby))
695 $(eval $(call BuildPackage,ruby))
696 $(eval $(call RubyBuildPackage,bigdecimal,Arbitrary-precision decimal floating-point library,))
697 $(eval $(call RubyBuildPackage,cgi,CGI support toolkit,+ruby-filelib +ruby-pstore))
698 $(eval $(call RubyBuildPackage,csv,CSV library,+ruby-patterns +ruby-datetime +ruby-enc +ruby-misc))
699 $(eval $(call RubyBuildPackage,datetime,date library))
700 $(eval $(call RubyBuildPackage,dbm,support for dbm,+libdb47))
701 $(eval $(call RubyBuildPackage,debuglib,debug library,+ruby-prettyprint))
702 $(eval $(call RubyBuildPackage,did-you-mean,did you mean? experience,+ruby-misc))
703 $(eval $(call RubyBuildPackage,digest,Digest Library,+RUBY_DIGEST_USE_OPENSSL:libopenssl))
704 $(eval $(call RubyBuildPackage,drb,distributed object system,+ruby-filelib +ruby-patterns +ruby-socket))
705 $(eval $(call RubyBuildPackage,enc,character re-coding library charset (small subset),))
706 $(eval $(call RubyBuildPackage,enc-extra,character re-coding library charset (extra subset),+ruby-enc))
707 $(eval $(call RubyBuildPackage,erb,(embedded interpreter),+ruby-cgi))
708 $(eval $(call RubyBuildPackage,fiddle,libffi wrapper,+libffi))
709 $(eval $(call RubyBuildPackage,filelib,file utils library,+ruby-enc +ruby-misc))
710 $(eval $(call RubyBuildPackage,gdbm,support for gdbm,+libgdbm))
711 $(eval $(call RubyBuildPackage,gems,gems packet management,+ruby-net +ruby-rdoc))
712 $(eval $(call RubyBuildPackage,io-console,Console interface,))
713 $(eval $(call RubyBuildPackage,irb,(interactive shell),+ruby-debuglib +ruby-filelib +ruby-math))
714 $(eval $(call RubyBuildPackage,json,support for JSON,+ruby-datetime +ruby-misc))
715 $(eval $(call RubyBuildPackage,logger,logger and syslog library,+ruby-multithread))
716 $(eval $(call RubyBuildPackage,math,math library,+ruby-patterns +ruby-misc))
717 $(eval $(call RubyBuildPackage,minitest,Gem minitest,+ruby-gems))
718 $(eval $(call RubyBuildPackage,misc,standard libraries subset (miscellaneous files),))
719 $(eval $(call RubyBuildPackage,mkmf,makefile library,+ruby-filelib +ruby-optparse +ruby-rbconfig))
720 $(eval $(call RubyBuildPackage,multithread,multithread library,+ruby-misc))
721 $(eval $(call RubyBuildPackage,net,Network Protocols Library,+ruby-datetime +ruby-digest +ruby-filelib +ruby-uri))
722 $(eval $(call RubyBuildPackage,net-telnet,telnet client,+ruby-net))
723 $(eval $(call RubyBuildPackage,nkf,Network Kanji Filter,+ruby-enc))
724 $(eval $(call RubyBuildPackage,openssl,support for openssl,+ruby-enc +ruby-multithread +libopenssl))
725 $(eval $(call RubyBuildPackage,optparse,command-line option analysis,+ruby-misc))
726 $(eval $(call RubyBuildPackage,patterns,design patterns implementation,))
727 $(eval $(call RubyBuildPackage,powerassert,Gem power_assert,+ruby-ripper +ruby-debuglib))
728 $(eval $(call RubyBuildPackage,prettyprint,PrettyPrint library,+ruby-misc))
729 $(eval $(call RubyBuildPackage,pstore,file based persistence,+ruby-digest +ruby-enc))
730 $(eval $(call RubyBuildPackage,psych,YAML parser and emitter,+ruby-bigdecimal +ruby-datetime +ruby-misc +ruby-enc +libyaml))
731 $(eval $(call RubyBuildPackage,racc,LALR parser generator,))
732 $(eval $(call RubyBuildPackage,rake,Rake (make replacement),+ruby-filelib +ruby-optparse +ruby-patterns +ruby-rbconfig +ruby-multithread))
733 $(eval $(call RubyBuildPackage,rbconfig,RbConfig,))
734 $(eval $(call RubyBuildPackage,rdoc,documentation generator,+ruby-erb +ruby-irb +ruby-json +ruby-racc +ruby-rake +ruby-yaml +ruby-zlib))
735 $(eval $(call RubyBuildPackage,readline,support for readline,+libncurses +libreadline))
736 $(eval $(call RubyBuildPackage,rexml,XML toolkit,+ruby-patterns +ruby-enc +ruby-misc))
737 $(eval $(call RubyBuildPackage,rinda,Linda paradigm implementation,+ruby-drb))
738 $(eval $(call RubyBuildPackage,ripper,script parser,))
739 $(eval $(call RubyBuildPackage,rss,RSS toolkit,+ruby-net +ruby-nkf +ruby-rexml))
740 $(eval $(call RubyBuildPackage,sdbm,simple file-based key-value dbm implementation,))
741 $(eval $(call RubyBuildPackage,shell,idiomatic Ruby interface,+ruby-patterns +ruby-multithread))
742 $(eval $(call RubyBuildPackage,socket,socket support,+ruby-multithread))
743 $(eval $(call RubyBuildPackage,testunit,Gem test-unit,+ruby-csv +ruby-erb +ruby-optparse +ruby-powerassert +ruby-rexml +ruby-yaml))
744 $(eval $(call RubyBuildPackage,unicodenormalize,String additions for Unicode normalization,+ruby-enc +ruby-enc-extra))
745 $(eval $(call RubyBuildPackage,uri,library to handle URI,+ruby-socket +ruby-enc))
746 $(eval $(call RubyBuildPackage,webrick,Web server toolkit,+ruby-erb +ruby-net +ruby-patterns +ruby-rbconfig))
747 $(eval $(call RubyBuildPackage,xmlrpc,XML-RPC toolkit,+ruby-rexml +ruby-webrick))
748 $(eval $(call RubyBuildPackage,yaml,YAML toolkit,+ruby-dbm +ruby-pstore +ruby-psych))
749 $(eval $(call RubyBuildPackage,zlib,support for zlib,+zlib))
750 $(eval $(call BuildPackage,ruby-stdlib))
751 $(eval $(call HostBuild))