buildRubyGem: update CFLAGS for ruby 3.0 on Clang

This commit is contained in:
Mario Rodas 2021-02-22 04:20:00 +00:00
parent 9db5a83465
commit 7121ef61da

View File

@ -129,6 +129,12 @@ stdenv.mkDerivation ((builtins.removeAttrs attrs ["source"]) // {
runHook postUnpack
'';
# As of ruby 3.0, ruby headers require -fdeclspec when building with clang
# Introduced in https://github.com/ruby/ruby/commit/0958e19ffb047781fe1506760c7cbd8d7fe74e57
NIX_CFLAGS_COMPILE = lib.optionals (stdenv.cc.isClang && lib.versionAtLeast ruby.version.major "3") [
"-fdeclspec"
];
buildPhase = attrs.buildPhase or ''
runHook preBuild