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.

487 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
  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. --with-static-linked-ext \
  177. CONFIGURE_ARGS += \
  178. --enable-shared \
  179. --enable-static \
  180. --disable-rpath \
  181. --enable-ipv6 \
  182. --with-ruby-version=minor \
  183. --with-iconv-dir=$(ICONV_PREFIX) \
  184. TARGET_LDFLAGS += -L$(PKG_BUILD_DIR)
  185. MAKE_FLAGS += \
  186. DESTDIR="$(PKG_INSTALL_DIR)" \
  187. SHELL="/bin/bash"
  188. define Package/ruby/install
  189. $(INSTALL_DIR) $(1)/usr/bin
  190. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ruby $(1)/usr/bin/
  191. endef
  192. define Package/libruby/install
  193. $(INSTALL_DIR) $(1)/usr/lib
  194. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libruby.so.* $(1)/usr/lib/
  195. endef
  196. define Package/ruby-core/install
  197. $(INSTALL_DIR) $(1)/usr/lib
  198. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby $(1)/usr/lib/
  199. rm -rf \
  200. $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/curses.so \
  201. \
  202. $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/gdbm.so \
  203. \
  204. $(1)/usr/lib/ruby/$(PKG_LIBVER)/kconv.rb \
  205. $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/nkf.so \
  206. \
  207. $(1)/usr/lib/ruby/$(PKG_LIBVER)/digest \
  208. $(1)/usr/lib/ruby/$(PKG_LIBVER)/digest.rb \
  209. $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/digest \
  210. $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/digest.so \
  211. $(1)/usr/lib/ruby/$(PKG_LIBVER)/openssl \
  212. $(1)/usr/lib/ruby/$(PKG_LIBVER)/openssl.rb \
  213. $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/openssl.so \
  214. $(1)/usr/lib/ruby/$(PKG_LIBVER)/drb/ssl.rb \
  215. $(1)/usr/lib/ruby/$(PKG_LIBVER)/net/https.rb \
  216. $(1)/usr/lib/ruby/$(PKG_LIBVER)/webrick/ssl.rb \
  217. \
  218. $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/dl.so \
  219. \
  220. $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/enc \
  221. \
  222. $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/readline.so \
  223. $(1)/usr/lib/ruby/$(PKG_LIBVER)/irb/completion.rb \
  224. $(1)/usr/lib/ruby/$(PKG_LIBVER)/irb/ext/save-history.rb \
  225. \
  226. $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/zlib.so \
  227. \
  228. $(1)/usr/lib/ruby/$(PKG_LIBVER)/erb.rb \
  229. \
  230. $(1)/usr/lib/ruby/$(PKG_LIBVER)/json.rb \
  231. $(1)/usr/lib/ruby/$(PKG_LIBVER)/json \
  232. $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/json \
  233. \
  234. $(1)/usr/lib/ruby/$(PKG_LIBVER)/irb.rb \
  235. $(1)/usr/lib/ruby/$(PKG_LIBVER)/irb \
  236. \
  237. $(1)/usr/lib/ruby/$(PKG_LIBVER)/rdoc \
  238. \
  239. $(1)/usr/lib/ruby/$(PKG_LIBVER)/rake.rb \
  240. $(1)/usr/lib/ruby/$(PKG_LIBVER)/rake \
  241. \
  242. $(1)/usr/lib/ruby/$(PKG_LIBVER)/rubygems.rb \
  243. $(1)/usr/lib/ruby/$(PKG_LIBVER)/rubygems \
  244. \
  245. $(1)/usr/lib/ruby/$(PKG_LIBVER)/cgi.rb \
  246. $(1)/usr/lib/ruby/$(PKG_LIBVER)/cgi \
  247. \
  248. $(1)/usr/lib/ruby/$(PKG_LIBVER)/rexml \
  249. \
  250. $(1)/usr/lib/ruby/$(PKG_LIBVER)/rss \
  251. $(1)/usr/lib/ruby/$(PKG_LIBVER)/rss.rb \
  252. \
  253. $(1)/usr/lib/ruby/$(PKG_LIBVER)/test \
  254. \
  255. $(1)/usr/lib/ruby/$(PKG_LIBVER)/webrick \
  256. $(1)/usr/lib/ruby/$(PKG_LIBVER)/webrick.rb \
  257. \
  258. $(1)/usr/lib/ruby/$(PKG_LIBVER)/xmlrpc \
  259. \
  260. $(1)/usr/lib/ruby/$(PKG_LIBVER)/yaml \
  261. $(1)/usr/lib/ruby/$(PKG_LIBVER)/yaml.rb \
  262. $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/syck.so \
  263. find $(1) -name '*.h' | xargs rm -f
  264. endef
  265. define Package/ruby-cgi/install
  266. $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
  267. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/cgi $(1)/usr/lib/ruby/$(PKG_LIBVER)/
  268. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/cgi.rb $(1)/usr/lib/ruby/$(PKG_LIBVER)/
  269. endef
  270. define Package/ruby-dl/install
  271. ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
  272. usr/lib/ruby/$(PKG_LIBVER)/*/dl.so \
  273. ) | ( cd $(1); $(TAR) -xf - )
  274. endef
  275. define Package/ruby-enc/install
  276. ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
  277. usr/lib/ruby/$(PKG_LIBVER)/*/enc \
  278. ) | ( cd $(1); $(TAR) -xf - )
  279. endef
  280. define Package/ruby-erb/install
  281. $(INSTALL_DIR) $(1)/usr/bin
  282. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/erb $(1)/usr/bin/
  283. $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)/
  284. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/erb.rb $(1)/usr/lib/ruby/$(PKG_LIBVER)/
  285. endef
  286. define Package/ruby-gdbm/install
  287. ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
  288. usr/lib/ruby/$(PKG_LIBVER)/*/gdbm.so \
  289. ) | ( cd $(1); $(TAR) -xf - )
  290. endef
  291. define Package/ruby-gems/install
  292. $(INSTALL_DIR) $(1)/usr/bin
  293. $(CP) $(PKG_INSTALL_DIR)/usr/bin/gem $(1)/usr/bin/
  294. $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
  295. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/rubygems.rb $(1)/usr/lib/ruby/$(PKG_LIBVER)/
  296. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/rubygems $(1)/usr/lib/ruby/$(PKG_LIBVER)/
  297. endef
  298. define Package/ruby-irb/install
  299. $(INSTALL_DIR) $(1)/usr/bin
  300. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/irb $(1)/usr/bin/
  301. $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
  302. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/irb $(1)/usr/lib/ruby/$(PKG_LIBVER)/
  303. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/irb.rb $(1)/usr/lib/ruby/$(PKG_LIBVER)/
  304. endef
  305. define Package/ruby-json/install
  306. ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
  307. usr/lib/ruby/$(PKG_LIBVER)/json.rb \
  308. usr/lib/ruby/$(PKG_LIBVER)/json \
  309. usr/lib/ruby/$(PKG_LIBVER)/*/json \
  310. ) | ( cd $(1); $(TAR) -xf - )
  311. endef
  312. define Package/ruby-ncurses/install
  313. ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
  314. usr/lib/ruby/$(PKG_LIBVER)/*/curses.so \
  315. ) | ( cd $(1); $(TAR) -xf - )
  316. endef
  317. define Package/ruby-nkf/install
  318. ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
  319. usr/lib/ruby/$(PKG_LIBVER)/kconv.rb \
  320. usr/lib/ruby/$(PKG_LIBVER)/*/nkf.so \
  321. ) | ( cd $(1); $(TAR) -xf - )
  322. endef
  323. define Package/ruby-openssl/install
  324. ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
  325. usr/lib/ruby/$(PKG_LIBVER)/digest \
  326. usr/lib/ruby/$(PKG_LIBVER)/digest.rb \
  327. usr/lib/ruby/$(PKG_LIBVER)/*/digest.so \
  328. usr/lib/ruby/$(PKG_LIBVER)/*/digest/*.so \
  329. usr/lib/ruby/$(PKG_LIBVER)/openssl \
  330. usr/lib/ruby/$(PKG_LIBVER)/openssl.rb \
  331. usr/lib/ruby/$(PKG_LIBVER)/*/openssl.so \
  332. usr/lib/ruby/$(PKG_LIBVER)/drb/ssl.rb \
  333. usr/lib/ruby/$(PKG_LIBVER)/net/https.rb \
  334. ) | ( cd $(1); $(TAR) -xf - )
  335. endef
  336. define Package/ruby-rdoc/install
  337. $(INSTALL_DIR) $(1)/usr/bin
  338. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/rdoc $(1)/usr/bin/
  339. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ri $(1)/usr/bin/
  340. $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
  341. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/rdoc $(1)/usr/lib/ruby/$(PKG_LIBVER)/
  342. endef
  343. define Package/ruby-rake/install
  344. $(INSTALL_DIR) $(1)/usr/bin
  345. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/rake $(1)/usr/bin/
  346. $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
  347. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/rake.rb $(1)/usr/lib/ruby/$(PKG_LIBVER)/
  348. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/rake $(1)/usr/lib/ruby/$(PKG_LIBVER)/
  349. endef
  350. define Package/ruby-readline/install
  351. ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
  352. usr/lib/ruby/$(PKG_LIBVER)/*/readline.so \
  353. ) | ( cd $(1); $(TAR) -xf - )
  354. endef
  355. define Package/ruby-rexml/install
  356. $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
  357. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/rexml $(1)/usr/lib/ruby/$(PKG_LIBVER)/
  358. endef
  359. define Package/ruby-rss/install
  360. $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
  361. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/rss $(1)/usr/lib/ruby/$(PKG_LIBVER)/
  362. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/rss.rb $(1)/usr/lib/ruby/$(PKG_LIBVER)/
  363. endef
  364. define Package/ruby-unit/install
  365. $(INSTALL_DIR) $(1)/usr/bin
  366. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/testrb $(1)/usr/bin/
  367. $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
  368. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/test $(1)/usr/lib/ruby/$(PKG_LIBVER)/
  369. endef
  370. define Package/ruby-webrick/install
  371. $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
  372. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/webrick $(1)/usr/lib/ruby/$(PKG_LIBVER)/
  373. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/webrick.rb $(1)/usr/lib/ruby/$(PKG_LIBVER)/
  374. endef
  375. define Package/ruby-xmlrpc/install
  376. $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
  377. $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/xmlrpc $(1)/usr/lib/ruby/$(PKG_LIBVER)/
  378. endef
  379. define Package/ruby-yaml/install
  380. ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
  381. usr/lib/ruby/$(PKG_LIBVER)/yaml \
  382. usr/lib/ruby/$(PKG_LIBVER)/yaml.rb \
  383. usr/lib/ruby/$(PKG_LIBVER)/*/syck.so \
  384. ) | ( cd $(1); $(TAR) -xf - )
  385. endef
  386. define Package/ruby-zlib/install
  387. ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
  388. usr/lib/ruby/$(PKG_LIBVER)/*/zlib.so \
  389. ) | ( cd $(1); $(TAR) -xf - )
  390. endef
  391. define Build/InstallDev
  392. ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
  393. . \
  394. ) | ( cd $(1); $(TAR) -xf - )
  395. endef
  396. $(eval $(call BuildPackage,ruby))
  397. $(eval $(call BuildPackage,libruby))
  398. $(eval $(call BuildPackage,ruby-core))
  399. $(eval $(call BuildPackage,ruby-cgi))
  400. $(eval $(call BuildPackage,ruby-dl))
  401. $(eval $(call BuildPackage,ruby-enc))
  402. $(eval $(call BuildPackage,ruby-erb))
  403. $(eval $(call BuildPackage,ruby-gdbm))
  404. $(eval $(call BuildPackage,ruby-gems))
  405. $(eval $(call BuildPackage,ruby-json))
  406. $(eval $(call BuildPackage,ruby-irb))
  407. $(eval $(call BuildPackage,ruby-ncurses))
  408. $(eval $(call BuildPackage,ruby-nkf))
  409. $(eval $(call BuildPackage,ruby-openssl))
  410. $(eval $(call BuildPackage,ruby-rake))
  411. $(eval $(call BuildPackage,ruby-rdoc))
  412. $(eval $(call BuildPackage,ruby-readline))
  413. $(eval $(call BuildPackage,ruby-rexml))
  414. $(eval $(call BuildPackage,ruby-rss))
  415. $(eval $(call BuildPackage,ruby-unit))
  416. $(eval $(call BuildPackage,ruby-webrick))
  417. $(eval $(call BuildPackage,ruby-xmlrpc))
  418. $(eval $(call BuildPackage,ruby-yaml))
  419. $(eval $(call BuildPackage,ruby-zlib))
  420. $(eval $(call HostBuild))