diff --git a/pkgs/development/interpreters/ruby/default.nix b/pkgs/development/interpreters/ruby/default.nix index d01980ee3a91..348708f573a0 100644 --- a/pkgs/development/interpreters/ruby/default.nix +++ b/pkgs/development/interpreters/ruby/default.nix @@ -183,13 +183,36 @@ let # make: *** [uncommon.mk:373: do-install-all] Error 1 enableParallelInstalling = false; - patches = op useBaseRuby ./do-not-update-gems-baseruby-3.2.patch ++ [ - # When using a baseruby, ruby always sets "libdir" to the build - # directory, which nix rejects due to a reference in to /build/ in - # the final product. Removing this reference doesn't seem to break - # anything and fixes cross compilation. - ./dont-refer-to-build-dir.patch - ]; + patches = + op useBaseRuby ./do-not-update-gems-baseruby-3.2.patch + ++ [ + # When using a baseruby, ruby always sets "libdir" to the build + # directory, which nix rejects due to a reference in to /build/ in + # the final product. Removing this reference doesn't seem to break + # anything and fixes cross compilation. + ./dont-refer-to-build-dir.patch + ] + # TODO: drop the isClang condition + ++ ops (lib.versionOlder ver.majMin "3.4" && stdenv.cc.isClang) [ + (fetchpatch { + name = "ruby-3.3-fix-llvm-21.patch"; + url = "https://github.com/ruby/ruby/commit/5a8d7642168f4ea0d9331fded3033c225bbc36c5.patch"; + excludes = [ "version.h" ]; + hash = "sha256-dV98gXXTSKM2ZezTvhVXNaKaXJxiWKEeUbqqL360cWw="; + }) + ] + ++ ops (lib.versionAtLeast ver.majMin "3.4" && lib.versionOlder ver.majMin "3.5") [ + (fetchpatch { + name = "ruby-3.4-fix-gcc-15-llvm-21-1.patch"; + url = "https://github.com/ruby/ruby/commit/846bb760756a3bf1ab12d56d8909e104f16e6940.patch"; + hash = "sha256-+f0mzHsGAe9FT9NWE345BxzaB6vmWzMTvEfWF84uFOs="; + }) + (fetchpatch { + name = "ruby-3.4-fix-gcc-15-llvm-21-2.patch"; + url = "https://github.com/ruby/ruby/commit/18e176659e8afe402cab7d39972f2d56f2cf378f.patch"; + hash = "sha256-TKPG1hcC1G2WmUkvNV6QSnvUpTEDqrYKrIk/4fAS8QE="; + }) + ]; cargoRoot = opString yjitSupport "yjit";