summaryrefslogtreecommitdiffstats
path: root/poky/meta/recipes-devtools/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'poky/meta/recipes-devtools/ruby')
-rw-r--r--poky/meta/recipes-devtools/ruby/ruby.inc40
-rw-r--r--poky/meta/recipes-devtools/ruby/ruby/0002-Obey-LDFLAGS-for-the-link-of-libruby.patch25
-rw-r--r--poky/meta/recipes-devtools/ruby/ruby/extmk.patch16
-rw-r--r--poky/meta/recipes-devtools/ruby/ruby/ruby-CVE-2017-9226.patch32
-rw-r--r--poky/meta/recipes-devtools/ruby/ruby/ruby-CVE-2017-9228.patch34
-rw-r--r--poky/meta/recipes-devtools/ruby/ruby_2.5.0.bb49
6 files changed, 196 insertions, 0 deletions
diff --git a/poky/meta/recipes-devtools/ruby/ruby.inc b/poky/meta/recipes-devtools/ruby/ruby.inc
new file mode 100644
index 000000000..fd3911ba7
--- /dev/null
+++ b/poky/meta/recipes-devtools/ruby/ruby.inc
@@ -0,0 +1,40 @@
+SUMMARY = "An interpreter of object-oriented scripting language"
+DESCRIPTION = "Ruby is an interpreted scripting language for quick \
+and easy object-oriented programming. It has many features to process \
+text files and to do system management tasks (as in Perl). \
+It is simple, straight-forward, and extensible. \
+"
+HOMEPAGE = "http://www.ruby-lang.org/"
+SECTION = "devel/ruby"
+LICENSE = "Ruby | BSD | GPLv2"
+LIC_FILES_CHKSUM = "\
+ file://COPYING;md5=340948e1882e579731841bf49cdc22c1 \
+ file://BSDL;md5=19aaf65c88a40b508d17ae4be539c4b5\
+ file://GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263\
+ file://LEGAL;md5=8f871f3f03732c018a5fa9b185958231 \
+"
+
+DEPENDS = "ruby-native zlib openssl tcl libyaml gdbm readline"
+DEPENDS_class-native = "openssl-native libyaml-native"
+
+SHRT_VER = "${@oe.utils.trim_version("${PV}", 2)}"
+SRC_URI = "http://cache.ruby-lang.org/pub/ruby/${SHRT_VER}/ruby-${PV}.tar.gz \
+ file://extmk.patch \
+ file://0002-Obey-LDFLAGS-for-the-link-of-libruby.patch \
+ "
+UPSTREAM_CHECK_URI = "https://www.ruby-lang.org/en/downloads/"
+
+inherit autotools
+
+
+# This snippet lets compiled extensions which rely on external libraries,
+# such as zlib, compile properly. If we don't do this, then when extmk.rb
+# runs, it uses the native libraries instead of the target libraries, and so
+# none of the linking operations succeed -- which makes extconf.rb think
+# that the libraries aren't available and hence that the extension can't be
+# built.
+
+do_configure_prepend() {
+ sed -i "s#%%TARGET_CFLAGS%%#$TARGET_CFLAGS#; s#%%TARGET_LDFLAGS%%#$TARGET_LDFLAGS#" ${S}/common.mk
+ rm -rf ${S}/ruby/
+}
diff --git a/poky/meta/recipes-devtools/ruby/ruby/0002-Obey-LDFLAGS-for-the-link-of-libruby.patch b/poky/meta/recipes-devtools/ruby/ruby/0002-Obey-LDFLAGS-for-the-link-of-libruby.patch
new file mode 100644
index 000000000..4cf579f42
--- /dev/null
+++ b/poky/meta/recipes-devtools/ruby/ruby/0002-Obey-LDFLAGS-for-the-link-of-libruby.patch
@@ -0,0 +1,25 @@
+Upstream-Status: Pending
+
+From 306e95a9818d39d3349075aac9609e062b0f19ce Mon Sep 17 00:00:00 2001
+From: Christopher Larson <chris_larson@mentor.com>
+Date: Thu, 5 May 2016 10:59:07 -0700
+Subject: [PATCH 2/2] Obey LDFLAGS for the link of libruby
+
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+---
+ Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: ruby-2.5.0/Makefile.in
+===================================================================
+--- ruby-2.5.0.orig/Makefile.in
++++ ruby-2.5.0/Makefile.in
+@@ -77,7 +77,7 @@ LIBS = @LIBS@ $(EXTLIBS)
+ MISSING = @LIBOBJS@ @ALLOCA@
+ ENABLE_SHARED = @ENABLE_SHARED@
+ LDSHARED = @LIBRUBY_LDSHARED@
+-DLDFLAGS = @LIBRUBY_DLDFLAGS@ $(XLDFLAGS) $(ARCH_FLAG)
++DLDFLAGS = @LIBRUBY_DLDFLAGS@ @LDFLAGS@ $(XLDFLAGS) $(ARCH_FLAG)
+ SOLIBS = @SOLIBS@
+ ENABLE_DEBUG_ENV = @ENABLE_DEBUG_ENV@
+ MAINLIBS = @MAINLIBS@
diff --git a/poky/meta/recipes-devtools/ruby/ruby/extmk.patch b/poky/meta/recipes-devtools/ruby/ruby/extmk.patch
new file mode 100644
index 000000000..404b9af7a
--- /dev/null
+++ b/poky/meta/recipes-devtools/ruby/ruby/extmk.patch
@@ -0,0 +1,16 @@
+Upstream-Status: Pending
+diff -ru ruby-1.8.7-p248.orig/ext/extmk.rb ruby-1.8.7-p248/ext/extmk.rb
+--- ruby-1.8.7-p248.orig/ext/extmk.rb 2009-12-24 03:01:58.000000000 -0600
++++ ruby-1.8.7-p248/ext/extmk.rb 2010-02-12 15:55:27.370061558 -0600
+@@ -413,8 +413,8 @@ def $mflags.defined?(var)
+ end
+ $ruby = [$ruby]
+ $ruby << "-I'$(topdir)'"
++$ruby << "-I'$(top_srcdir)/lib'"
+ unless CROSS_COMPILING
+- $ruby << "-I'$(top_srcdir)/lib'"
+ $ruby << "-I'$(extout)/$(arch)'" << "-I'$(extout)/common'" if $extout
+ ENV["RUBYLIB"] = "-"
+ end
+--
+
diff --git a/poky/meta/recipes-devtools/ruby/ruby/ruby-CVE-2017-9226.patch b/poky/meta/recipes-devtools/ruby/ruby/ruby-CVE-2017-9226.patch
new file mode 100644
index 000000000..89437bba7
--- /dev/null
+++ b/poky/meta/recipes-devtools/ruby/ruby/ruby-CVE-2017-9226.patch
@@ -0,0 +1,32 @@
+From b4bf968ad52afe14e60a2dc8a95d3555c543353a Mon Sep 17 00:00:00 2001
+From: "K.Kosako" <kosako@sofnec.co.jp>
+Date: Thu, 18 May 2017 17:05:27 +0900
+Subject: [PATCH] fix #55 : check too big code point value for single byte
+ value in next_state_val()
+
+---
+ regparse.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- end of original header
+
+CVE: CVE-2017-9226
+
+Add check for octal number bigger than 255.
+
+Upstream-Status: Pending
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+
+
+--- ruby-2.4.1.orig/regparse.c
++++ ruby-2.4.1/regparse.c
+@@ -4450,6 +4450,9 @@ next_state_val(CClassNode* cc, CClassNod
+ switch (*state) {
+ case CCS_VALUE:
+ if (*type == CCV_SB) {
++ if (*from > 0xff)
++ return ONIGERR_INVALID_CODE_POINT_VALUE;
++
+ BITSET_SET_BIT_CHKDUP(cc->bs, (int )(*from));
+ if (IS_NOT_NULL(asc_cc))
+ BITSET_SET_BIT(asc_cc->bs, (int )(*from));
diff --git a/poky/meta/recipes-devtools/ruby/ruby/ruby-CVE-2017-9228.patch b/poky/meta/recipes-devtools/ruby/ruby/ruby-CVE-2017-9228.patch
new file mode 100644
index 000000000..d8bfba486
--- /dev/null
+++ b/poky/meta/recipes-devtools/ruby/ruby/ruby-CVE-2017-9228.patch
@@ -0,0 +1,34 @@
+From 3b63d12038c8d8fc278e81c942fa9bec7c704c8b Mon Sep 17 00:00:00 2001
+From: "K.Kosako" <kosako@sofnec.co.jp>
+Date: Wed, 24 May 2017 13:43:25 +0900
+Subject: [PATCH] fix #60 : invalid state(CCS_VALUE) in parse_char_class()
+
+---
+ regparse.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- end of original header
+
+CVE: CVE-2017-9228
+
+Upstream-Status: Inappropriate [not author]
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+
+diff --git a/regparse.c b/regparse.c
+index 69875fa..1988747 100644
+--- a/regparse.c
++++ b/regparse.c
+@@ -4081,7 +4081,9 @@ next_state_class(CClassNode* cc, OnigCodePoint* vs, enum CCVALTYPE* type,
+ }
+ }
+
+- *state = CCS_VALUE;
++ if (*state != CCS_START)
++ *state = CCS_VALUE;
++
+ *type = CCV_CLASS;
+ return 0;
+ }
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-devtools/ruby/ruby_2.5.0.bb b/poky/meta/recipes-devtools/ruby/ruby_2.5.0.bb
new file mode 100644
index 000000000..1ac7f2aa5
--- /dev/null
+++ b/poky/meta/recipes-devtools/ruby/ruby_2.5.0.bb
@@ -0,0 +1,49 @@
+require ruby.inc
+
+SRC_URI += " \
+ file://ruby-CVE-2017-9226.patch \
+ file://ruby-CVE-2017-9228.patch \
+ "
+
+SRC_URI[md5sum] = "f4711f856fe14de222b9da3d3b8efa89"
+SRC_URI[sha256sum] = "46e6f3630f1888eb653b15fa811d77b5b1df6fd7a3af436b343cfe4f4503f2ab"
+
+# it's unknown to configure script, but then passed to extconf.rb
+# maybe it's not really needed as we're hardcoding the result with
+# 0001-socket-extconf-hardcode-wide-getaddr-info-test-outco.patch
+UNKNOWN_CONFIGURE_WHITELIST += "--enable-wide-getaddrinfo"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG += "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
+
+PACKAGECONFIG[valgrind] = "--with-valgrind=yes, --with-valgrind=no, valgrind"
+PACKAGECONFIG[gmp] = "--with-gmp=yes, --with-gmp=no, gmp"
+PACKAGECONFIG[ipv6] = ",--enable-wide-getaddrinfo,"
+
+EXTRA_AUTORECONF += "--exclude=aclocal"
+
+EXTRA_OECONF = "\
+ --disable-versioned-paths \
+ --disable-rpath \
+ --disable-dtrace \
+ --enable-shared \
+ --enable-load-relative \
+"
+
+do_install() {
+ oe_runmake 'DESTDIR=${D}' install
+}
+
+PACKAGES =+ "${PN}-ri-docs ${PN}-rdoc"
+
+SUMMARY_${PN}-ri-docs = "ri (Ruby Interactive) documentation for the Ruby standard library"
+RDEPENDS_${PN}-ri-docs = "${PN}"
+FILES_${PN}-ri-docs += "${datadir}/ri"
+
+SUMMARY_${PN}-rdoc = "RDoc documentation generator from Ruby source"
+RDEPENDS_${PN}-rdoc = "${PN}"
+FILES_${PN}-rdoc += "${libdir}/ruby/*/rdoc ${bindir}/rdoc"
+
+FILES_${PN} += "${datadir}/rubygems"
+
+BBCLASSEXTEND = "native"
OpenPOWER on IntegriCloud