Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 1 | require ruby.inc |
| 2 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 3 | DEPENDS:append:libc-musl = " libucontext" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 4 | |
| 5 | SRC_URI += " \ |
| 6 | file://remove_has_include_macros.patch \ |
| 7 | file://run-ptest \ |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 8 | file://0001-template-Makefile.in-do-not-write-host-cross-cc-item.patch \ |
Patrick Williams | 0ca19cc | 2021-08-16 14:03:13 -0500 | [diff] [blame] | 9 | file://0002-template-Makefile.in-filter-out-f-prefix-map.patch \ |
Patrick Williams | 93c203f | 2021-10-06 16:15:23 -0500 | [diff] [blame] | 10 | file://0003-rdoc-build-reproducible-documentation.patch \ |
| 11 | file://0004-lib-mkmf.rb-sort-list-of-object-files-in-generated-M.patch \ |
| 12 | file://0005-Mark-Gemspec-reproducible-change-fixing-784225-too.patch \ |
| 13 | file://0006-Make-gemspecs-reproducible.patch \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 14 | " |
| 15 | |
Andrew Geissler | 5f35090 | 2021-07-23 13:09:54 -0400 | [diff] [blame] | 16 | SRC_URI[sha256sum] = "5085dee0ad9f06996a8acec7ebea4a8735e6fac22f22e2d98c3f2bc3bef7e6f1" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 17 | |
| 18 | PACKAGECONFIG ??= "" |
| 19 | PACKAGECONFIG += "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}" |
| 20 | |
| 21 | PACKAGECONFIG[valgrind] = "--with-valgrind=yes, --with-valgrind=no, valgrind" |
| 22 | PACKAGECONFIG[gmp] = "--with-gmp=yes, --with-gmp=no, gmp" |
| 23 | PACKAGECONFIG[ipv6] = "--enable-ipv6, --disable-ipv6," |
| 24 | |
| 25 | EXTRA_OECONF = "\ |
| 26 | --disable-versioned-paths \ |
| 27 | --disable-rpath \ |
| 28 | --disable-dtrace \ |
| 29 | --enable-shared \ |
| 30 | --enable-load-relative \ |
| 31 | --with-pkg-config=pkg-config \ |
| 32 | " |
| 33 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 34 | EXTRA_OECONF:append:libc-musl = "\ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 35 | LIBS='-lucontext' \ |
| 36 | ac_cv_func_isnan=yes \ |
| 37 | ac_cv_func_isinf=yes \ |
| 38 | " |
| 39 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 40 | EXTRA_OECONF:append:libc-musl:riscv64 = "\ |
Andrew Geissler | 9b4d8b0 | 2021-02-19 12:26:16 -0600 | [diff] [blame] | 41 | --with-coroutine=copy \ |
| 42 | " |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 43 | EXTRA_OECONF:append:libc-musl:riscv32 = "\ |
Andrew Geissler | 9b4d8b0 | 2021-02-19 12:26:16 -0600 | [diff] [blame] | 44 | --with-coroutine=copy \ |
| 45 | " |
| 46 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 47 | do_install() { |
| 48 | oe_runmake 'DESTDIR=${D}' install |
| 49 | } |
| 50 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 51 | do_install:append:class-target () { |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 52 | # Find out rbconfig.rb from .installed.list |
| 53 | rbconfig_rb=`grep rbconfig.rb ${B}/.installed.list` |
| 54 | # Remove build host directories |
| 55 | sed -i -e 's:--sysroot=${STAGING_DIR_TARGET}::g' \ |
| 56 | -e s:'--with-libtool-sysroot=${STAGING_DIR_TARGET}'::g \ |
| 57 | -e 's|${DEBUG_PREFIX_MAP}||g' \ |
| 58 | -e 's:${HOSTTOOLS_DIR}/::g' \ |
| 59 | -e 's:${RECIPE_SYSROOT_NATIVE}::g' \ |
| 60 | -e 's:${RECIPE_SYSROOT}::g' \ |
| 61 | -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \ |
| 62 | ${D}$rbconfig_rb |
Patrick Williams | 0ca19cc | 2021-08-16 14:03:13 -0500 | [diff] [blame] | 63 | |
| 64 | sed -i -e 's|${DEBUG_PREFIX_MAP}||g' \ |
| 65 | ${D}${libdir}/pkgconfig/*.pc |
| 66 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 67 | } |
| 68 | |
| 69 | do_install_ptest () { |
| 70 | cp -rf ${S}/test ${D}${PTEST_PATH}/ |
| 71 | |
| 72 | install -D ${S}/tool/test/runner.rb ${D}${PTEST_PATH}/tool/test/runner.rb |
| 73 | cp -r ${S}/tool/lib ${D}${PTEST_PATH}/tool/ |
| 74 | mkdir -p ${D}${PTEST_PATH}/lib |
| 75 | cp -r ${S}/lib/did_you_mean ${S}/lib/rdoc ${D}${PTEST_PATH}/lib |
| 76 | |
| 77 | # install test-binaries |
| 78 | find $(find ./.ext -path '*/-test-') -name '*.so' -print0 \ |
| 79 | | tar --no-recursion --null -T - --no-same-owner --preserve-permissions -cf - \ |
| 80 | | tar -C ${D}${libdir}/ruby/${SHRT_VER}.0/ --no-same-owner --preserve-permissions --strip-components=2 -xf - |
| 81 | # adjust path to not assume build directory layout |
| 82 | sed -e 's|File.expand_path(.*\.\./bin/erb[^)]*|File.expand_path("${bindir}/erb"|g' \ |
| 83 | -i ${D}${PTEST_PATH}/test/erb/test_erb_command.rb |
| 84 | |
| 85 | cp -r ${S}/include ${D}/${libdir}/ruby/ |
| 86 | test_case_rb=`grep rubygems/test_case.rb ${B}/.installed.list` |
| 87 | sed -i -e 's:../../../test/:../../../ptest/test/:g' ${D}/$test_case_rb |
| 88 | } |
| 89 | |
| 90 | PACKAGES =+ "${PN}-ri-docs ${PN}-rdoc" |
| 91 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 92 | SUMMARY:${PN}-ri-docs = "ri (Ruby Interactive) documentation for the Ruby standard library" |
| 93 | RDEPENDS:${PN}-ri-docs = "${PN}" |
| 94 | FILES:${PN}-ri-docs += "${datadir}/ri" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 95 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 96 | SUMMARY:${PN}-rdoc = "RDoc documentation generator from Ruby source" |
| 97 | RDEPENDS:${PN}-rdoc = "${PN}" |
| 98 | FILES:${PN}-rdoc += "${libdir}/ruby/*/rdoc ${bindir}/rdoc" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 99 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 100 | FILES:${PN} += "${datadir}/rubygems" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 101 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 102 | FILES:${PN}-ptest:append:class-target = "\ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 103 | ${libdir}/ruby/include \ |
| 104 | ${libdir}/ruby/${SHRT_VER}.0/*/-test- \ |
| 105 | " |
| 106 | |
| 107 | BBCLASSEXTEND = "native" |