ruby.mk 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. ################################################################################
  2. #
  3. # ruby
  4. #
  5. ################################################################################
  6. RUBY_VERSION_MAJOR = 2.7
  7. RUBY_VERSION = $(RUBY_VERSION_MAJOR).2
  8. RUBY_VERSION_EXT = 2.7.0
  9. RUBY_SITE = http://cache.ruby-lang.org/pub/ruby/$(RUBY_VERSION_MAJOR)
  10. RUBY_SOURCE = ruby-$(RUBY_VERSION).tar.xz
  11. RUBY_DEPENDENCIES = host-pkgconf host-ruby
  12. HOST_RUBY_DEPENDENCIES = host-pkgconf host-openssl
  13. RUBY_MAKE_ENV = $(TARGET_MAKE_ENV)
  14. RUBY_CONF_OPTS = --disable-install-doc --disable-rpath --disable-rubygems
  15. HOST_RUBY_CONF_OPTS = \
  16. --disable-install-doc \
  17. --with-out-ext=curses,readline \
  18. --without-gmp
  19. RUBY_LICENSE = Ruby or BSD-2-Clause, BSD-3-Clause, others
  20. RUBY_LICENSE_FILES = LEGAL COPYING BSDL
  21. # 0001-fix-default-coroutine-selection.patch
  22. RUBY_AUTORECONF = YES
  23. ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y)
  24. # On uClibc, finite, isinf and isnan are not directly implemented as
  25. # functions. Instead math.h #define's these to __finite, __isinf and
  26. # __isnan, confusing the Ruby configure script. Tell it that they
  27. # really are available.
  28. RUBY_CONF_ENV += \
  29. ac_cv_func_finite=yes \
  30. ac_cv_func_isinf=yes \
  31. ac_cv_func_isnan=yes
  32. endif
  33. ifeq ($(BR2_TOOLCHAIN_HAS_SSP),)
  34. RUBY_CONF_ENV += stack_protector=no
  35. endif
  36. # Force optionals to build before we do
  37. ifeq ($(BR2_PACKAGE_BERKELEYDB),y)
  38. RUBY_DEPENDENCIES += berkeleydb
  39. endif
  40. ifeq ($(BR2_PACKAGE_LIBFFI),y)
  41. RUBY_DEPENDENCIES += libffi
  42. else
  43. # Disable fiddle to avoid a build failure with bundled-libffi on MIPS
  44. RUBY_CONF_OPTS += --with-out-ext=fiddle
  45. endif
  46. ifeq ($(BR2_PACKAGE_GDBM),y)
  47. RUBY_DEPENDENCIES += gdbm
  48. endif
  49. ifeq ($(BR2_PACKAGE_LIBYAML),y)
  50. RUBY_DEPENDENCIES += libyaml
  51. endif
  52. ifeq ($(BR2_PACKAGE_NCURSES),y)
  53. RUBY_DEPENDENCIES += ncurses
  54. endif
  55. ifeq ($(BR2_PACKAGE_OPENSSL),y)
  56. RUBY_DEPENDENCIES += openssl
  57. endif
  58. ifeq ($(BR2_PACKAGE_READLINE),y)
  59. RUBY_DEPENDENCIES += readline
  60. endif
  61. ifeq ($(BR2_PACKAGE_ZLIB),y)
  62. RUBY_DEPENDENCIES += zlib
  63. endif
  64. ifeq ($(BR2_PACKAGE_GMP),y)
  65. RUBY_DEPENDENCIES += gmp
  66. RUBY_CONF_OPTS += --with-gmp
  67. else
  68. RUBY_CONF_OPTS += --without-gmp
  69. endif
  70. # Remove rubygems and friends, as they need extensions that aren't
  71. # built and a target compiler.
  72. RUBY_EXTENSIONS_REMOVE = rake* rdoc* rubygems*
  73. define RUBY_REMOVE_RUBYGEMS
  74. rm -f $(addprefix $(TARGET_DIR)/usr/bin/, gem rdoc ri rake)
  75. rm -rf $(TARGET_DIR)/usr/lib/ruby/gems
  76. rm -rf $(addprefix $(TARGET_DIR)/usr/lib/ruby/$(RUBY_VERSION_EXT)/, \
  77. $(RUBY_EXTENSIONS_REMOVE))
  78. endef
  79. RUBY_POST_INSTALL_TARGET_HOOKS += RUBY_REMOVE_RUBYGEMS
  80. $(eval $(autotools-package))
  81. $(eval $(host-autotools-package))