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.

749 lines
24 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.3.0
  13. PKG_RELEASE:=1
  14. PKG_LIBVER:=2.3
  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:=f0d9f9bbdc87372ca98988a571875819
  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=tk,tk/tkutil,win32,win32ole,dbm,gdbm,readline \
  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=tk,tk/tkutil,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. # if 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. endef
  150. define Package/libruby/install
  151. $(INSTALL_DIR) $(1)/usr/lib
  152. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libruby.so.* $(1)/usr/lib/
  153. endef
  154. RUBY_STDLIB :=
  155. define Package/ruby-stdlib
  156. $(call Package/ruby/Default)
  157. TITLE:=Ruby standard libraries (metadata for all stdlib subsets)
  158. DEPENDS:=ruby $(foreach subpackage,$(RUBY_STDLIB),$(strip $(call RubyDependency,$(subpackage))))
  159. HIDDEN:=1
  160. endef
  161. define Package/ruby-stdlib/description
  162. This metapackage currently install all ruby-* packages,
  163. providing a complete Ruby Standard Library.
  164. endef
  165. # nothing to do
  166. define Package/ruby-stdlib/install
  167. /bin/true
  168. endef
  169. define Package/ruby-bigdecimal/files
  170. /usr/lib/ruby/$(PKG_LIBVER)/*/bigdecimal.so
  171. /usr/lib/ruby/$(PKG_LIBVER)/bigdecimal/
  172. /usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/default/bigdecimal-*.gemspec
  173. endef
  174. define Package/ruby-cgi/files
  175. /usr/lib/ruby/$(PKG_LIBVER)/cgi
  176. /usr/lib/ruby/$(PKG_LIBVER)/cgi.rb
  177. /usr/lib/ruby/$(PKG_LIBVER)/*/cgi/escape.so
  178. endef
  179. define Package/ruby-csv/files
  180. /usr/lib/ruby/$(PKG_LIBVER)/csv.rb
  181. endef
  182. define Package/ruby-datetime/files
  183. /usr/lib/ruby/$(PKG_LIBVER)/time.rb
  184. /usr/lib/ruby/$(PKG_LIBVER)/date.rb
  185. /usr/lib/ruby/$(PKG_LIBVER)/*/date_core.so
  186. endef
  187. define Package/ruby-dbm/description
  188. The DBM class provides a wrapper to a Unix-style dbm or Database Manager library.
  189. This package provides dbm.so file.
  190. endef
  191. define Package/ruby-dbm/files
  192. /usr/lib/ruby/$(PKG_LIBVER)/*/dbm.so
  193. endef
  194. define Package/ruby-debuglib/files
  195. /usr/lib/ruby/$(PKG_LIBVER)/profile.rb
  196. /usr/lib/ruby/$(PKG_LIBVER)/profiler.rb
  197. /usr/lib/ruby/$(PKG_LIBVER)/debug.rb
  198. /usr/lib/ruby/$(PKG_LIBVER)/tracer.rb
  199. /usr/lib/ruby/$(PKG_LIBVER)/benchmark.rb
  200. /usr/lib/ruby/$(PKG_LIBVER)/*/objspace.so
  201. endef
  202. define Package/ruby-did-you-mean/files
  203. /usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/did_you_mean-*.gemspec
  204. /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/did_you_mean-*/
  205. endef
  206. define Package/ruby-did-you-mean/files-excluded
  207. /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/did_you_mean-*/benchmark
  208. /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/did_you_mean-*/doc
  209. /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/did_you_mean-*/evaluation
  210. /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/did_you_mean-*/test
  211. /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/did_you_mean-*/*.md
  212. endef
  213. define Package/ruby-digest/description
  214. Provides digest* files. Can be configured to use OpenSSL or
  215. bundled hash functions.
  216. endef
  217. define Package/ruby-digest/config
  218. config RUBY_DIGEST_USE_OPENSSL
  219. bool "Use OpenSSL functions for ruby digest hash functions"
  220. depends on PACKAGE_ruby-digest
  221. help
  222. Ruby can use OpenSSL hash functions or compile alternative implementations. Using
  223. OpenSSL saves about 30KBytes (less when compressed) but requires OpenSSL (that
  224. is way bigger than that). However, if OpenSSL is already needed by another usage,
  225. as ruby-openssl or any other non ruby package, it is better to mark this option.
  226. default n
  227. endef
  228. define Package/ruby-digest/files
  229. /usr/lib/ruby/$(PKG_LIBVER)/digest
  230. /usr/lib/ruby/$(PKG_LIBVER)/digest.rb
  231. /usr/lib/ruby/$(PKG_LIBVER)/*/digest.so
  232. /usr/lib/ruby/$(PKG_LIBVER)/*/digest/*
  233. endef
  234. define Package/ruby-drb/files
  235. /usr/lib/ruby/$(PKG_LIBVER)/drb.rb
  236. /usr/lib/ruby/$(PKG_LIBVER)/drb
  237. endef
  238. define Package/ruby-enc/files
  239. /usr/lib/ruby/$(PKG_LIBVER)/*/enc/encdb.so
  240. /usr/lib/ruby/$(PKG_LIBVER)/*/enc/iso_8859_1.so
  241. /usr/lib/ruby/$(PKG_LIBVER)/*/enc/utf_*.so
  242. /usr/lib/ruby/$(PKG_LIBVER)/*/enc/euc_jp.so
  243. endef
  244. define Package/ruby-enc-extra/files
  245. /usr/lib/ruby/$(PKG_LIBVER)/*/enc
  246. endef
  247. define Package/ruby-enc-extra/files-excluded
  248. $(call Package/ruby-enc/files)
  249. endef
  250. define Package/ruby-erb/files
  251. /usr/bin/erb
  252. /usr/lib/ruby/$(PKG_LIBVER)/erb.rb
  253. endef
  254. define Package/ruby-fiddle/files
  255. /usr/lib/ruby/$(PKG_LIBVER)/fiddle.rb
  256. /usr/lib/ruby/$(PKG_LIBVER)/fiddle/
  257. /usr/lib/ruby/$(PKG_LIBVER)/*/fiddle.so
  258. endef
  259. define Package/ruby-filelib/files
  260. /usr/lib/ruby/$(PKG_LIBVER)/tmpdir.rb
  261. /usr/lib/ruby/$(PKG_LIBVER)/tempfile.rb
  262. /usr/lib/ruby/$(PKG_LIBVER)/pathname.rb
  263. /usr/lib/ruby/$(PKG_LIBVER)/*/pathname.so
  264. /usr/lib/ruby/$(PKG_LIBVER)/find.rb
  265. /usr/lib/ruby/$(PKG_LIBVER)/fileutils.rb
  266. endef
  267. define Package/ruby-gdbm/files
  268. /usr/lib/ruby/$(PKG_LIBVER)/*/gdbm.so
  269. endef
  270. define Package/ruby-gems/files
  271. /usr/lib/ruby/$(PKG_LIBVER)/ubygems.rb
  272. /usr/lib/ruby/$(PKG_LIBVER)/rubygems.rb
  273. /usr/lib/ruby/$(PKG_LIBVER)/rubygems
  274. endef
  275. define Package/ruby-gems/files-excluded
  276. /usr/lib/ruby/$(PKG_LIBVER)/rubygems/test_case.rb
  277. /usr/lib/ruby/$(PKG_LIBVER)/rubygems/package/tar_test_case.rb
  278. /usr/lib/ruby/$(PKG_LIBVER)/rubygems/installer_test_case.rb
  279. endef
  280. define Package/ruby-gems/install
  281. $(INSTALL_DIR) $(1)/usr/bin
  282. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gem $(1)/usr/bin/
  283. $(INSTALL_DIR) $(1)/usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/default
  284. $(INSTALL_DIR) $(1)/usr/lib/ruby/gems/$(PKG_LIBVER)/gems
  285. $(INSTALL_DIR) $(1)/usr/lib/ruby/gems/$(PKG_LIBVER)/doc
  286. $(INSTALL_DIR) $(1)/usr/lib/ruby/gems/$(PKG_LIBVER)/cache
  287. $(INSTALL_DIR) $(1)/usr/lib/ruby/gems/$(PKG_LIBVER)/extensions
  288. $(INSTALL_DIR) $(1)/usr/lib/ruby/gems/$(PKG_LIBVER)/build_info
  289. $(call RubyBuildPackage/install,gems,$(1))
  290. endef
  291. define Package/ruby-io-console/files
  292. /usr/lib/ruby/$(PKG_LIBVER)/*/io/console.so
  293. /usr/lib/ruby/$(PKG_LIBVER)/io/console/
  294. /usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/default/io-console-*.gemspec
  295. endef
  296. define Package/ruby-irb/files
  297. /usr/lib/ruby/$(PKG_LIBVER)/irb
  298. /usr/lib/ruby/$(PKG_LIBVER)/irb.rb
  299. endef
  300. define Package/ruby-irb/install
  301. $(INSTALL_DIR) $(1)/usr/bin
  302. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/irb $(1)/usr/bin/
  303. $(call RubyBuildPackage/install,irb,$(1))
  304. endef
  305. define Package/ruby-json/files
  306. /usr/lib/ruby/$(PKG_LIBVER)/json.rb
  307. /usr/lib/ruby/$(PKG_LIBVER)/json
  308. /usr/lib/ruby/$(PKG_LIBVER)/*/json
  309. /usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/default/json-*.gemspec
  310. endef
  311. define Package/ruby-json/files-excluded
  312. $(call Package/ruby-psych/files)
  313. endef
  314. define Package/ruby-logger/files
  315. /usr/lib/ruby/$(PKG_LIBVER)/logger.rb
  316. /usr/lib/ruby/$(PKG_LIBVER)/syslog/logger.rb
  317. /usr/lib/ruby/$(PKG_LIBVER)/*/syslog.so
  318. endef
  319. define Package/ruby-math/files
  320. /usr/lib/ruby/$(PKG_LIBVER)/prime.rb
  321. /usr/lib/ruby/$(PKG_LIBVER)/mathn.rb
  322. /usr/lib/ruby/$(PKG_LIBVER)/cmath.rb
  323. /usr/lib/ruby/$(PKG_LIBVER)/*/mathn
  324. /usr/lib/ruby/$(PKG_LIBVER)/matrix.rb
  325. /usr/lib/ruby/$(PKG_LIBVER)/matrix
  326. endef
  327. define Package/ruby-minitest/files
  328. /usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/minitest-*.gemspec
  329. /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/minitest-*
  330. endef
  331. define Package/ruby-minitest/files-excluded
  332. /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/minitest-*/test
  333. /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/minitest-*/*.rdoc
  334. /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/minitest-*/*.txt
  335. endef
  336. define Package/ruby-misc/files
  337. /usr/lib/ruby/$(PKG_LIBVER)/English.rb
  338. /usr/lib/ruby/$(PKG_LIBVER)/abbrev.rb
  339. /usr/lib/ruby/$(PKG_LIBVER)/base64.rb
  340. /usr/lib/ruby/$(PKG_LIBVER)/delegate.rb
  341. /usr/lib/ruby/$(PKG_LIBVER)/e2mmap.rb
  342. /usr/lib/ruby/$(PKG_LIBVER)/expect.rb
  343. /usr/lib/ruby/$(PKG_LIBVER)/getoptlong.rb
  344. /usr/lib/ruby/$(PKG_LIBVER)/open3.rb
  345. /usr/lib/ruby/$(PKG_LIBVER)/ostruct.rb
  346. /usr/lib/ruby/$(PKG_LIBVER)/scanf.rb
  347. /usr/lib/ruby/$(PKG_LIBVER)/securerandom.rb
  348. /usr/lib/ruby/$(PKG_LIBVER)/set.rb
  349. /usr/lib/ruby/$(PKG_LIBVER)/shellwords.rb
  350. /usr/lib/ruby/$(PKG_LIBVER)/tsort.rb
  351. /usr/lib/ruby/$(PKG_LIBVER)/weakref.rb
  352. /usr/lib/ruby/$(PKG_LIBVER)/*/continuation.so
  353. /usr/lib/ruby/$(PKG_LIBVER)/*/coverage.so
  354. /usr/lib/ruby/$(PKG_LIBVER)/*/etc.so
  355. /usr/lib/ruby/$(PKG_LIBVER)/*/fcntl.so
  356. /usr/lib/ruby/$(PKG_LIBVER)/*/fiber.so
  357. /usr/lib/ruby/$(PKG_LIBVER)/*/pty.so
  358. /usr/lib/ruby/$(PKG_LIBVER)/*/stringio.so
  359. /usr/lib/ruby/$(PKG_LIBVER)/*/strscan.so
  360. endef
  361. define Package/ruby-mkmf/files
  362. /usr/lib/ruby/$(PKG_LIBVER)/mkmf.rb
  363. /usr/lib/ruby/$(PKG_LIBVER)/un.rb
  364. endef
  365. define Package/ruby-multithread/files
  366. /usr/lib/ruby/$(PKG_LIBVER)/monitor.rb
  367. /usr/lib/ruby/$(PKG_LIBVER)/timeout.rb
  368. /usr/lib/ruby/$(PKG_LIBVER)/thwait.rb
  369. /usr/lib/ruby/$(PKG_LIBVER)/mutex_m.rb
  370. /usr/lib/ruby/$(PKG_LIBVER)/sync.rb
  371. /usr/lib/ruby/$(PKG_LIBVER)/*/thread.so
  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. endef
  396. define Package/ruby-optparse/files
  397. /usr/lib/ruby/$(PKG_LIBVER)/optparse.rb
  398. /usr/lib/ruby/$(PKG_LIBVER)/optionparser.rb
  399. /usr/lib/ruby/$(PKG_LIBVER)/optparse
  400. endef
  401. define Package/ruby-patterns/files
  402. /usr/lib/ruby/$(PKG_LIBVER)/observer.rb
  403. /usr/lib/ruby/$(PKG_LIBVER)/singleton.rb
  404. /usr/lib/ruby/$(PKG_LIBVER)/forwardable.rb
  405. endef
  406. define Package/ruby-powerassert/files
  407. /usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/power_assert-*.gemspec
  408. /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/power_assert-*
  409. endef
  410. define Package/ruby-powerassert/files-excluded
  411. /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/power_assert-*/test
  412. endef
  413. define Package/ruby-prettyprint/files
  414. /usr/lib/ruby/$(PKG_LIBVER)/pp.rb
  415. /usr/lib/ruby/$(PKG_LIBVER)/prettyprint.rb
  416. endef
  417. define Package/ruby-pstore/files
  418. /usr/lib/ruby/$(PKG_LIBVER)/pstore.rb
  419. endef
  420. define Package/ruby-psych/files
  421. /usr/lib/ruby/$(PKG_LIBVER)/psych
  422. /usr/lib/ruby/$(PKG_LIBVER)/psych.rb
  423. /usr/lib/ruby/$(PKG_LIBVER)/psych_jars.rb
  424. /usr/lib/ruby/$(PKG_LIBVER)/*/psych.so
  425. /usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/default/psych-*.gemspec
  426. endef
  427. define Package/ruby-racc/files
  428. /usr/lib/ruby/$(PKG_LIBVER)/racc
  429. /usr/lib/ruby/$(PKG_LIBVER)/*/racc/*.so
  430. endef
  431. define Package/ruby-rake/files
  432. /usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/rake-*.gemspec
  433. /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/rake-*/
  434. endef
  435. define Package/ruby-rake/files-excluded
  436. /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/rake-*/doc
  437. /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/rake-*/test
  438. /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/rake-*/*.rdoc
  439. /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/rake-*/*.txt
  440. /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/rake-10.4.2/lib/rake/runtest.rb
  441. endef
  442. define Package/ruby-rake/install
  443. $(INSTALL_DIR) $(1)/usr/bin
  444. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/rake $(1)/usr/bin/;
  445. $(call RubyBuildPackage/install,rake,$(1))
  446. endef
  447. define Package/ruby-rbconfig/files
  448. /usr/lib/ruby/$(PKG_LIBVER)/*/rbconfig.rb
  449. /usr/lib/ruby/$(PKG_LIBVER)/rbconfig/*
  450. /usr/lib/ruby/$(PKG_LIBVER)/*/rbconfig/*.so
  451. endef
  452. define Package/ruby-rdoc/files
  453. /usr/lib/ruby/$(PKG_LIBVER)/rdoc.rb
  454. /usr/lib/ruby/$(PKG_LIBVER)/rdoc
  455. /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/rdoc-*
  456. /usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/default/rdoc-*.gemspec
  457. endef
  458. define Package/ruby-rdoc/files-excluded
  459. /usr/lib/ruby/$(PKG_LIBVER)/rdoc/test_case.rb
  460. /usr/lib/ruby/$(PKG_LIBVER)/rdoc/markup/formatter_test_case.rb
  461. /usr/lib/ruby/$(PKG_LIBVER)/rdoc/markup/text_formatter_test_case.rb
  462. endef
  463. define Package/ruby-rdoc/install
  464. $(INSTALL_DIR) $(1)/usr/bin
  465. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/rdoc $(1)/usr/bin/
  466. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ri $(1)/usr/bin/
  467. $(call RubyBuildPackage/install,rdoc,$(1))
  468. endef
  469. define Package/ruby-readline/files
  470. /usr/lib/ruby/$(PKG_LIBVER)/*/readline.so
  471. endef
  472. define Package/ruby-rexml/files
  473. /usr/lib/ruby/$(PKG_LIBVER)/rexml
  474. endef
  475. define Package/ruby-rinda/files
  476. /usr/lib/ruby/$(PKG_LIBVER)/rinda
  477. endef
  478. define Package/ruby-ripper/files
  479. /usr/lib/ruby/$(PKG_LIBVER)/ripper.rb
  480. /usr/lib/ruby/$(PKG_LIBVER)/ripper
  481. /usr/lib/ruby/$(PKG_LIBVER)/*/ripper.so
  482. endef
  483. define Package/ruby-rss/files
  484. /usr/lib/ruby/$(PKG_LIBVER)/rss
  485. /usr/lib/ruby/$(PKG_LIBVER)/rss.rb
  486. endef
  487. define Package/ruby-sdbm/files
  488. /usr/lib/ruby/$(PKG_LIBVER)/*/sdbm.so
  489. endef
  490. define Package/ruby-shell/files
  491. /usr/lib/ruby/$(PKG_LIBVER)/shell.rb
  492. /usr/lib/ruby/$(PKG_LIBVER)/shell
  493. endef
  494. define Package/ruby-socket/files
  495. /usr/lib/ruby/$(PKG_LIBVER)/ipaddr.rb
  496. /usr/lib/ruby/$(PKG_LIBVER)/resolv-replace.rb
  497. /usr/lib/ruby/$(PKG_LIBVER)/resolv.rb
  498. /usr/lib/ruby/$(PKG_LIBVER)/socket.rb
  499. /usr/lib/ruby/$(PKG_LIBVER)/*/socket.so
  500. endef
  501. define Package/ruby-testunit/files
  502. /usr/lib/ruby/gems/$(PKG_LIBVER)/specifications/test-unit-*.gemspec
  503. /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/test-unit-*
  504. endef
  505. define Package/ruby-testunit/files-excluded
  506. /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/test-unit-*/doc
  507. /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/test-unit-*/test
  508. /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/test-unit-*/sample
  509. /usr/lib/ruby/gems/$(PKG_LIBVER)/gems/test-unit-*/*.md
  510. endef
  511. define Package/ruby-unicodenormalize/files
  512. /usr/lib/ruby/$(PKG_LIBVER)/unicode_normalize.rb
  513. /usr/lib/ruby/$(PKG_LIBVER)/unicode_normalize
  514. endef
  515. define Package/ruby-uri/files
  516. /usr/lib/ruby/$(PKG_LIBVER)/uri.rb
  517. /usr/lib/ruby/$(PKG_LIBVER)/uri
  518. endef
  519. define Package/ruby-webrick/files
  520. /usr/lib/ruby/$(PKG_LIBVER)/webrick
  521. /usr/lib/ruby/$(PKG_LIBVER)/webrick.rb
  522. endef
  523. define Package/ruby-xmlrpc/files
  524. /usr/lib/ruby/$(PKG_LIBVER)/xmlrpc
  525. /usr/lib/ruby/$(PKG_LIBVER)/xmlrpc.rb
  526. endef
  527. define Package/ruby-yaml/files
  528. /usr/lib/ruby/$(PKG_LIBVER)/yaml
  529. /usr/lib/ruby/$(PKG_LIBVER)/yaml.rb
  530. endef
  531. define Package/ruby-zlib/files
  532. /usr/lib/ruby/$(PKG_LIBVER)/*/zlib.so
  533. endef
  534. RUBY_FILES = $(strip $(call Package/ruby-$(1)/files))
  535. RUBY_FILES_EXCLUDED = $(strip $(call Package/ruby-$(1)/files-excluded))
  536. # 1: short name
  537. # 2: install dir
  538. define RubyBuildPackage/install
  539. ( \
  540. cd $(PKG_INSTALL_DIR) && \
  541. $(TAR) -cf - \
  542. --files-from <(ls -1d $(patsubst /%,%,$(RUBY_FILES))) \
  543. $(if $(RUBY_FILES_EXCLUDED),--exclude-from <(ls -1d $(patsubst /%,%,$(RUBY_FILES_EXCLUDED)))) \
  544. ) | ( \
  545. [ -n "$(2)" ] && cd $(2) && $(TAR) -xf - \
  546. )
  547. endef
  548. # 1: short name
  549. # 2: description
  550. # 3: dependencies on other packages
  551. define RubyBuildPackage
  552. RUBY_STDLIB += $(1)
  553. # Package definition
  554. ifndef Package/ruby-$(1)
  555. define Package/ruby-$(1)
  556. $(call Package/ruby/Default)
  557. TITLE:=Ruby $(2)
  558. DEPENDS:=ruby $(3)
  559. endef
  560. endif
  561. ifndef Package/ruby-$(1)/description
  562. define Package/ruby-$(1)/description
  563. This package contains the ruby $(2).
  564. endef
  565. endif
  566. # Description
  567. ifndef Package/ruby-$(1)/install
  568. ifndef Package/ruby-$(1)/files
  569. $$(error It must exists either a Package/ruby-$(1)/install or Package/ruby-$(1)/files)
  570. endif
  571. define Package/ruby-$(1)/description +=
  572. Provides:
  573. $(patsubst /%,
  574. - /%,$(RUBY_FILES))
  575. endef
  576. ifneq ($(RUBY_FILES_EXCLUDED),)
  577. define Package/ruby-$(1)/description +=
  578. Except:
  579. $(patsubst /%,
  580. - /%,$(RUBY_FILES_EXCLUDED))
  581. endef
  582. endif
  583. Package/ruby-$(1)/install=$(call RubyBuildPackage/install,$(1),$$(1))
  584. endif
  585. $$(eval $$(call BuildPackage,ruby-$(1)))
  586. endef
  587. $(eval $(call BuildPackage,ruby))
  588. $(eval $(call BuildPackage,libruby))
  589. $(eval $(call RubyBuildPackage,bigdecimal,Arbitrary-precision decimal floating-point library,))
  590. $(eval $(call RubyBuildPackage,cgi,CGI support toolkit,+ruby-filelib +ruby-pstore))
  591. $(eval $(call RubyBuildPackage,csv,CSV library,+ruby-patterns +ruby-datetime +ruby-enc))
  592. $(eval $(call RubyBuildPackage,datetime,date library))
  593. $(eval $(call RubyBuildPackage,dbm,support for dbm,+libdb47))
  594. $(eval $(call RubyBuildPackage,debuglib,debug library,+ruby-multithread +ruby-prettyprint))
  595. $(eval $(call RubyBuildPackage,did-you-mean,did you mean? experience,+ruby-misc))
  596. $(eval $(call RubyBuildPackage,digest,Digest Library,+RUBY_DIGEST_USE_OPENSSL:libopenssl))
  597. $(eval $(call RubyBuildPackage,drb,distributed object system,+ruby-filelib +ruby-patterns +ruby-socket))
  598. $(eval $(call RubyBuildPackage,enc,character re-coding library charset (small subset),))
  599. $(eval $(call RubyBuildPackage,enc-extra,character re-coding library charset (extra subset),+ruby-enc))
  600. $(eval $(call RubyBuildPackage,erb,(embedded interpreter),+ruby-cgi))
  601. $(eval $(call RubyBuildPackage,fiddle,libffi wrapper,+libffi))
  602. $(eval $(call RubyBuildPackage,filelib,file utils library,+ruby-enc +ruby-misc))
  603. $(eval $(call RubyBuildPackage,gdbm,support for gdbm,+libgdbm))
  604. $(eval $(call RubyBuildPackage,gems,gems packet management,+ruby-net +ruby-rdoc))
  605. $(eval $(call RubyBuildPackage,io-console,Console interface,))
  606. $(eval $(call RubyBuildPackage,irb,(interactive shell),+ruby-debuglib +ruby-filelib +ruby-math))
  607. $(eval $(call RubyBuildPackage,json,support for JSON,+ruby-datetime +ruby-misc))
  608. $(eval $(call RubyBuildPackage,logger,logger and syslog library,+ruby-multithread))
  609. $(eval $(call RubyBuildPackage,math,math library,+ruby-patterns))
  610. $(eval $(call RubyBuildPackage,minitest,Gem minitest,+ruby-gems))
  611. $(eval $(call RubyBuildPackage,misc,standard libraries subset (miscellaneous files),))
  612. $(eval $(call RubyBuildPackage,mkmf,makefile library,+ruby-filelib +ruby-optparse +ruby-rbconfig))
  613. $(eval $(call RubyBuildPackage,multithread,multithread library,+ruby-misc))
  614. $(eval $(call RubyBuildPackage,net,Network Protocols Library,+ruby-datetime +ruby-digest +ruby-filelib +ruby-uri))
  615. $(eval $(call RubyBuildPackage,net-telnet,telnet client,+ruby-net))
  616. $(eval $(call RubyBuildPackage,nkf,Network Kanji Filter,+ruby-enc))
  617. $(eval $(call RubyBuildPackage,openssl,support for openssl,+ruby-enc +ruby-multithread +libopenssl))
  618. $(eval $(call RubyBuildPackage,optparse,command-line option analysis,+ruby-misc))
  619. $(eval $(call RubyBuildPackage,patterns,design patterns implementation,+ruby-multithread))
  620. $(eval $(call RubyBuildPackage,powerassert,Gem power_assert,+ruby-ripper))
  621. $(eval $(call RubyBuildPackage,prettyprint,PrettyPrint library,+ruby-misc))
  622. $(eval $(call RubyBuildPackage,pstore,file based persistence,+ruby-digest +ruby-enc))
  623. $(eval $(call RubyBuildPackage,psych,YAML parser and emitter,+ruby-bigdecimal +ruby-datetime +ruby-misc +ruby-enc +libyaml))
  624. $(eval $(call RubyBuildPackage,racc,LALR parser generator,))
  625. $(eval $(call RubyBuildPackage,rake,Rake (make replacement),+ruby-datetime +ruby-filelib +ruby-optparse +ruby-patterns +ruby-rbconfig))
  626. $(eval $(call RubyBuildPackage,rbconfig,RbConfig,))
  627. $(eval $(call RubyBuildPackage,rdoc,documentation generator,+ruby-erb +ruby-irb +ruby-json +ruby-racc +ruby-rake +ruby-yaml +ruby-zlib))
  628. $(eval $(call RubyBuildPackage,readline,support for readline,+libncurses +libreadline))
  629. $(eval $(call RubyBuildPackage,rexml,XML toolkit,+ruby-patterns +ruby-enc))
  630. $(eval $(call RubyBuildPackage,rinda,Linda paradigm implementation,+ruby-drb))
  631. $(eval $(call RubyBuildPackage,ripper,script parser,))
  632. $(eval $(call RubyBuildPackage,rss,RSS toolkit,+ruby-net +ruby-nkf +ruby-rexml))
  633. $(eval $(call RubyBuildPackage,sdbm,simple file-based key-value dbm implementation,))
  634. $(eval $(call RubyBuildPackage,shell,idiomatic Ruby interface,+ruby-patterns))
  635. $(eval $(call RubyBuildPackage,socket,socket support,+ruby-multithread))
  636. $(eval $(call RubyBuildPackage,testunit,Gem test-unit,+ruby-csv +ruby-erb +ruby-optparse +ruby-powerassert +ruby-prettyprint +ruby-rexml +ruby-yaml))
  637. $(eval $(call RubyBuildPackage,unicodenormalize,String additions for Unicode normalization,+ruby-enc +ruby-enc-extra))
  638. $(eval $(call RubyBuildPackage,uri,library to handle URI,+ruby-socket +ruby-enc))
  639. $(eval $(call RubyBuildPackage,webrick,Web server toolkit,+ruby-erb +ruby-net +ruby-patterns +ruby-rbconfig))
  640. $(eval $(call RubyBuildPackage,xmlrpc,XML-RPC toolkit,+ruby-rexml +ruby-webrick))
  641. $(eval $(call RubyBuildPackage,yaml,YAML toolkit,+ruby-dbm +ruby-pstore +ruby-psych))
  642. $(eval $(call RubyBuildPackage,zlib,support for zlib,+zlib))
  643. $(eval $(call BuildPackage,ruby-stdlib))
  644. $(eval $(call HostBuild))