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.
This commit is contained in:
Andrew Marshall 2024-06-01 03:31:10 -04:00 committed by GitHub
parent 72ca766b70
commit 90f635947f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;