blob: 944cb81c1df947f032bb7894777dec9fe8c1a5a4 [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 \
Andrew Geissler09209ee2020-12-13 08:44:15 -06008 file://0001-template-Makefile.in-do-not-write-host-cross-cc-item.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -05009 "
10
Andrew Geisslerc926e172021-05-07 16:11:35 -050011SRC_URI[sha256sum] = "369825db2199f6aeef16b408df6a04ebaddb664fb9af0ec8c686b0ce7ab77727"
Andrew Geissler82c905d2020-04-13 13:39:40 -050012
13PACKAGECONFIG ??= ""
14PACKAGECONFIG += "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
15
16PACKAGECONFIG[valgrind] = "--with-valgrind=yes, --with-valgrind=no, valgrind"
17PACKAGECONFIG[gmp] = "--with-gmp=yes, --with-gmp=no, gmp"
18PACKAGECONFIG[ipv6] = "--enable-ipv6, --disable-ipv6,"
19
20EXTRA_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
29EXTRA_OECONF_append_libc-musl = "\
30 LIBS='-lucontext' \
31 ac_cv_func_isnan=yes \
32 ac_cv_func_isinf=yes \
33"
34
Andrew Geissler9b4d8b02021-02-19 12:26:16 -060035EXTRA_OECONF_append_libc-musl_riscv64 = "\
36 --with-coroutine=copy \
37"
38EXTRA_OECONF_append_libc-musl_riscv32 = "\
39 --with-coroutine=copy \
40"
41
Andrew Geissler82c905d2020-04-13 13:39:40 -050042do_install() {
43 oe_runmake 'DESTDIR=${D}' install
44}
45
46do_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
60do_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
81PACKAGES =+ "${PN}-ri-docs ${PN}-rdoc"
82
83SUMMARY_${PN}-ri-docs = "ri (Ruby Interactive) documentation for the Ruby standard library"
84RDEPENDS_${PN}-ri-docs = "${PN}"
85FILES_${PN}-ri-docs += "${datadir}/ri"
86
87SUMMARY_${PN}-rdoc = "RDoc documentation generator from Ruby source"
88RDEPENDS_${PN}-rdoc = "${PN}"
89FILES_${PN}-rdoc += "${libdir}/ruby/*/rdoc ${bindir}/rdoc"
90
91FILES_${PN} += "${datadir}/rubygems"
92
93FILES_${PN}-ptest_append_class-target = "\
94 ${libdir}/ruby/include \
95 ${libdir}/ruby/${SHRT_VER}.0/*/-test- \
96"
97
98BBCLASSEXTEND = "native"