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.

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