From ffd3da44f346f8b7fa2c07761459389904098b1c Mon Sep 17 00:00:00 2001 From: Andrew Marshall Date: Tue, 19 Jul 2022 19:26:08 -0400 Subject: [PATCH] defaultGemConfig.grpc: Fix build on v1.48.0+ Upstream commit 0a5d9828c1f6b32e8462a00029b1ba2a720c867b changed how the extension build script detects an Apple toolchain; adjust accordingly by forcing it to be false. Keep both fixes so this is more compatible. --- pkgs/development/ruby-modules/gem-config/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/development/ruby-modules/gem-config/default.nix b/pkgs/development/ruby-modules/gem-config/default.nix index 6f9da13f5034..5a6d885159a5 100644 --- a/pkgs/development/ruby-modules/gem-config/default.nix +++ b/pkgs/development/ruby-modules/gem-config/default.nix @@ -321,8 +321,12 @@ in substituteInPlace Makefile \ --replace '-Wno-invalid-source-encoding' "" '' + lib.optionalString stdenv.isDarwin '' + # For < v1.48.0 substituteInPlace src/ruby/ext/grpc/extconf.rb \ --replace "ENV['AR'] = 'libtool -o' if RUBY_PLATFORM =~ /darwin/" "" + # For >= v1.48.0 + substituteInPlace src/ruby/ext/grpc/extconf.rb \ + --replace 'apple_toolchain = ' 'apple_toolchain = false && ' ''; };