From 90f635947fec7c02b100f5aa898994a9c7464d92 Mon Sep 17 00:00:00 2001 From: Andrew Marshall Date: Sat, 1 Jun 2024 03:31:10 -0400 Subject: [PATCH] buildRubyGem: Include platform in suffix for non-Ruby platforms (#299909) This adheres to how Bundler handles such gems. We must also adjust the generated URL to use this full suffix. --- pkgs/development/ruby-modules/gem/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/development/ruby-modules/gem/default.nix b/pkgs/development/ruby-modules/gem/default.nix index 409c2c9d027b..6f3245849f68 100644 --- a/pkgs/development/ruby-modules/gem/default.nix +++ b/pkgs/development/ruby-modules/gem/default.nix @@ -62,7 +62,7 @@ let if type == "gem" then fetchurl { urls = map ( - remote: "${remote}/gems/${gemName}-${version}.gem" + remote: "${remote}/gems/${gemName}-${suffix}.gem" ) (attrs.source.remotes or [ "https://rubygems.org" ]); inherit (attrs.source) sha256; } @@ -80,6 +80,8 @@ let suffix = if type == "git" then builtins.substring 0 12 attrs.source.rev + else if platform != "ruby" then + "${version}-${platform}" else version;