blob: 3dd9fb0a62f5982939ad06c33b52ade4da2964cb [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001require ruby.inc
2
3DEPENDS_append_libc-musl = " libucontext"
4
5SRC_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 Geissler1e34c2d2020-05-29 16:02:59 -050011SRC_URI[md5sum] = "debb9c325bf65021214451660f46e909"
12SRC_URI[sha256sum] = "d418483bdd0000576c1370571121a6eb24582116db0b7bb2005e90e250eae418"
Andrew Geissler82c905d2020-04-13 13:39:40 -050013
14PACKAGECONFIG ??= ""
15PACKAGECONFIG += "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
16
17PACKAGECONFIG[valgrind] = "--with-valgrind=yes, --with-valgrind=no, valgrind"
18PACKAGECONFIG[gmp] = "--with-gmp=yes, --with-gmp=no, gmp"
19PACKAGECONFIG[ipv6] = "--enable-ipv6, --disable-ipv6,"
20
21EXTRA_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
30EXTRA_OECONF_append_libc-musl = "\
31 LIBS='-lucontext' \
32 ac_cv_func_isnan=yes \
33 ac_cv_func_isinf=yes \
34"
35
36do_install() {
37 oe_runmake 'DESTDIR=${D}' install
38}
39
40do_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
54do_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
75PACKAGES =+ "${PN}-ri-docs ${PN}-rdoc"
76
77SUMMARY_${PN}-ri-docs = "ri (Ruby Interactive) documentation for the Ruby standard library"
78RDEPENDS_${PN}-ri-docs = "${PN}"
79FILES_${PN}-ri-docs += "${datadir}/ri"
80
81SUMMARY_${PN}-rdoc = "RDoc documentation generator from Ruby source"
82RDEPENDS_${PN}-rdoc = "${PN}"
83FILES_${PN}-rdoc += "${libdir}/ruby/*/rdoc ${bindir}/rdoc"
84
85FILES_${PN} += "${datadir}/rubygems"
86
87FILES_${PN}-ptest_append_class-target = "\
88 ${libdir}/ruby/include \
89 ${libdir}/ruby/${SHRT_VER}.0/*/-test- \
90"
91
92BBCLASSEXTEND = "native"