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