You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

751 lines
25 KiB

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