blob: 1828f65d51062cc68d3231d91eae0d62a3b412bd [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001require ruby.inc
2
3SRC_URI += " \
Brad Bishop64c979e2019-11-04 13:55:29 -05004 file://0003-configure.ac-check-finite-isinf-isnan-as-macros-firs.patch \
Brad Bishopc342db32019-05-15 21:57:59 -04005 file://run-ptest \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08006 "
7
Brad Bishop1d80a2e2019-11-15 16:35:03 -05008SRC_URI[md5sum] = "8754bfb36d52c2bf1fb3d3ddc7101606"
9SRC_URI[sha256sum] = "66976b716ecc1fd34f9b7c3c2b07bbd37631815377a2e3e85a5b194cfdcbed7d"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080010
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080011PACKAGECONFIG ??= ""
12PACKAGECONFIG += "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
13
14PACKAGECONFIG[valgrind] = "--with-valgrind=yes, --with-valgrind=no, valgrind"
15PACKAGECONFIG[gmp] = "--with-gmp=yes, --with-gmp=no, gmp"
Brad Bishop00e122a2019-10-05 11:10:57 -040016PACKAGECONFIG[ipv6] = "--enable-ipv6, --disable-ipv6,"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080017
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080018EXTRA_OECONF = "\
19 --disable-versioned-paths \
20 --disable-rpath \
21 --disable-dtrace \
22 --enable-shared \
23 --enable-load-relative \
Brad Bishopc342db32019-05-15 21:57:59 -040024 --with-pkg-config=pkg-config \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080025"
26
27do_install() {
28 oe_runmake 'DESTDIR=${D}' install
29}
30
31do_install_append_class-target () {
32 # Find out rbconfig.rb from .installed.list
33 rbconfig_rb=`grep rbconfig.rb ${B}/.installed.list`
34 # Remove build host directories
35 sed -i -e 's:--sysroot=${STAGING_DIR_TARGET}::g' \
36 -e s:'--with-libtool-sysroot=${STAGING_DIR_TARGET}'::g \
37 -e 's|${DEBUG_PREFIX_MAP}||g' \
38 -e 's:${HOSTTOOLS_DIR}/::g' \
39 -e 's:${RECIPE_SYSROOT_NATIVE}::g' \
40 -e 's:${RECIPE_SYSROOT}::g' \
41 -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \
42 ${D}$rbconfig_rb
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080043}
44
Brad Bishopc342db32019-05-15 21:57:59 -040045do_install_ptest () {
46 cp -rf ${S}/test ${D}${PTEST_PATH}/
Brad Bishop64c979e2019-11-04 13:55:29 -050047 # install test-binaries
48 find $(find ./.ext -path '*/-test-') -name '*.so' -print0 \
49 | tar --no-recursion --null -T - --no-same-owner --preserve-permissions -cf - \
50 | tar -C ${D}${libdir}/ruby/${SHRT_VER}.0/ --no-same-owner --preserve-permissions --strip-components=2 -xf -
51 # adjust path to not assume build directory layout
52 sed -e 's|File.expand_path(.*\.\./bin/erb[^)]*|File.expand_path("${bindir}/erb"|g' \
53 -i ${D}${PTEST_PATH}/test/erb/test_erb_command.rb
54
Brad Bishopc342db32019-05-15 21:57:59 -040055 cp -r ${S}/include ${D}/${libdir}/ruby/
56 test_case_rb=`grep rubygems/test_case.rb ${B}/.installed.list`
57 sed -i -e 's:../../../test/:../../../ptest/test/:g' ${D}/$test_case_rb
58}
59
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080060PACKAGES =+ "${PN}-ri-docs ${PN}-rdoc"
61
62SUMMARY_${PN}-ri-docs = "ri (Ruby Interactive) documentation for the Ruby standard library"
63RDEPENDS_${PN}-ri-docs = "${PN}"
64FILES_${PN}-ri-docs += "${datadir}/ri"
65
66SUMMARY_${PN}-rdoc = "RDoc documentation generator from Ruby source"
67RDEPENDS_${PN}-rdoc = "${PN}"
68FILES_${PN}-rdoc += "${libdir}/ruby/*/rdoc ${bindir}/rdoc"
69
70FILES_${PN} += "${datadir}/rubygems"
71
Brad Bishop64c979e2019-11-04 13:55:29 -050072FILES_${PN}-ptest_append_class-target = "\
73 ${libdir}/ruby/include \
74 ${libdir}/ruby/${SHRT_VER}.0/*/-test- \
75"
Brad Bishopc342db32019-05-15 21:57:59 -040076
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080077BBCLASSEXTEND = "native"