1
0

Makefile 26 KB

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