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.

807 lines
29 KiB

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