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