]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/ruby/ruby.mk
ruby: security bump to version 2.4.2
[coffee/buildroot.git] / package / ruby / ruby.mk
1 ################################################################################
2 #
3 # ruby
4 #
5 ################################################################################
6
7 RUBY_VERSION_MAJOR = 2.4
8 RUBY_VERSION = $(RUBY_VERSION_MAJOR).2
9 RUBY_VERSION_EXT = 2.4.0
10 RUBY_SITE = http://cache.ruby-lang.org/pub/ruby/$(RUBY_VERSION_MAJOR)
11 RUBY_SOURCE = ruby-$(RUBY_VERSION).tar.xz
12 RUBY_DEPENDENCIES = host-pkgconf host-ruby
13 HOST_RUBY_DEPENDENCIES = host-pkgconf
14 RUBY_MAKE_ENV = $(TARGET_MAKE_ENV)
15 RUBY_CONF_OPTS = --disable-install-doc --disable-rpath --disable-rubygems
16 HOST_RUBY_CONF_OPTS = \
17         --disable-install-doc \
18         --with-out-ext=curses,openssl,readline \
19         --without-gmp
20 RUBY_LICENSE = Ruby or BSD-2-Clause, BSD-3-Clause, others
21 RUBY_LICENSE_FILES = LEGAL COPYING BSDL
22
23 RUBY_CFLAGS = $(TARGET_CFLAGS)
24 # With some SuperH toolchains (like Sourcery CodeBench 2012.09), ruby fails to
25 # build with 'pcrel too far'. This seems to be caused by the -Os option we pass
26 # by default. To fix the problem, use standard -O2 optimization instead.
27 ifeq ($(BR2_sh),y)
28 RUBY_CFLAGS += -O2
29 endif
30 RUBY_CONF_ENV = CFLAGS="$(RUBY_CFLAGS)"
31
32 ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y)
33 # On uClibc, finite, isinf and isnan are not directly implemented as
34 # functions.  Instead math.h #define's these to __finite, __isinf and
35 # __isnan, confusing the Ruby configure script. Tell it that they
36 # really are available.
37 RUBY_CONF_ENV += \
38         ac_cv_func_finite=yes \
39         ac_cv_func_isinf=yes \
40         ac_cv_func_isnan=yes
41 endif
42
43 ifeq ($(BR2_bfin),y)
44 RUBY_CONF_ENV += ac_cv_func_dl_iterate_phdr=no
45 # Blackfin doesn't have FFI closure support, needed by the fiddle
46 # extension.
47 RUBY_CONF_OPTS += --with-out-ext=fiddle
48 endif
49
50 ifeq ($(BR2_TOOLCHAIN_HAS_SSP),)
51 RUBY_CONF_ENV += stack_protector=no
52 endif
53
54 # Force optionals to build before we do
55 ifeq ($(BR2_PACKAGE_BERKELEYDB),y)
56 RUBY_DEPENDENCIES += berkeleydb
57 endif
58 ifeq ($(BR2_PACKAGE_GDBM),y)
59 RUBY_DEPENDENCIES += gdbm
60 endif
61 ifeq ($(BR2_PACKAGE_LIBYAML),y)
62 RUBY_DEPENDENCIES += libyaml
63 endif
64 ifeq ($(BR2_PACKAGE_NCURSES),y)
65 RUBY_DEPENDENCIES += ncurses
66 endif
67 ifeq ($(BR2_PACKAGE_OPENSSL),y)
68 RUBY_DEPENDENCIES += openssl
69 endif
70 ifeq ($(BR2_PACKAGE_READLINE),y)
71 RUBY_DEPENDENCIES += readline
72 endif
73 ifeq ($(BR2_PACKAGE_ZLIB),y)
74 RUBY_DEPENDENCIES += zlib
75 endif
76 ifeq ($(BR2_PACKAGE_GMP),y)
77 RUBY_DEPENDENCIES += gmp
78 RUBY_CONF_OPTS += --with-gmp
79 else
80 RUBY_CONF_OPTS += --without-gmp
81 endif
82
83 # workaround for amazing build failure, see
84 # http://lists.busybox.net/pipermail/buildroot/2014-December/114273.html
85 define RUBY_REMOVE_VERCONF_H
86         rm -f $(@D)/verconf.h
87 endef
88 RUBY_POST_CONFIGURE_HOOKS += RUBY_REMOVE_VERCONF_H
89
90 # Remove rubygems and friends, as they need extensions that aren't
91 # built and a target compiler.
92 RUBY_EXTENSIONS_REMOVE = rake* rdoc* rubygems*
93 define RUBY_REMOVE_RUBYGEMS
94         rm -f $(addprefix $(TARGET_DIR)/usr/bin/, gem rdoc ri rake)
95         rm -rf $(TARGET_DIR)/usr/lib/ruby/gems
96         rm -rf $(addprefix $(TARGET_DIR)/usr/lib/ruby/$(RUBY_VERSION_EXT)/, \
97                 $(RUBY_EXTENSIONS_REMOVE))
98 endef
99 RUBY_POST_INSTALL_TARGET_HOOKS += RUBY_REMOVE_RUBYGEMS
100
101 $(eval $(autotools-package))
102 $(eval $(host-autotools-package))