Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 1 | require ruby.inc |
| 2 | |
| 3 | DEPENDS_append_libc-musl = " libucontext" |
| 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 \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 9 | " |
| 10 | |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 11 | SRC_URI[sha256sum] = "a13ed141a1c18eb967aac1e33f4d6ad5f21be1ac543c344e0d6feeee54af8e28" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 12 | |
| 13 | PACKAGECONFIG ??= "" |
| 14 | PACKAGECONFIG += "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}" |
| 15 | |
| 16 | PACKAGECONFIG[valgrind] = "--with-valgrind=yes, --with-valgrind=no, valgrind" |
| 17 | PACKAGECONFIG[gmp] = "--with-gmp=yes, --with-gmp=no, gmp" |
| 18 | PACKAGECONFIG[ipv6] = "--enable-ipv6, --disable-ipv6," |
| 19 | |
| 20 | EXTRA_OECONF = "\ |
| 21 | --disable-versioned-paths \ |
| 22 | --disable-rpath \ |
| 23 | --disable-dtrace \ |
| 24 | --enable-shared \ |
| 25 | --enable-load-relative \ |
| 26 | --with-pkg-config=pkg-config \ |
| 27 | " |
| 28 | |
| 29 | EXTRA_OECONF_append_libc-musl = "\ |
| 30 | LIBS='-lucontext' \ |
| 31 | ac_cv_func_isnan=yes \ |
| 32 | ac_cv_func_isinf=yes \ |
| 33 | " |
| 34 | |
Andrew Geissler | 9b4d8b0 | 2021-02-19 12:26:16 -0600 | [diff] [blame] | 35 | EXTRA_OECONF_append_libc-musl_riscv64 = "\ |
| 36 | --with-coroutine=copy \ |
| 37 | " |
| 38 | EXTRA_OECONF_append_libc-musl_riscv32 = "\ |
| 39 | --with-coroutine=copy \ |
| 40 | " |
| 41 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 42 | do_install() { |
| 43 | oe_runmake 'DESTDIR=${D}' install |
| 44 | } |
| 45 | |
| 46 | do_install_append_class-target () { |
| 47 | # Find out rbconfig.rb from .installed.list |
| 48 | rbconfig_rb=`grep rbconfig.rb ${B}/.installed.list` |
| 49 | # Remove build host directories |
| 50 | sed -i -e 's:--sysroot=${STAGING_DIR_TARGET}::g' \ |
| 51 | -e s:'--with-libtool-sysroot=${STAGING_DIR_TARGET}'::g \ |
| 52 | -e 's|${DEBUG_PREFIX_MAP}||g' \ |
| 53 | -e 's:${HOSTTOOLS_DIR}/::g' \ |
| 54 | -e 's:${RECIPE_SYSROOT_NATIVE}::g' \ |
| 55 | -e 's:${RECIPE_SYSROOT}::g' \ |
| 56 | -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \ |
| 57 | ${D}$rbconfig_rb |
| 58 | } |
| 59 | |
| 60 | do_install_ptest () { |
| 61 | cp -rf ${S}/test ${D}${PTEST_PATH}/ |
| 62 | |
| 63 | install -D ${S}/tool/test/runner.rb ${D}${PTEST_PATH}/tool/test/runner.rb |
| 64 | cp -r ${S}/tool/lib ${D}${PTEST_PATH}/tool/ |
| 65 | mkdir -p ${D}${PTEST_PATH}/lib |
| 66 | cp -r ${S}/lib/did_you_mean ${S}/lib/rdoc ${D}${PTEST_PATH}/lib |
| 67 | |
| 68 | # install test-binaries |
| 69 | find $(find ./.ext -path '*/-test-') -name '*.so' -print0 \ |
| 70 | | tar --no-recursion --null -T - --no-same-owner --preserve-permissions -cf - \ |
| 71 | | tar -C ${D}${libdir}/ruby/${SHRT_VER}.0/ --no-same-owner --preserve-permissions --strip-components=2 -xf - |
| 72 | # adjust path to not assume build directory layout |
| 73 | sed -e 's|File.expand_path(.*\.\./bin/erb[^)]*|File.expand_path("${bindir}/erb"|g' \ |
| 74 | -i ${D}${PTEST_PATH}/test/erb/test_erb_command.rb |
| 75 | |
| 76 | cp -r ${S}/include ${D}/${libdir}/ruby/ |
| 77 | test_case_rb=`grep rubygems/test_case.rb ${B}/.installed.list` |
| 78 | sed -i -e 's:../../../test/:../../../ptest/test/:g' ${D}/$test_case_rb |
| 79 | } |
| 80 | |
| 81 | PACKAGES =+ "${PN}-ri-docs ${PN}-rdoc" |
| 82 | |
| 83 | SUMMARY_${PN}-ri-docs = "ri (Ruby Interactive) documentation for the Ruby standard library" |
| 84 | RDEPENDS_${PN}-ri-docs = "${PN}" |
| 85 | FILES_${PN}-ri-docs += "${datadir}/ri" |
| 86 | |
| 87 | SUMMARY_${PN}-rdoc = "RDoc documentation generator from Ruby source" |
| 88 | RDEPENDS_${PN}-rdoc = "${PN}" |
| 89 | FILES_${PN}-rdoc += "${libdir}/ruby/*/rdoc ${bindir}/rdoc" |
| 90 | |
| 91 | FILES_${PN} += "${datadir}/rubygems" |
| 92 | |
| 93 | FILES_${PN}-ptest_append_class-target = "\ |
| 94 | ${libdir}/ruby/include \ |
| 95 | ${libdir}/ruby/${SHRT_VER}.0/*/-test- \ |
| 96 | " |
| 97 | |
| 98 | BBCLASSEXTEND = "native" |