blob: db6d67298596fcd796efbe4365ff21e9c9c9e457 [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 \
Andrew Geissler09209ee2020-12-13 08:44:15 -06009 file://0001-template-Makefile.in-do-not-write-host-cross-cc-item.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -050010 "
11
Andrew Geissler6ce62a22020-11-30 19:58:47 -060012SRC_URI[md5sum] = "2d4a28dcfa38352a627a597f6057c465"
13SRC_URI[sha256sum] = "6e5706d0d4ee4e1e2f883db9d768586b4d06567debea353c796ec45e8321c3d4"
Andrew Geissler82c905d2020-04-13 13:39:40 -050014
15PACKAGECONFIG ??= ""
16PACKAGECONFIG += "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
17
18PACKAGECONFIG[valgrind] = "--with-valgrind=yes, --with-valgrind=no, valgrind"
19PACKAGECONFIG[gmp] = "--with-gmp=yes, --with-gmp=no, gmp"
20PACKAGECONFIG[ipv6] = "--enable-ipv6, --disable-ipv6,"
21
22EXTRA_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
31EXTRA_OECONF_append_libc-musl = "\
32 LIBS='-lucontext' \
33 ac_cv_func_isnan=yes \
34 ac_cv_func_isinf=yes \
35"
36
37do_install() {
38 oe_runmake 'DESTDIR=${D}' install
39}
40
41do_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
55do_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
76PACKAGES =+ "${PN}-ri-docs ${PN}-rdoc"
77
78SUMMARY_${PN}-ri-docs = "ri (Ruby Interactive) documentation for the Ruby standard library"
79RDEPENDS_${PN}-ri-docs = "${PN}"
80FILES_${PN}-ri-docs += "${datadir}/ri"
81
82SUMMARY_${PN}-rdoc = "RDoc documentation generator from Ruby source"
83RDEPENDS_${PN}-rdoc = "${PN}"
84FILES_${PN}-rdoc += "${libdir}/ruby/*/rdoc ${bindir}/rdoc"
85
86FILES_${PN} += "${datadir}/rubygems"
87
88FILES_${PN}-ptest_append_class-target = "\
89 ${libdir}/ruby/include \
90 ${libdir}/ruby/${SHRT_VER}.0/*/-test- \
91"
92
93BBCLASSEXTEND = "native"