540b906a32c0147266870d1f72aacfae0506068e
[pti/rtp.git] / meta-stx / recipes-devtools / ruby / ruby_2.0.0-p648.bb
1 #
2 ## Copyright (C) 2019 Wind River Systems, Inc.
3 #
4 #  Licensed under the Apache License, Version 2.0 (the "License");
5 #  you may not use this file except in compliance with the License.
6 #  You may obtain a copy of the License at
7 #
8 #      http://www.apache.org/licenses/LICENSE-2.0
9 #
10 #  Unless required by applicable law or agreed to in writing, software
11 #  distributed under the License is distributed on an "AS IS" BASIS,
12 #  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 #  See the License for the specific language governing permissions and
14 #  limitations under the License.
15
16 require ruby.inc
17 inherit openssl10
18
19 DEPENDS += " libnsl2"
20
21 # file://ruby-CVE-2017-9226.patch # Not applicable
22 SRC_URI += " \
23            file://ruby-CVE-2017-9228.patch \
24            file://ext.socket.extmk.patch \
25            "
26 #  file://run-ptest 
27
28 SRC_URI[md5sum] = "05db49992d01731fee023cad09bb4e52"
29 SRC_URI[sha256sum] = "8690bd6b4949c333b3919755c4e48885dbfed6fd055fe9ef89930bde0d2376f8"
30
31 # it's unknown to configure script, but then passed to extconf.rb
32 # maybe it's not really needed as we're hardcoding the result with
33 # 0001-socket-extconf-hardcode-wide-getaddr-info-test-outco.patch
34 UNKNOWN_CONFIGURE_WHITELIST += "--enable-wide-getaddrinfo"
35
36 PACKAGECONFIG ??= ""
37
38 PACKAGECONFIG[valgrind] = "--with-valgrind=yes, --with-valgrind=no, valgrind"
39 #PACKAGECONFIG[gmp] = "--with-gmp=yes, --with-gmp=no, gmp"
40
41 EXTRA_AUTORECONF += "--exclude=aclocal"
42
43 #    --disable-versioned-paths 
44 EXTRA_OECONF ?= " "
45 EXTRA_OECONF = "\
46     --disable-install-doc \
47     --disable-rpath \
48     --disable-dtrace \
49     --enable-shared \
50     --enable-load-relative \
51 "
52
53 EXTRA_OEMAKE = " \
54     LIBRUBYARG='-lruby-static' \
55 "
56
57 do_configure_prepend() {
58     cd ${S}
59     rm -rf spec/rubyspec
60     git clone git://github.com/ruby/rubyspec.git spec/rubyspec
61     cd ${B}
62 }
63
64 do_install() {
65     oe_runmake 'DESTDIR=${D}' install
66 }
67
68 do_install_append_class-target () {
69     # Find out rbconfig.rb from .installed.list
70     rbconfig_rb=`grep rbconfig.rb ${B}/.installed.list`
71     # Remove build host directories
72     sed -i -e 's:--sysroot=${STAGING_DIR_TARGET}::g' \
73            -e s:'--with-libtool-sysroot=${STAGING_DIR_TARGET}'::g \
74            -e 's|${DEBUG_PREFIX_MAP}||g' \
75            -e 's:${HOSTTOOLS_DIR}/::g' \
76            -e 's:${RECIPE_SYSROOT_NATIVE}::g' \
77            -e 's:${RECIPE_SYSROOT}::g' \
78            -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \
79         ${D}$rbconfig_rb
80
81 }
82
83 do_install_ptest () {
84     cp -rf ${S}/test ${D}${PTEST_PATH}/
85     cp -r ${S}/include ${D}/${libdir}/ruby/
86     test_case_rb=`grep rubygems/test_case.rb ${B}/.installed.list`
87     sed -i -e 's:../../../test/:../../../ptest/test/:g' ${D}/$test_case_rb
88 }
89
90 FILES_${PN} += "${datadir}/rubygems"
91
92
93 BBCLASSEXTEND = "native nativesdk"
94
95 # INSANE_SKIP_${PN} += "ldflags"