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.

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