blob: 38e594a59ef3680819f96a1badd0007303e23e32 [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001require ruby.inc
2
Patrick Williams213cb262021-08-07 19:21:33 -05003DEPENDS:append:libc-musl = " libucontext"
Andrew Geissler82c905d2020-04-13 13:39:40 -05004
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 \
Patrick Williams0ca19cc2021-08-16 14:03:13 -05009 file://0002-template-Makefile.in-filter-out-f-prefix-map.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -050010 "
11
Andrew Geissler5f350902021-07-23 13:09:54 -040012SRC_URI[sha256sum] = "5085dee0ad9f06996a8acec7ebea4a8735e6fac22f22e2d98c3f2bc3bef7e6f1"
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
Patrick Williams213cb262021-08-07 19:21:33 -050030EXTRA_OECONF:append:libc-musl = "\
Andrew Geissler82c905d2020-04-13 13:39:40 -050031 LIBS='-lucontext' \
32 ac_cv_func_isnan=yes \
33 ac_cv_func_isinf=yes \
34"
35
Patrick Williams213cb262021-08-07 19:21:33 -050036EXTRA_OECONF:append:libc-musl:riscv64 = "\
Andrew Geissler9b4d8b02021-02-19 12:26:16 -060037 --with-coroutine=copy \
38"
Patrick Williams213cb262021-08-07 19:21:33 -050039EXTRA_OECONF:append:libc-musl:riscv32 = "\
Andrew Geissler9b4d8b02021-02-19 12:26:16 -060040 --with-coroutine=copy \
41"
42
Andrew Geissler82c905d2020-04-13 13:39:40 -050043do_install() {
44 oe_runmake 'DESTDIR=${D}' install
45}
46
Patrick Williams213cb262021-08-07 19:21:33 -050047do_install:append:class-target () {
Andrew Geissler82c905d2020-04-13 13:39:40 -050048 # Find out rbconfig.rb from .installed.list
49 rbconfig_rb=`grep rbconfig.rb ${B}/.installed.list`
50 # Remove build host directories
51 sed -i -e 's:--sysroot=${STAGING_DIR_TARGET}::g' \
52 -e s:'--with-libtool-sysroot=${STAGING_DIR_TARGET}'::g \
53 -e 's|${DEBUG_PREFIX_MAP}||g' \
54 -e 's:${HOSTTOOLS_DIR}/::g' \
55 -e 's:${RECIPE_SYSROOT_NATIVE}::g' \
56 -e 's:${RECIPE_SYSROOT}::g' \
57 -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \
58 ${D}$rbconfig_rb
Patrick Williams0ca19cc2021-08-16 14:03:13 -050059
60 sed -i -e 's|${DEBUG_PREFIX_MAP}||g' \
61 ${D}${libdir}/pkgconfig/*.pc
62
Andrew Geissler82c905d2020-04-13 13:39:40 -050063}
64
65do_install_ptest () {
66 cp -rf ${S}/test ${D}${PTEST_PATH}/
67
68 install -D ${S}/tool/test/runner.rb ${D}${PTEST_PATH}/tool/test/runner.rb
69 cp -r ${S}/tool/lib ${D}${PTEST_PATH}/tool/
70 mkdir -p ${D}${PTEST_PATH}/lib
71 cp -r ${S}/lib/did_you_mean ${S}/lib/rdoc ${D}${PTEST_PATH}/lib
72
73 # install test-binaries
74 find $(find ./.ext -path '*/-test-') -name '*.so' -print0 \
75 | tar --no-recursion --null -T - --no-same-owner --preserve-permissions -cf - \
76 | tar -C ${D}${libdir}/ruby/${SHRT_VER}.0/ --no-same-owner --preserve-permissions --strip-components=2 -xf -
77 # adjust path to not assume build directory layout
78 sed -e 's|File.expand_path(.*\.\./bin/erb[^)]*|File.expand_path("${bindir}/erb"|g' \
79 -i ${D}${PTEST_PATH}/test/erb/test_erb_command.rb
80
81 cp -r ${S}/include ${D}/${libdir}/ruby/
82 test_case_rb=`grep rubygems/test_case.rb ${B}/.installed.list`
83 sed -i -e 's:../../../test/:../../../ptest/test/:g' ${D}/$test_case_rb
84}
85
86PACKAGES =+ "${PN}-ri-docs ${PN}-rdoc"
87
Patrick Williams213cb262021-08-07 19:21:33 -050088SUMMARY:${PN}-ri-docs = "ri (Ruby Interactive) documentation for the Ruby standard library"
89RDEPENDS:${PN}-ri-docs = "${PN}"
90FILES:${PN}-ri-docs += "${datadir}/ri"
Andrew Geissler82c905d2020-04-13 13:39:40 -050091
Patrick Williams213cb262021-08-07 19:21:33 -050092SUMMARY:${PN}-rdoc = "RDoc documentation generator from Ruby source"
93RDEPENDS:${PN}-rdoc = "${PN}"
94FILES:${PN}-rdoc += "${libdir}/ruby/*/rdoc ${bindir}/rdoc"
Andrew Geissler82c905d2020-04-13 13:39:40 -050095
Patrick Williams213cb262021-08-07 19:21:33 -050096FILES:${PN} += "${datadir}/rubygems"
Andrew Geissler82c905d2020-04-13 13:39:40 -050097
Patrick Williams213cb262021-08-07 19:21:33 -050098FILES:${PN}-ptest:append:class-target = "\
Andrew Geissler82c905d2020-04-13 13:39:40 -050099 ${libdir}/ruby/include \
100 ${libdir}/ruby/${SHRT_VER}.0/*/-test- \
101"
102
103BBCLASSEXTEND = "native"