diff options
Diffstat (limited to 'meta/recipes-devtools/ruby')
15 files changed, 402 insertions, 238 deletions
diff --git a/meta/recipes-devtools/ruby/ruby.inc b/meta/recipes-devtools/ruby/ruby.inc deleted file mode 100644 index 5a5bef2024..0000000000 --- a/meta/recipes-devtools/ruby/ruby.inc +++ /dev/null @@ -1,40 +0,0 @@ -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=23a79bb4c1a40f6cc9bcb6f4e7c39799 \ -" - -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/meta/recipes-devtools/ruby/ruby/0001-extmk-fix-cross-compilation-of-external-gems.patch b/meta/recipes-devtools/ruby/ruby/0001-extmk-fix-cross-compilation-of-external-gems.patch new file mode 100644 index 0000000000..7402e76333 --- /dev/null +++ b/meta/recipes-devtools/ruby/ruby/0001-extmk-fix-cross-compilation-of-external-gems.patch @@ -0,0 +1,31 @@ +From caa03f46a3204a7e0f0e5d9d9cc9113304dc0382 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <andre.draszik@jci.com> +Date: Mon, 30 Sep 2019 16:57:01 +0100 +Subject: [PATCH] extmk: fix cross-compilation of external gems +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Note that I (André) didn't actually write this patch, I +only updated it so that git-am works. + +Upstream-Status: Pending +Signed-off-by: André Draszik <andre.draszik@jci.com> +--- + ext/extmk.rb | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ext/extmk.rb b/ext/extmk.rb +index 428ffc9..87eff71 100755 +--- a/ext/extmk.rb ++++ b/ext/extmk.rb +@@ -420,8 +420,8 @@ else + 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/meta/recipes-devtools/ruby/ruby/0001-vm_dump.c-Define-REG_S1-and-REG_S2-for-musl-riscv.patch b/meta/recipes-devtools/ruby/ruby/0001-vm_dump.c-Define-REG_S1-and-REG_S2-for-musl-riscv.patch new file mode 100644 index 0000000000..67054d6553 --- /dev/null +++ b/meta/recipes-devtools/ruby/ruby/0001-vm_dump.c-Define-REG_S1-and-REG_S2-for-musl-riscv.patch @@ -0,0 +1,31 @@ +From 980dcc5380db6f03451357140ae1487117300156 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Tue, 25 Jan 2022 20:29:14 -0800 +Subject: [PATCH] vm_dump.c: Define REG_S1 and REG_S2 for musl/riscv + +These defines are missing in musl, there is a possible +patch to add them to musl, but we need a full list of +these names for mcontext that can be added once for all + +Upstream-Status: Inappropriate [musl bug] +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + vm_dump.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/vm_dump.c b/vm_dump.c +index 444be4a..8a081a7 100644 +--- a/vm_dump.c ++++ b/vm_dump.c +@@ -39,6 +39,11 @@ + + #define MAX_POSBUF 128 + ++#if defined(__riscv) && !defined(__GLIBC__) ++# define REG_S1 9 ++# define REG_S2 18 ++#endif ++ + #define VM_CFP_CNT(ec, cfp) \ + ((rb_control_frame_t *)((ec)->vm_stack + (ec)->vm_stack_size) - \ + (rb_control_frame_t *)(cfp)) diff --git a/meta/recipes-devtools/ruby/ruby/0002-Obey-LDFLAGS-for-the-link-of-libruby.patch b/meta/recipes-devtools/ruby/ruby/0002-Obey-LDFLAGS-for-the-link-of-libruby.patch index 4cf579f427..f3a65e785d 100644 --- a/meta/recipes-devtools/ruby/ruby/0002-Obey-LDFLAGS-for-the-link-of-libruby.patch +++ b/meta/recipes-devtools/ruby/ruby/0002-Obey-LDFLAGS-for-the-link-of-libruby.patch @@ -1,23 +1,22 @@ -Upstream-Status: Pending - -From 306e95a9818d39d3349075aac9609e062b0f19ce Mon Sep 17 00:00:00 2001 +From 7f7facb85bd65adec24230fe8ca7f6a9863a1fd0 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 +Subject: [PATCH] Obey LDFLAGS for the link of libruby Signed-off-by: Christopher Larson <chris_larson@mentor.com> +Upstream-Status: Pending --- - Makefile.in | 2 +- + template/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@ +diff --git a/template/Makefile.in b/template/Makefile.in +index 8c462f2..2200c8c 100644 +--- a/template/Makefile.in ++++ b/template/Makefile.in +@@ -115,7 +115,7 @@ ENABLE_SHARED = @ENABLE_SHARED@ LDSHARED = @LIBRUBY_LDSHARED@ + DLDSHARED = @DLDSHARED@ + XDLDFLAGS = @DLDFLAGS@ -DLDFLAGS = @LIBRUBY_DLDFLAGS@ $(XLDFLAGS) $(ARCH_FLAG) +DLDFLAGS = @LIBRUBY_DLDFLAGS@ @LDFLAGS@ $(XLDFLAGS) $(ARCH_FLAG) SOLIBS = @SOLIBS@ diff --git a/meta/recipes-devtools/ruby/ruby/0003-rdoc-build-reproducible-documentation.patch b/meta/recipes-devtools/ruby/ruby/0003-rdoc-build-reproducible-documentation.patch new file mode 100644 index 0000000000..e2d5b57c25 --- /dev/null +++ b/meta/recipes-devtools/ruby/ruby/0003-rdoc-build-reproducible-documentation.patch @@ -0,0 +1,37 @@ +From 5079e678ce2a81416088c04f9123cd8207d5def2 Mon Sep 17 00:00:00 2001 +From: Christian Hofstaedtler <zeha@debian.org> +Date: Tue, 10 Oct 2017 15:04:34 -0300 +Subject: [PATCH] rdoc: build reproducible documentation + +- provide a fixed timestamp to the gzip compression + +Upstream-Status: Backport [debian] + +Signed-off-by: Antonio Terceiro <terceiro@debian.org> +Signed-off-by: Christian Hofstaedtler <zeha@debian.org> +--- + lib/rdoc/generator/json_index.rb | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lib/rdoc/generator/json_index.rb b/lib/rdoc/generator/json_index.rb +index c454910..24feab0 100644 +--- a/lib/rdoc/generator/json_index.rb ++++ b/lib/rdoc/generator/json_index.rb +@@ -178,7 +178,7 @@ class RDoc::Generator::JsonIndex + debug_msg "Writing gzipped search index to %s" % outfile + + Zlib::GzipWriter.open(outfile) do |gz| +- gz.mtime = File.mtime(search_index_file) ++ gz.mtime = -1 + gz.orig_name = search_index_file.basename.to_s + gz.write search_index + gz.close +@@ -196,7 +196,7 @@ class RDoc::Generator::JsonIndex + debug_msg "Writing gzipped file to %s" % outfile + + Zlib::GzipWriter.open(outfile) do |gz| +- gz.mtime = File.mtime(dest) ++ gz.mtime = -1 + gz.orig_name = dest.basename.to_s + gz.write data + gz.close diff --git a/meta/recipes-devtools/ruby/ruby/0004-lib-mkmf.rb-sort-list-of-object-files-in-generated-M.patch b/meta/recipes-devtools/ruby/ruby/0004-lib-mkmf.rb-sort-list-of-object-files-in-generated-M.patch new file mode 100644 index 0000000000..b14a731cfb --- /dev/null +++ b/meta/recipes-devtools/ruby/ruby/0004-lib-mkmf.rb-sort-list-of-object-files-in-generated-M.patch @@ -0,0 +1,31 @@ +From 99734381652602f76075017576a819c427ebb5f2 Mon Sep 17 00:00:00 2001 +From: Reiner Herrmann <reiner@reiner-h.de> +Date: Tue, 10 Oct 2017 15:06:13 -0300 +Subject: [PATCH] lib/mkmf.rb: sort list of object files in generated Makefile + +Without sorting the list explicitly, its order is indeterministic, +because readdir() is also not deterministic. +When the list of object files varies between builds, they are linked +in a different order, which results in an unreproducible build. + +Upstream-Status: Backport [debian] + +Signed-off-by: Antonio Terceiro <terceiro@debian.org> +Signed-off-by: Reiner Herrmann <reiner@reiner-h.de> +--- + lib/mkmf.rb | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/mkmf.rb b/lib/mkmf.rb +index 6da7dde..3af30a9 100644 +--- a/lib/mkmf.rb ++++ b/lib/mkmf.rb +@@ -2368,7 +2368,7 @@ LOCAL_LIBS = #{$LOCAL_LIBS} + LIBS = #{$LIBRUBYARG} #{$libs} #{$LIBS} + ORIG_SRCS = #{orig_srcs.collect(&File.method(:basename)).join(' ')} + SRCS = $(ORIG_SRCS) #{(srcs - orig_srcs).collect(&File.method(:basename)).join(' ')} +-OBJS = #{$objs.join(" ")} ++OBJS = #{$objs.sort.join(" ")} + HDRS = #{hdrs.map{|h| '$(srcdir)/' + File.basename(h)}.join(' ')} + LOCAL_HDRS = #{$headers.join(' ')} + TARGET = #{target} diff --git a/meta/recipes-devtools/ruby/ruby/0005-Mark-Gemspec-reproducible-change-fixing-784225-too.patch b/meta/recipes-devtools/ruby/ruby/0005-Mark-Gemspec-reproducible-change-fixing-784225-too.patch new file mode 100644 index 0000000000..24268625a2 --- /dev/null +++ b/meta/recipes-devtools/ruby/ruby/0005-Mark-Gemspec-reproducible-change-fixing-784225-too.patch @@ -0,0 +1,31 @@ +From 3bc324379aa3e322bad9353da8c0064cd671cc74 Mon Sep 17 00:00:00 2001 +From: Lucas Kanashiro <kanashiro@debian.org> +Date: Fri, 1 Nov 2019 15:25:17 -0300 +Subject: [PATCH] Make gemspecs reproducible + +Without an explicit date, they will get the current date and make the +build unreproducible + +Upstream-Status: Backport [debian] +--- + lib/rubygems/specification.rb | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb +index a0c7faa..f0722d9 100644 +--- a/lib/rubygems/specification.rb ++++ b/lib/rubygems/specification.rb +@@ -1774,7 +1774,9 @@ class Gem::Specification < Gem::BasicSpecification + raise(Gem::InvalidSpecificationException, + "invalid date format in specification: #{date.inspect}") + end +- when Time, DateLike then ++ when Time then ++ Time.utc(date.utc.year, date.utc.month, date.utc.day) ++ when DateLike then + Time.utc(date.year, date.month, date.day) + else + TODAY +-- +2.39.2 + diff --git a/meta/recipes-devtools/ruby/ruby/0006-Make-gemspecs-reproducible.patch b/meta/recipes-devtools/ruby/ruby/0006-Make-gemspecs-reproducible.patch new file mode 100644 index 0000000000..21604dfc34 --- /dev/null +++ b/meta/recipes-devtools/ruby/ruby/0006-Make-gemspecs-reproducible.patch @@ -0,0 +1,77 @@ +From 1dc7ef09c3c567c4adb09ccfd97e0e59c58edb9f Mon Sep 17 00:00:00 2001 +From: Lucas Kanashiro <kanashiro@debian.org> +Date: Fri, 1 Nov 2019 15:25:17 -0300 +Subject: [PATCH] Make gemspecs reproducible + +Without an explicit date, they will get the current date and make the +build unreproducible + +Upstream-Status: Backport [debian] +--- + ext/bigdecimal/bigdecimal.gemspec | 1 + + ext/fiddle/fiddle.gemspec | 1 + + ext/io/console/io-console.gemspec | 1 + + lib/ipaddr.gemspec | 1 + + lib/rdoc/rdoc.gemspec | 1 + + 5 files changed, 5 insertions(+) + +diff --git a/ext/bigdecimal/bigdecimal.gemspec b/ext/bigdecimal/bigdecimal.gemspec +index f9f3b45..b9a469d 100644 +--- a/ext/bigdecimal/bigdecimal.gemspec ++++ b/ext/bigdecimal/bigdecimal.gemspec +@@ -14,6 +14,7 @@ Gem::Specification.new do |s| + s.name = name + s.version = source_version + s.authors = ["Kenta Murata", "Zachary Scott", "Shigeo Kobayashi"] ++ s.date = RUBY_RELEASE_DATE + s.email = ["mrkn@mrkn.jp"] + + s.summary = "Arbitrary-precision decimal floating-point number library." +diff --git a/ext/fiddle/fiddle.gemspec b/ext/fiddle/fiddle.gemspec +index 8781093..efdca32 100644 +--- a/ext/fiddle/fiddle.gemspec ++++ b/ext/fiddle/fiddle.gemspec +@@ -8,6 +8,7 @@ end + Gem::Specification.new do |spec| + spec.name = "fiddle" + spec.version = version_module::Fiddle::VERSION ++ spec.date = RUBY_RELEASE_DATE + spec.authors = ["Aaron Patterson", "SHIBATA Hiroshi"] + spec.email = ["aaron@tenderlovemaking.com", "hsbt@ruby-lang.org"] + +diff --git a/ext/io/console/io-console.gemspec b/ext/io/console/io-console.gemspec +index d4f5276..8f89611 100644 +--- a/ext/io/console/io-console.gemspec ++++ b/ext/io/console/io-console.gemspec +@@ -4,6 +4,7 @@ _VERSION = "0.7.1" + Gem::Specification.new do |s| + s.name = "io-console" + s.version = _VERSION ++ s.date = RUBY_RELEASE_DATE + s.summary = "Console interface" + s.email = "nobu@ruby-lang.org" + s.description = "add console capabilities to IO instances." +diff --git a/lib/ipaddr.gemspec b/lib/ipaddr.gemspec +index 1f4798e..48743cf 100644 +--- a/lib/ipaddr.gemspec ++++ b/lib/ipaddr.gemspec +@@ -18,6 +18,7 @@ end + Gem::Specification.new do |spec| + spec.name = "ipaddr" + spec.version = version ++ spec.date = RUBY_RELEASE_DATE + spec.authors = ["Akinori MUSHA", "Hajimu UMEMOTO"] + spec.email = ["knu@idaemons.org", "ume@mahoroba.org"] + +diff --git a/lib/rdoc/rdoc.gemspec b/lib/rdoc/rdoc.gemspec +index 93a281c..cc5c155 100644 +--- a/lib/rdoc/rdoc.gemspec ++++ b/lib/rdoc/rdoc.gemspec +@@ -7,6 +7,7 @@ end + + Gem::Specification.new do |s| + s.name = "rdoc" ++ s.date = RUBY_RELEASE_DATE + s.version = RDoc::VERSION + + s.authors = [ diff --git a/meta/recipes-devtools/ruby/ruby/CVE-2018-1000073.patch b/meta/recipes-devtools/ruby/ruby/CVE-2018-1000073.patch deleted file mode 100644 index 22fa1b5f4d..0000000000 --- a/meta/recipes-devtools/ruby/ruby/CVE-2018-1000073.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 1b931fc03b819b9a0214be3eaca844ef534175e2 Mon Sep 17 00:00:00 2001 -From: Jonathan Claudius <jclaudius@mozilla.com> -Date: Wed, 7 Feb 2018 23:54:52 -0500 -Subject: [PATCH] Non-working patch for deducing symlinked base-dirs - ---- -CVE: CVE-2018-1000073 - -Fixed in ruby 2.7.6. - -Upstream-Status: Backport [github.com/rubygems/rubygems/commit/1b931fc...] - -Signed-off-by: Joe Slater <joe.slater@windriver.com> - ---- - lib/rubygems/package.rb | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/lib/rubygems/package.rb b/lib/rubygems/package.rb -index dede959..cb9c74a 100644 ---- a/lib/rubygems/package.rb -+++ b/lib/rubygems/package.rb -@@ -421,6 +421,8 @@ EOM - destination_dir = File.expand_path destination_dir - - destination = File.join destination_dir, filename -+ destination = File.realpath destination if -+ File.respond_to? :realpath - destination = File.expand_path destination - - raise Gem::Package::PathError.new(destination, destination_dir) unless --- -1.7.9.5 - diff --git a/meta/recipes-devtools/ruby/ruby/extmk.patch b/meta/recipes-devtools/ruby/ruby/extmk.patch deleted file mode 100644 index 404b9af7aa..0000000000 --- a/meta/recipes-devtools/ruby/ruby/extmk.patch +++ /dev/null @@ -1,16 +0,0 @@ -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/meta/recipes-devtools/ruby/ruby/ruby-CVE-2017-9226.patch b/meta/recipes-devtools/ruby/ruby/ruby-CVE-2017-9226.patch deleted file mode 100644 index 89437bba74..0000000000 --- a/meta/recipes-devtools/ruby/ruby/ruby-CVE-2017-9226.patch +++ /dev/null @@ -1,32 +0,0 @@ -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/meta/recipes-devtools/ruby/ruby/ruby-CVE-2017-9228.patch b/meta/recipes-devtools/ruby/ruby/ruby-CVE-2017-9228.patch deleted file mode 100644 index d8bfba486c..0000000000 --- a/meta/recipes-devtools/ruby/ruby/ruby-CVE-2017-9228.patch +++ /dev/null @@ -1,34 +0,0 @@ -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/meta/recipes-devtools/ruby/ruby/run-ptest b/meta/recipes-devtools/ruby/ruby/run-ptest new file mode 100644 index 0000000000..de7c415aba --- /dev/null +++ b/meta/recipes-devtools/ruby/ruby/run-ptest @@ -0,0 +1,13 @@ +#!/bin/sh + +test_fullname=`find test -name test_*.rb` + +for i in ${test_fullname}; do + ruby ./test/runner.rb ${i} 2>&1 > /dev/null + ret=$? + if [ $ret != 0 ]; then + echo "FAIL: ${i}" + else + echo "PASS: ${i}" + fi +done diff --git a/meta/recipes-devtools/ruby/ruby_2.5.1.bb b/meta/recipes-devtools/ruby/ruby_2.5.1.bb deleted file mode 100644 index 1197323e90..0000000000 --- a/meta/recipes-devtools/ruby/ruby_2.5.1.bb +++ /dev/null @@ -1,70 +0,0 @@ -require ruby.inc - -SRC_URI += " \ - file://ruby-CVE-2017-9226.patch \ - file://ruby-CVE-2017-9228.patch \ - file://CVE-2018-1000073.patch \ - " - -SRC_URI[md5sum] = "23867bc8c16c55e43b14dfe0614bcfa8" -SRC_URI[sha256sum] = "dac81822325b79c3ba9532b048c2123357d3310b2b40024202f360251d9829b1" - -# 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 -} - -do_install_append_class-target () { - # Find out rbconfig.rb from .installed.list - rbconfig_rb=`grep rbconfig.rb ${B}/.installed.list` - # Remove build host directories - sed -i -e 's:--sysroot=${STAGING_DIR_TARGET}::g' \ - -e s:'--with-libtool-sysroot=${STAGING_DIR_TARGET}'::g \ - -e 's|${DEBUG_PREFIX_MAP}||g' \ - -e 's:${HOSTTOOLS_DIR}/::g' \ - -e 's:${RECIPE_SYSROOT_NATIVE}::g' \ - -e 's:${RECIPE_SYSROOT}::g' \ - -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \ - ${D}$rbconfig_rb - - # Find out created.rid from .installed.list - created_rid=`grep created.rid ${B}/.installed.list` - # Remove build host directories - sed -i -e 's:${WORKDIR}::g' ${D}$created_rid - -} - -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" diff --git a/meta/recipes-devtools/ruby/ruby_3.3.0.bb b/meta/recipes-devtools/ruby/ruby_3.3.0.bb new file mode 100644 index 0000000000..657fc31b4d --- /dev/null +++ b/meta/recipes-devtools/ruby/ruby_3.3.0.bb @@ -0,0 +1,140 @@ +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-2-Clause | BSD-3-Clause | GPL-2.0-only | ISC | MIT" +LIC_FILES_CHKSUM = "file://COPYING;md5=5b8c87559868796979806100db3f3805 \ + file://BSDL;md5=8b50bc6de8f586dc66790ba11d064d75 \ + file://GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://LEGAL;md5=81e6a4d81533b9263da4c3485a0ad883 \ + " + +DEPENDS = "zlib openssl libyaml libffi" +DEPENDS:append:class-target = " ruby-native" +DEPENDS:append:class-nativesdk = " ruby-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://0001-extmk-fix-cross-compilation-of-external-gems.patch \ + file://0002-Obey-LDFLAGS-for-the-link-of-libruby.patch \ + file://run-ptest \ + file://0003-rdoc-build-reproducible-documentation.patch \ + file://0004-lib-mkmf.rb-sort-list-of-object-files-in-generated-M.patch \ + file://0005-Mark-Gemspec-reproducible-change-fixing-784225-too.patch \ + file://0006-Make-gemspecs-reproducible.patch \ + file://0001-vm_dump.c-Define-REG_S1-and-REG_S2-for-musl-riscv.patch \ + " +UPSTREAM_CHECK_URI = "https://www.ruby-lang.org/en/downloads/" + +inherit autotools ptest pkgconfig + + +# 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%%#$CFLAGS#; s#%%TARGET_LDFLAGS%%#$LDFLAGS#" ${S}/common.mk + rm -rf ${S}/ruby/ +} + +DEPENDS:append:libc-musl = " libucontext" + +SRC_URI[sha256sum] = "96518814d9832bece92a85415a819d4893b307db5921ae1f0f751a9a89a56b7d" + +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-ipv6, --disable-ipv6," +# rdoc is off by default due to non-reproducibility reported in +# https://bugs.ruby-lang.org/issues/18456 +PACKAGECONFIG[rdoc] = "--enable-install-rdoc,--disable-install-rdoc," + +EXTRA_OECONF = "\ + --disable-versioned-paths \ + --disable-rpath \ + --disable-dtrace \ + --enable-shared \ + --enable-load-relative \ + --with-pkg-config=pkg-config \ + --with-static-linked-ext \ +" + +EXTRA_OECONF:append:libc-musl = "\ + ac_cv_func_isnan=yes \ + ac_cv_func_isinf=yes \ +" + +PARALLEL_MAKEINST = "" + +do_install:append:class-target () { + # Find out rbconfig.rb from .installed.list + rbconfig_rb=`grep rbconfig.rb ${B}/.installed.list` + # Remove build host directories + sed -i -e 's:--sysroot=${STAGING_DIR_TARGET}::g' \ + -e s:'--with-libtool-sysroot=${STAGING_DIR_TARGET}'::g \ + -e 's|${DEBUG_PREFIX_MAP}||g' \ + -e 's:${HOSTTOOLS_DIR}/::g' \ + -e 's:${RECIPE_SYSROOT_NATIVE}::g' \ + -e 's:${RECIPE_SYSROOT}::g' \ + -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \ + ${D}$rbconfig_rb + + sed -i -e 's|${DEBUG_PREFIX_MAP}||g' \ + ${D}${libdir}/pkgconfig/*.pc + + # logs that may contain host-specific paths + find ${D} -name gem_make.out -delete +} + +do_install_ptest () { + cp -rf ${S}/test ${D}${PTEST_PATH}/ + + install -D ${S}/tool/test/runner.rb ${D}${PTEST_PATH}/tool/test/runner.rb + cp -r ${S}/tool/lib ${D}${PTEST_PATH}/tool/ + mkdir -p ${D}${PTEST_PATH}/lib + cp -r ${S}/lib/did_you_mean ${S}/lib/rdoc ${D}${PTEST_PATH}/lib + + # install test-binaries + # These .so files have sporadic reproducibility fails as seen here: + # https://autobuilder.yocto.io/pub/repro-fail/oe-reproducible-20220107-rm1diuww/packages/diff-html/ + # As they are needed only in ruby-ptest, and that is currently altogether disabled, let's take them out. + # If someone wants to look at where the non-determinism comes from, one possible reason is use of + # -rdynamic -Wl,-export-dynamic + #find $(find ./.ext -path '*/-test-') -name '*.so' -print0 \ + # | tar --no-recursion --null -T - --no-same-owner --preserve-permissions -cf - \ + # | tar -C ${D}${libdir}/ruby/${SHRT_VER}.0/ --no-same-owner --preserve-permissions --strip-components=2 -xf - + # adjust path to not assume build directory layout + sed -e 's|File.expand_path(.*\.\./bin/erb[^)]*|File.expand_path("${bindir}/erb"|g' \ + -i ${D}${PTEST_PATH}/test/erb/test_erb_command.rb + + cp -r ${S}/include ${D}/${libdir}/ruby/ +} + +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" + +FILES:${PN}-ptest:append:class-target = "\ + ${libdir}/ruby/include \ + ${libdir}/ruby/${SHRT_VER}.0/*/-test- \ +" + +BBCLASSEXTEND = "native nativesdk" |