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