blob: 5e143ee87f15475f075e1389f5c83c240a694c2d [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 Geisslerd1e89492021-02-12 15:35:20 -060011SRC_URI[sha256sum] = "a13ed141a1c18eb967aac1e33f4d6ad5f21be1ac543c344e0d6feeee54af8e28"
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
35do_install() {
36 oe_runmake 'DESTDIR=${D}' install
37}
38
39do_install_append_class-target () {
40 # Find out rbconfig.rb from .installed.list
41 rbconfig_rb=`grep rbconfig.rb ${B}/.installed.list`
42 # Remove build host directories
43 sed -i -e 's:--sysroot=${STAGING_DIR_TARGET}::g' \
44 -e s:'--with-libtool-sysroot=${STAGING_DIR_TARGET}'::g \
45 -e 's|${DEBUG_PREFIX_MAP}||g' \
46 -e 's:${HOSTTOOLS_DIR}/::g' \
47 -e 's:${RECIPE_SYSROOT_NATIVE}::g' \
48 -e 's:${RECIPE_SYSROOT}::g' \
49 -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \
50 ${D}$rbconfig_rb
51}
52
53do_install_ptest () {
54 cp -rf ${S}/test ${D}${PTEST_PATH}/
55
56 install -D ${S}/tool/test/runner.rb ${D}${PTEST_PATH}/tool/test/runner.rb
57 cp -r ${S}/tool/lib ${D}${PTEST_PATH}/tool/
58 mkdir -p ${D}${PTEST_PATH}/lib
59 cp -r ${S}/lib/did_you_mean ${S}/lib/rdoc ${D}${PTEST_PATH}/lib
60
61 # install test-binaries
62 find $(find ./.ext -path '*/-test-') -name '*.so' -print0 \
63 | tar --no-recursion --null -T - --no-same-owner --preserve-permissions -cf - \
64 | tar -C ${D}${libdir}/ruby/${SHRT_VER}.0/ --no-same-owner --preserve-permissions --strip-components=2 -xf -
65 # adjust path to not assume build directory layout
66 sed -e 's|File.expand_path(.*\.\./bin/erb[^)]*|File.expand_path("${bindir}/erb"|g' \
67 -i ${D}${PTEST_PATH}/test/erb/test_erb_command.rb
68
69 cp -r ${S}/include ${D}/${libdir}/ruby/
70 test_case_rb=`grep rubygems/test_case.rb ${B}/.installed.list`
71 sed -i -e 's:../../../test/:../../../ptest/test/:g' ${D}/$test_case_rb
72}
73
74PACKAGES =+ "${PN}-ri-docs ${PN}-rdoc"
75
76SUMMARY_${PN}-ri-docs = "ri (Ruby Interactive) documentation for the Ruby standard library"
77RDEPENDS_${PN}-ri-docs = "${PN}"
78FILES_${PN}-ri-docs += "${datadir}/ri"
79
80SUMMARY_${PN}-rdoc = "RDoc documentation generator from Ruby source"
81RDEPENDS_${PN}-rdoc = "${PN}"
82FILES_${PN}-rdoc += "${libdir}/ruby/*/rdoc ${bindir}/rdoc"
83
84FILES_${PN} += "${datadir}/rubygems"
85
86FILES_${PN}-ptest_append_class-target = "\
87 ${libdir}/ruby/include \
88 ${libdir}/ruby/${SHRT_VER}.0/*/-test- \
89"
90
91BBCLASSEXTEND = "native"