blob: 8ad59a7657f7ca6391d61fa84a7e231f00f3adce [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001require ruby.inc
2
3SRC_URI += " \
4 file://ruby-CVE-2017-9226.patch \
5 file://ruby-CVE-2017-9228.patch \
Brad Bishopc342db32019-05-15 21:57:59 -04006 file://run-ptest \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08007 "
8
Brad Bishop96ff1982019-08-19 13:50:42 -04009SRC_URI[md5sum] = "7e156fb526b8f4bb1b30a3dd8a7ce400"
10SRC_URI[sha256sum] = "28a945fdf340e6ba04fc890b98648342e3cccfd6d223a48f3810572f11b2514c"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080011
12# it's unknown to configure script, but then passed to extconf.rb
13# maybe it's not really needed as we're hardcoding the result with
14# 0001-socket-extconf-hardcode-wide-getaddr-info-test-outco.patch
15UNKNOWN_CONFIGURE_WHITELIST += "--enable-wide-getaddrinfo"
16
17PACKAGECONFIG ??= ""
18PACKAGECONFIG += "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
19
20PACKAGECONFIG[valgrind] = "--with-valgrind=yes, --with-valgrind=no, valgrind"
21PACKAGECONFIG[gmp] = "--with-gmp=yes, --with-gmp=no, gmp"
22PACKAGECONFIG[ipv6] = ",--enable-wide-getaddrinfo,"
23
24EXTRA_AUTORECONF += "--exclude=aclocal"
25
26EXTRA_OECONF = "\
27 --disable-versioned-paths \
28 --disable-rpath \
29 --disable-dtrace \
30 --enable-shared \
31 --enable-load-relative \
Brad Bishopc342db32019-05-15 21:57:59 -040032 --with-pkg-config=pkg-config \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080033"
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 # Find out created.rid from .installed.list
53 created_rid=`grep created.rid ${B}/.installed.list`
54 # Remove build host directories
55 sed -i -e 's:${WORKDIR}::g' ${D}$created_rid
56
57}
58
Brad Bishopc342db32019-05-15 21:57:59 -040059do_install_ptest () {
60 cp -rf ${S}/test ${D}${PTEST_PATH}/
61 cp -r ${S}/include ${D}/${libdir}/ruby/
62 test_case_rb=`grep rubygems/test_case.rb ${B}/.installed.list`
63 sed -i -e 's:../../../test/:../../../ptest/test/:g' ${D}/$test_case_rb
64}
65
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080066PACKAGES =+ "${PN}-ri-docs ${PN}-rdoc"
67
68SUMMARY_${PN}-ri-docs = "ri (Ruby Interactive) documentation for the Ruby standard library"
69RDEPENDS_${PN}-ri-docs = "${PN}"
70FILES_${PN}-ri-docs += "${datadir}/ri"
71
72SUMMARY_${PN}-rdoc = "RDoc documentation generator from Ruby source"
73RDEPENDS_${PN}-rdoc = "${PN}"
74FILES_${PN}-rdoc += "${libdir}/ruby/*/rdoc ${bindir}/rdoc"
75
76FILES_${PN} += "${datadir}/rubygems"
77
Brad Bishopc342db32019-05-15 21:57:59 -040078FILES_${PN}-ptest_append_class-target += "${libdir}/ruby/include"
79
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080080BBCLASSEXTEND = "native"