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.

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