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