ruby_3.4.3.bb 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. SUMMARY = "An interpreter of object-oriented scripting language"
  2. DESCRIPTION = "Ruby is an interpreted scripting language for quick \
  3. and easy object-oriented programming. It has many features to process \
  4. text files and to do system management tasks (as in Perl). \
  5. It is simple, straight-forward, and extensible. \
  6. "
  7. HOMEPAGE = "http://www.ruby-lang.org/"
  8. SECTION = "devel/ruby"
  9. LICENSE = "Ruby | BSD-2-Clause | BSD-3-Clause | GPL-2.0-only | ISC | MIT"
  10. LIC_FILES_CHKSUM = "file://COPYING;md5=5b8c87559868796979806100db3f3805 \
  11. file://BSDL;md5=8b50bc6de8f586dc66790ba11d064d75 \
  12. file://GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
  13. file://LEGAL;md5=cb14358b7821c054ae14128885170204 \
  14. "
  15. DEPENDS = "zlib openssl libyaml libffi"
  16. DEPENDS:append:class-target = " ruby-native"
  17. DEPENDS:append:class-nativesdk = " ruby-native"
  18. SHRT_VER = "${@oe.utils.trim_version("${PV}", 2)}"
  19. SRC_URI = "http://cache.ruby-lang.org/pub/ruby/${SHRT_VER}/ruby-${PV}.tar.gz \
  20. file://0001-extmk-fix-cross-compilation-of-external-gems.patch \
  21. file://0002-Obey-LDFLAGS-for-the-link-of-libruby.patch \
  22. file://run-ptest \
  23. file://0003-rdoc-build-reproducible-documentation.patch \
  24. file://0004-lib-mkmf.rb-sort-list-of-object-files-in-generated-M.patch \
  25. file://0005-Mark-Gemspec-reproducible-change-fixing-784225-too.patch \
  26. file://0006-Make-gemspecs-reproducible.patch \
  27. file://0001-vm_dump.c-Define-REG_S1-and-REG_S2-for-musl-riscv.patch \
  28. "
  29. UPSTREAM_CHECK_URI = "https://www.ruby-lang.org/en/downloads/"
  30. inherit autotools ptest pkgconfig
  31. EXTRA_AUTORECONF += "--exclude=aclocal"
  32. # This snippet lets compiled extensions which rely on external libraries,
  33. # such as zlib, compile properly. If we don't do this, then when extmk.rb
  34. # runs, it uses the native libraries instead of the target libraries, and so
  35. # none of the linking operations succeed -- which makes extconf.rb think
  36. # that the libraries aren't available and hence that the extension can't be
  37. # built.
  38. do_configure:prepend() {
  39. sed -i "s#%%TARGET_CFLAGS%%#$CFLAGS#; s#%%TARGET_LDFLAGS%%#$LDFLAGS#" ${S}/common.mk
  40. rm -rf ${S}/ruby/
  41. }
  42. DEPENDS:append:libc-musl = " libucontext"
  43. SRC_URI[sha256sum] = "55a4cd1dcbe5ca27cf65e89a935a482c2bb2284832939266551c0ec68b437f46"
  44. PACKAGECONFIG ??= ""
  45. PACKAGECONFIG += "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
  46. PACKAGECONFIG[valgrind] = "--with-valgrind=yes, --with-valgrind=no, valgrind"
  47. PACKAGECONFIG[gmp] = "--with-gmp=yes, --with-gmp=no, gmp"
  48. PACKAGECONFIG[ipv6] = "--enable-ipv6, --disable-ipv6,"
  49. # rdoc is off by default due to non-reproducibility reported in
  50. # https://bugs.ruby-lang.org/issues/18456
  51. PACKAGECONFIG[rdoc] = "--enable-install-rdoc,--disable-install-rdoc,"
  52. EXTRA_OECONF = "\
  53. --disable-versioned-paths \
  54. --disable-rpath \
  55. --disable-dtrace \
  56. --enable-shared \
  57. --enable-load-relative \
  58. --with-pkg-config=pkg-config \
  59. --with-static-linked-ext \
  60. --with-mantype=man \
  61. "
  62. EXTRA_OECONF:append:libc-musl = "\
  63. ac_cv_func_isnan=yes \
  64. ac_cv_func_isinf=yes \
  65. "
  66. PARALLEL_MAKEINST = ""
  67. do_install:append:class-target () {
  68. rbconfig_rb=`find ${D} -name rbconfig.rb`
  69. # Remove build host directories
  70. sed -i -e 's:--sysroot=${STAGING_DIR_TARGET}::g' \
  71. -e s:'--with-libtool-sysroot=${STAGING_DIR_TARGET}'::g \
  72. -e 's|${DEBUG_PREFIX_MAP}||g' \
  73. -e 's:${HOSTTOOLS_DIR}/::g' \
  74. -e 's:${RECIPE_SYSROOT_NATIVE}::g' \
  75. -e 's:${RECIPE_SYSROOT}::g' \
  76. -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \
  77. $rbconfig_rb
  78. sed -i -e 's|${DEBUG_PREFIX_MAP}||g' \
  79. ${D}${libdir}/pkgconfig/*.pc
  80. # logs that may contain host-specific paths
  81. find ${D} -name gem_make.out -delete
  82. }
  83. do_install_ptest () {
  84. cp -rf ${S}/test ${D}${PTEST_PATH}/
  85. install -D ${S}/tool/test/init.rb ${D}${PTEST_PATH}/tool/test/init.rb
  86. install -D ${S}/tool/test/runner.rb ${D}${PTEST_PATH}/tool/test/runner.rb
  87. cp -r ${S}/tool/lib ${D}${PTEST_PATH}/tool/
  88. mkdir -p ${D}${PTEST_PATH}/lib
  89. cp -r ${S}/lib/did_you_mean ${S}/lib/rdoc ${D}${PTEST_PATH}/lib
  90. # install test-binaries
  91. # These .so files have sporadic reproducibility fails as seen here:
  92. # https://autobuilder.yocto.io/pub/repro-fail/oe-reproducible-20220107-rm1diuww/packages/diff-html/
  93. # As they are needed only in ruby-ptest, and that is currently altogether disabled, let's take them out.
  94. # If someone wants to look at where the non-determinism comes from, one possible reason is use of
  95. # -rdynamic -Wl,-export-dynamic
  96. #find $(find ./.ext -path '*/-test-') -name '*.so' -print0 \
  97. # | tar --no-recursion --null -T - --no-same-owner --preserve-permissions -cf - \
  98. # | tar -C ${D}${libdir}/ruby/${SHRT_VER}.0/ --no-same-owner --preserve-permissions --strip-components=2 -xf -
  99. # adjust path to not assume build directory layout
  100. sed -e 's|File.expand_path(.*\.\./bin/erb[^)]*|File.expand_path("${bindir}/erb"|g' \
  101. -i ${D}${PTEST_PATH}/test/erb/test_erb_command.rb
  102. cp -r ${S}/include ${D}/${libdir}/ruby/
  103. }
  104. PACKAGES =+ "${PN}-ri-docs ${PN}-rdoc"
  105. SUMMARY:${PN}-ri-docs = "ri (Ruby Interactive) documentation for the Ruby standard library"
  106. RDEPENDS:${PN}-ri-docs = "${PN}"
  107. FILES:${PN}-ri-docs += "${datadir}/ri"
  108. SUMMARY:${PN}-rdoc = "RDoc documentation generator from Ruby source"
  109. RDEPENDS:${PN}-rdoc = "${PN}"
  110. FILES:${PN}-rdoc += "${libdir}/ruby/*/rdoc ${bindir}/rdoc"
  111. FILES:${PN} += "${datadir}/rubygems"
  112. FILES:${PN}-ptest:append:class-target = "\
  113. ${libdir}/ruby/include \
  114. ${libdir}/ruby/${SHRT_VER}.0/*/-test- \
  115. "
  116. BBCLASSEXTEND = "native nativesdk"