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.

486 lines
13 KiB

  1. #
  2. # Copyright (C) 2006-2014 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. #
  8. # To Do:
  9. # - split up encodings
  10. # - allow selection of either native or pure version of a library where supported
  11. # +-> some native libraries are probably only supported if ruby-dl is enabled
  12. # anything else?
  13. include $(TOPDIR)/rules.mk
  14. PKG_NAME:=ruby
  15. PKG_VERSION:=2.1.2
  16. PKG_RELEASE:=1
  17. PKG_LIBVER:=2.1
  18. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  19. PKG_SOURCE_URL:=http://cache.ruby-lang.org/pub/ruby/$(PKG_LIBVER)/
  20. PKG_MD5SUM:=ed9b8565bdeccb401d628ec8d54a0774
  21. PKG_MAINTAINER:=Luiz Angelo Daros de Luca <luizluca@gmail.com>
  22. PKG_LICENSE:=BSD-2-Clause
  23. PKG_LICENSE_FILE:=COPYING
  24. PKG_BUILD_DEPENDS:=ruby/host gmp/host
  25. PKG_INSTALL:=1
  26. PKG_BUILD_PARALLEL:=1
  27. PKG_FIXUP:=autoreconf
  28. include $(INCLUDE_DIR)/host-build.mk
  29. include $(INCLUDE_DIR)/package.mk
  30. include $(INCLUDE_DIR)/nls.mk
  31. define Package/ruby/Default
  32. SUBMENU:=Ruby
  33. SECTION:=lang
  34. CATEGORY:=Languages
  35. TITLE:=Ruby scripting language
  36. URL:=http://www.ruby-lang.org/
  37. endef
  38. define Package/ruby/Default/description
  39. Ruby is the interpreted scripting language for quick and easy
  40. object-oriented programming. It has many features to process text files
  41. and to do system management tasks (as in perl). It is simple,
  42. straight-forward, and extensible.
  43. endef
  44. define Package/ruby
  45. $(call Package/ruby/Default)
  46. TITLE+= (interpreter)
  47. DEPENDS:=+libruby
  48. endef
  49. define Package/ruby/description
  50. $(call Package/ruby/Default/description)
  51. endef
  52. define Package/libruby
  53. $(call Package/ruby/Default)
  54. SUBMENU:=
  55. SECTION:=libs
  56. CATEGORY:=Libraries
  57. TITLE+= (shared library)
  58. DEPENDS+= +libpthread +librt +libgmp
  59. endef
  60. # Ongoing work to break up ruby's standard library into coherent pieces
  61. # with minimal dependencies between them
  62. define Package/ruby-core
  63. $(call Package/ruby/Default)
  64. TITLE:=Ruby standard libraries
  65. DEPENDS:=ruby +libdb47 +libffi
  66. endef
  67. define Package/ruby-cgi
  68. $(call Package/ruby/Default)
  69. TITLE:=Ruby CGI support toolkit
  70. DEPENDS:=ruby
  71. endef
  72. define Package/ruby-dl
  73. $(call Package/ruby/Default)
  74. TITLE+= (dynamic linker support) (adds 5MB+)
  75. DEPENDS:=ruby
  76. endef
  77. define Package/ruby-enc
  78. $(call Package/ruby/Default)
  79. TITLE+= (character re-coding library) (adds 2MB+)
  80. DEPENDS:=ruby
  81. endef
  82. define Package/ruby-erb
  83. $(call Package/ruby/Default)
  84. TITLE+= (embedded interpreter)
  85. DEPENDS:=ruby
  86. endef
  87. define Package/ruby-gdbm
  88. $(call Package/ruby/Default)
  89. TITLE:=Ruby support for gdbm
  90. DEPENDS:=ruby +libgdbm
  91. endef
  92. define Package/ruby-gems
  93. $(call Package/ruby/Default)
  94. TITLE:=Ruby gems packet management
  95. DEPENDS:=ruby +ruby-yaml +ruby-zlib +ruby-openssl +ruby-webrick +ruby-erb
  96. endef
  97. define Package/ruby-irb
  98. $(call Package/ruby/Default)
  99. TITLE+= (interactive shell)
  100. DEPENDS:=ruby +ruby-core
  101. endef
  102. define Package/ruby-json
  103. $(call Package/ruby/Default)
  104. TITLE:=Ruby support for JSON
  105. DEPENDS:=ruby
  106. endef
  107. define Package/ruby-ncurses
  108. $(call Package/ruby/Default)
  109. TITLE:=Ruby support for ncurses
  110. DEPENDS:=ruby +libncurses +libncursesw
  111. endef
  112. define Package/ruby-nkf
  113. $(call Package/ruby/Default)
  114. TITLE:=Ruby Network Kanji Filter
  115. DEPENDS:=ruby
  116. endef
  117. define Package/ruby-openssl
  118. $(call Package/ruby/Default)
  119. TITLE:=Ruby support for openssl
  120. DEPENDS:=ruby +libopenssl
  121. endef
  122. define Package/ruby-rdoc
  123. $(call Package/ruby/Default)
  124. TITLE+= (documentation generator)
  125. DEPENDS:=ruby
  126. endef
  127. define Package/ruby-rake
  128. $(call Package/ruby/Default)
  129. TITLE+=Ruby Rake (make replacement)
  130. DEPENDS:=ruby
  131. endef
  132. define Package/ruby-readline
  133. $(call Package/ruby/Default)
  134. TITLE:=Ruby support for readline
  135. DEPENDS:=ruby +libncurses +libreadline
  136. endef
  137. define Package/ruby-rexml
  138. $(call Package/ruby/Default)
  139. TITLE:=Ruby XML toolkit
  140. DEPENDS:=ruby
  141. endef
  142. define Package/ruby-rss
  143. $(call Package/ruby/Default)
  144. TITLE:=Ruby RSS toolkit
  145. DEPENDS:=ruby
  146. endef
  147. define Package/ruby-unit
  148. $(call Package/ruby/Default)
  149. TITLE:=Ruby unit testing toolkit
  150. DEPENDS:=ruby
  151. endef
  152. define Package/ruby-webrick
  153. $(call Package/ruby/Default)
  154. TITLE:=Ruby Web server toolkit
  155. DEPENDS:=ruby
  156. endef
  157. define Package/ruby-xmlrpc
  158. $(call Package/ruby/Default)
  159. TITLE:=Ruby XML-RPC toolkit
  160. DEPENDS:=ruby
  161. endef
  162. define Package/ruby-yaml
  163. $(call Package/ruby/Default)
  164. TITLE:=Ruby YAML toolkit
  165. DEPENDS:=ruby
  166. endef
  167. define Package/ruby-zlib
  168. $(call Package/ruby/Default)
  169. TITLE:=Ruby support for zlib
  170. DEPENDS:=ruby +zlib
  171. endef
  172. HOST_CONFIGURE_ARGS += \
  173. --disable-install-doc \
  174. --disable-install-rdoc \
  175. --disable-install-capi
  176. CONFIGURE_ARGS += \
  177. --enable-shared \
  178. --enable-static \
  179. --disable-rpath \
  180. --enable-ipv6 \
  181. --with-ruby-version=minor \
  182. --with-iconv-dir=$(ICONV_PREFIX) \
  183. TARGET_LDFLAGS += -L$(PKG_BUILD_DIR)
  184. MAKE_FLAGS += \
  185. DESTDIR="$(PKG_INSTALL_DIR)" \
  186. SHELL="/bin/bash"
  187. define Package/ruby/install
  188. $(INSTALL_DIR) $(1)/usr/bin
  189. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ruby $(1)/usr/bin/
  190. endef
  191. define Package/libruby/install
  192. $(INSTALL_DIR) $(1)/usr/lib
  193. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libruby.so.* $(1)/usr/lib/
  194. endef
  195. define Package/ruby-core/install
  196. $(INSTALL_DIR) $(1)/usr/lib
  197. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby $(1)/usr/lib/
  198. rm -rf \
  199. $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/curses.so \
  200. \
  201. $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/gdbm.so \
  202. \
  203. $(1)/usr/lib/ruby/$(PKG_LIBVER)/kconv.rb \
  204. $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/nkf.so \
  205. \
  206. $(1)/usr/lib/ruby/$(PKG_LIBVER)/digest \
  207. $(1)/usr/lib/ruby/$(PKG_LIBVER)/digest.rb \
  208. $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/digest \
  209. $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/digest.so \
  210. $(1)/usr/lib/ruby/$(PKG_LIBVER)/openssl \
  211. $(1)/usr/lib/ruby/$(PKG_LIBVER)/openssl.rb \
  212. $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/openssl.so \
  213. $(1)/usr/lib/ruby/$(PKG_LIBVER)/drb/ssl.rb \
  214. $(1)/usr/lib/ruby/$(PKG_LIBVER)/net/https.rb \
  215. $(1)/usr/lib/ruby/$(PKG_LIBVER)/webrick/ssl.rb \
  216. \
  217. $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/dl.so \
  218. \
  219. $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/enc \
  220. \
  221. $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/readline.so \
  222. $(1)/usr/lib/ruby/$(PKG_LIBVER)/irb/completion.rb \
  223. $(1)/usr/lib/ruby/$(PKG_LIBVER)/irb/ext/save-history.rb \
  224. \
  225. $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/zlib.so \
  226. \
  227. $(1)/usr/lib/ruby/$(PKG_LIBVER)/erb.rb \
  228. \
  229. $(1)/usr/lib/ruby/$(PKG_LIBVER)/json.rb \
  230. $(1)/usr/lib/ruby/$(PKG_LIBVER)/json \
  231. $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/json \
  232. \
  233. $(1)/usr/lib/ruby/$(PKG_LIBVER)/irb.rb \
  234. $(1)/usr/lib/ruby/$(PKG_LIBVER)/irb \
  235. \
  236. $(1)/usr/lib/ruby/$(PKG_LIBVER)/rdoc \
  237. \
  238. $(1)/usr/lib/ruby/$(PKG_LIBVER)/rake.rb \
  239. $(1)/usr/lib/ruby/$(PKG_LIBVER)/rake \
  240. \
  241. $(1)/usr/lib/ruby/$(PKG_LIBVER)/rubygems.rb \
  242. $(1)/usr/lib/ruby/$(PKG_LIBVER)/rubygems \
  243. \
  244. $(1)/usr/lib/ruby/$(PKG_LIBVER)/cgi.rb \
  245. $(1)/usr/lib/ruby/$(PKG_LIBVER)/cgi \
  246. \
  247. $(1)/usr/lib/ruby/$(PKG_LIBVER)/rexml \
  248. \
  249. $(1)/usr/lib/ruby/$(PKG_LIBVER)/rss \
  250. $(1)/usr/lib/ruby/$(PKG_LIBVER)/rss.rb \
  251. \
  252. $(1)/usr/lib/ruby/$(PKG_LIBVER)/test \
  253. \
  254. $(1)/usr/lib/ruby/$(PKG_LIBVER)/webrick \
  255. $(1)/usr/lib/ruby/$(PKG_LIBVER)/webrick.rb \
  256. \
  257. $(1)/usr/lib/ruby/$(PKG_LIBVER)/xmlrpc \
  258. \
  259. $(1)/usr/lib/ruby/$(PKG_LIBVER)/yaml \
  260. $(1)/usr/lib/ruby/$(PKG_LIBVER)/yaml.rb \
  261. $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/syck.so \
  262. find $(1) -name '*.h' | xargs rm -f
  263. endef
  264. define Package/ruby-cgi/install
  265. $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
  266. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/cgi $(1)/usr/lib/ruby/$(PKG_LIBVER)/
  267. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/cgi.rb $(1)/usr/lib/ruby/$(PKG_LIBVER)/
  268. endef
  269. define Package/ruby-dl/install
  270. ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
  271. usr/lib/ruby/$(PKG_LIBVER)/*/dl.so \
  272. ) | ( cd $(1); $(TAR) -xf - )
  273. endef
  274. define Package/ruby-enc/install
  275. ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
  276. usr/lib/ruby/$(PKG_LIBVER)/*/enc \
  277. ) | ( cd $(1); $(TAR) -xf - )
  278. endef
  279. define Package/ruby-erb/install
  280. $(INSTALL_DIR) $(1)/usr/bin
  281. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/erb $(1)/usr/bin/
  282. $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)/
  283. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/erb.rb $(1)/usr/lib/ruby/$(PKG_LIBVER)/
  284. endef
  285. define Package/ruby-gdbm/install
  286. ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
  287. usr/lib/ruby/$(PKG_LIBVER)/*/gdbm.so \
  288. ) | ( cd $(1); $(TAR) -xf - )
  289. endef
  290. define Package/ruby-gems/install
  291. $(INSTALL_DIR) $(1)/usr/bin
  292. $(CP) $(PKG_INSTALL_DIR)/usr/bin/gem $(1)/usr/bin/
  293. $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
  294. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/rubygems.rb $(1)/usr/lib/ruby/$(PKG_LIBVER)/
  295. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/rubygems $(1)/usr/lib/ruby/$(PKG_LIBVER)/
  296. endef
  297. define Package/ruby-irb/install
  298. $(INSTALL_DIR) $(1)/usr/bin
  299. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/irb $(1)/usr/bin/
  300. $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
  301. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/irb $(1)/usr/lib/ruby/$(PKG_LIBVER)/
  302. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/irb.rb $(1)/usr/lib/ruby/$(PKG_LIBVER)/
  303. endef
  304. define Package/ruby-json/install
  305. ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
  306. usr/lib/ruby/$(PKG_LIBVER)/json.rb \
  307. usr/lib/ruby/$(PKG_LIBVER)/json \
  308. usr/lib/ruby/$(PKG_LIBVER)/*/json \
  309. ) | ( cd $(1); $(TAR) -xf - )
  310. endef
  311. define Package/ruby-ncurses/install
  312. ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
  313. usr/lib/ruby/$(PKG_LIBVER)/*/curses.so \
  314. ) | ( cd $(1); $(TAR) -xf - )
  315. endef
  316. define Package/ruby-nkf/install
  317. ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
  318. usr/lib/ruby/$(PKG_LIBVER)/kconv.rb \
  319. usr/lib/ruby/$(PKG_LIBVER)/*/nkf.so \
  320. ) | ( cd $(1); $(TAR) -xf - )
  321. endef
  322. define Package/ruby-openssl/install
  323. ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
  324. usr/lib/ruby/$(PKG_LIBVER)/digest \
  325. usr/lib/ruby/$(PKG_LIBVER)/digest.rb \
  326. usr/lib/ruby/$(PKG_LIBVER)/*/digest.so \
  327. usr/lib/ruby/$(PKG_LIBVER)/*/digest/*.so \
  328. usr/lib/ruby/$(PKG_LIBVER)/openssl \
  329. usr/lib/ruby/$(PKG_LIBVER)/openssl.rb \
  330. usr/lib/ruby/$(PKG_LIBVER)/*/openssl.so \
  331. usr/lib/ruby/$(PKG_LIBVER)/drb/ssl.rb \
  332. usr/lib/ruby/$(PKG_LIBVER)/net/https.rb \
  333. ) | ( cd $(1); $(TAR) -xf - )
  334. endef
  335. define Package/ruby-rdoc/install
  336. $(INSTALL_DIR) $(1)/usr/bin
  337. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/rdoc $(1)/usr/bin/
  338. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ri $(1)/usr/bin/
  339. $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
  340. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/rdoc $(1)/usr/lib/ruby/$(PKG_LIBVER)/
  341. endef
  342. define Package/ruby-rake/install
  343. $(INSTALL_DIR) $(1)/usr/bin
  344. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/rake $(1)/usr/bin/
  345. $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
  346. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/rake.rb $(1)/usr/lib/ruby/$(PKG_LIBVER)/
  347. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/rake $(1)/usr/lib/ruby/$(PKG_LIBVER)/
  348. endef
  349. define Package/ruby-readline/install
  350. ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
  351. usr/lib/ruby/$(PKG_LIBVER)/*/readline.so \
  352. ) | ( cd $(1); $(TAR) -xf - )
  353. endef
  354. define Package/ruby-rexml/install
  355. $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
  356. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/rexml $(1)/usr/lib/ruby/$(PKG_LIBVER)/
  357. endef
  358. define Package/ruby-rss/install
  359. $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
  360. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/rss $(1)/usr/lib/ruby/$(PKG_LIBVER)/
  361. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/rss.rb $(1)/usr/lib/ruby/$(PKG_LIBVER)/
  362. endef
  363. define Package/ruby-unit/install
  364. $(INSTALL_DIR) $(1)/usr/bin
  365. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/testrb $(1)/usr/bin/
  366. $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
  367. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/test $(1)/usr/lib/ruby/$(PKG_LIBVER)/
  368. endef
  369. define Package/ruby-webrick/install
  370. $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
  371. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/webrick $(1)/usr/lib/ruby/$(PKG_LIBVER)/
  372. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/webrick.rb $(1)/usr/lib/ruby/$(PKG_LIBVER)/
  373. endef
  374. define Package/ruby-xmlrpc/install
  375. $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
  376. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/xmlrpc $(1)/usr/lib/ruby/$(PKG_LIBVER)/
  377. endef
  378. define Package/ruby-yaml/install
  379. ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
  380. usr/lib/ruby/$(PKG_LIBVER)/yaml \
  381. usr/lib/ruby/$(PKG_LIBVER)/yaml.rb \
  382. usr/lib/ruby/$(PKG_LIBVER)/*/syck.so \
  383. ) | ( cd $(1); $(TAR) -xf - )
  384. endef
  385. define Package/ruby-zlib/install
  386. ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
  387. usr/lib/ruby/$(PKG_LIBVER)/*/zlib.so \
  388. ) | ( cd $(1); $(TAR) -xf - )
  389. endef
  390. define Build/InstallDev
  391. ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
  392. . \
  393. ) | ( cd $(1); $(TAR) -xf - )
  394. endef
  395. $(eval $(call BuildPackage,ruby))
  396. $(eval $(call BuildPackage,libruby))
  397. $(eval $(call BuildPackage,ruby-core))
  398. $(eval $(call BuildPackage,ruby-cgi))
  399. $(eval $(call BuildPackage,ruby-dl))
  400. $(eval $(call BuildPackage,ruby-enc))
  401. $(eval $(call BuildPackage,ruby-erb))
  402. $(eval $(call BuildPackage,ruby-gdbm))
  403. $(eval $(call BuildPackage,ruby-gems))
  404. $(eval $(call BuildPackage,ruby-json))
  405. $(eval $(call BuildPackage,ruby-irb))
  406. $(eval $(call BuildPackage,ruby-ncurses))
  407. $(eval $(call BuildPackage,ruby-nkf))
  408. $(eval $(call BuildPackage,ruby-openssl))
  409. $(eval $(call BuildPackage,ruby-rake))
  410. $(eval $(call BuildPackage,ruby-rdoc))
  411. $(eval $(call BuildPackage,ruby-readline))
  412. $(eval $(call BuildPackage,ruby-rexml))
  413. $(eval $(call BuildPackage,ruby-rss))
  414. $(eval $(call BuildPackage,ruby-unit))
  415. $(eval $(call BuildPackage,ruby-webrick))
  416. $(eval $(call BuildPackage,ruby-xmlrpc))
  417. $(eval $(call BuildPackage,ruby-yaml))
  418. $(eval $(call BuildPackage,ruby-zlib))
  419. $(eval $(call HostBuild))