commit:     81f9f39f05b60fc25865aa4d5b103cd90701f4e6
Author:     Hans de Graaff <graaff <AT> gentoo <DOT> org>
AuthorDate: Sat May  1 06:12:03 2021 +0000
Commit:     Hans de Graaff <graaff <AT> gentoo <DOT> org>
CommitDate: Sat May  1 06:12:10 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=81f9f39f

dev-lang/ruby: fix build during bootstrap

Fix building during a bootstrap situation where no ruby is present yet.
Normally ruby uses a pregenerated miniprelude.c file for a miniruby that
is functional enough to assist the build process. Since we now patch
gem_prelude.rb in f6aa0fc2dcee195658e697026e607dbb91bfd31d the Makefile
tries to regenerate miniprelude.c, but this first requires a working
ruby, leading to build failures.

By resetting the date of the patched gem_prelude.c we can avoid this.
The gem_predule.rb patch is intended to be used in an installed ruby and
does not affect the miniruby usage.

Closes: https://bugs.gentoo.org/787137
Package-Manager: Portage-3.0.18, Repoman-3.0.2
Signed-off-by: Hans de Graaff <graaff <AT> gentoo.org>

 dev-lang/ruby/ruby-2.7.3-r1.ebuild | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/dev-lang/ruby/ruby-2.7.3-r1.ebuild 
b/dev-lang/ruby/ruby-2.7.3-r1.ebuild
index 682230b1d99..26d8593d705 100644
--- a/dev-lang/ruby/ruby-2.7.3-r1.ebuild
+++ b/dev-lang/ruby/ruby-2.7.3-r1.ebuild
@@ -67,6 +67,10 @@ src_prepare() {
        # compiles ruby in a non-standard way, may be dropped
        eapply "${FILESDIR}"/2.7/{002,003,010}*.patch
 
+       # Reset time on patched gem_prelude.rb to avoid the need for a base
+       # ruby during bootstrapping, bug 787137
+       touch -t 202001010000 gem_prelude.rb || die
+
        einfo "Unbundling gems..."
        cd "$S"
        # Remove bundled gems that we will install via PDEPEND, bug

Reply via email to