ruby: change sha256 to hash

This commit is contained in:
Kirill Radzikhovskyy 2023-12-13 06:47:11 +11:00
parent 6daa5cd1fe
commit 85f79f4189

View file

@ -18,7 +18,7 @@ let
# Contains the ruby version heuristics # Contains the ruby version heuristics
rubyVersion = import ./ruby-version.nix { inherit lib; }; rubyVersion = import ./ruby-version.nix { inherit lib; };
generic = { version, sha256, cargoSha256 ? null }: let generic = { version, hash, cargoHash ? null }: let
ver = version; ver = version;
atLeast30 = lib.versionAtLeast ver.majMin "3.0"; atLeast30 = lib.versionAtLeast ver.majMin "3.0";
atLeast31 = lib.versionAtLeast ver.majMin "3.1"; atLeast31 = lib.versionAtLeast ver.majMin "3.1";
@ -65,7 +65,7 @@ let
src = fetchurl { src = fetchurl {
url = "https://cache.ruby-lang.org/pub/ruby/${ver.majMin}/ruby-${ver}.tar.gz"; url = "https://cache.ruby-lang.org/pub/ruby/${ver.majMin}/ruby-${ver}.tar.gz";
inherit sha256; inherit hash;
}; };
# Have `configure' avoid `/usr/bin/nroff' in non-chroot builds. # Have `configure' avoid `/usr/bin/nroff' in non-chroot builds.
@ -111,7 +111,7 @@ let
# Ruby 3.0 adds `-fdeclspec` to $CC instead of $CFLAGS. Fixed in later versions. # Ruby 3.0 adds `-fdeclspec` to $CC instead of $CFLAGS. Fixed in later versions.
(fetchpatch { (fetchpatch {
url = "https://github.com/ruby/ruby/commit/0acc05caf7518cd0d63ab02bfa036455add02346.patch"; url = "https://github.com/ruby/ruby/commit/0acc05caf7518cd0d63ab02bfa036455add02346.patch";
sha256 = "sha256-43hI9L6bXfeujgmgKFVmiWhg7OXvshPCCtQ4TxqK1zk="; hash = "sha256-43hI9L6bXfeujgmgKFVmiWhg7OXvshPCCtQ4TxqK1zk=";
}) })
] ]
++ ops (!atLeast30 && rubygemsSupport) [ ++ ops (!atLeast30 && rubygemsSupport) [
@ -126,7 +126,7 @@ let
# See https://github.com/ruby/ruby/pull/2930 # See https://github.com/ruby/ruby/pull/2930
(fetchpatch { (fetchpatch {
url = "https://github.com/ruby/ruby/commit/261d8dd20afd26feb05f00a560abd99227269c1c.patch"; url = "https://github.com/ruby/ruby/commit/261d8dd20afd26feb05f00a560abd99227269c1c.patch";
sha256 = "0wrii25cxcz2v8bgkrf7ibcanjlxwclzhayin578bf0qydxdm9qy"; hash = "sha256-HqfaevMYuIVOsdEr+CnjnUqr2IrH5fkW2uKzzoqIMXM=";
}) })
] ]
++ ops atLeast31 [ ++ ops atLeast31 [
@ -142,7 +142,7 @@ let
cargoDeps = if yjitSupport then rustPlatform.fetchCargoTarball { cargoDeps = if yjitSupport then rustPlatform.fetchCargoTarball {
inherit src; inherit src;
sourceRoot = "${pname}-${version}/${cargoRoot}"; sourceRoot = "${pname}-${version}/${cargoRoot}";
sha256 = cargoSha256; hash = cargoHash;
} else null; } else null;
postUnpack = opString rubygemsSupport '' postUnpack = opString rubygemsSupport ''
@ -318,24 +318,24 @@ in {
ruby_2_7 = generic { ruby_2_7 = generic {
version = rubyVersion "2" "7" "8" ""; version = rubyVersion "2" "7" "8" "";
sha256 = "sha256-wtq2PLyPKgVSYQitQZ76Y6Z+1AdNu8+fwrHKZky0W6A="; hash = "sha256-wtq2PLyPKgVSYQitQZ76Y6Z+1AdNu8+fwrHKZky0W6A=";
}; };
ruby_3_1 = generic { ruby_3_1 = generic {
version = rubyVersion "3" "1" "4" ""; version = rubyVersion "3" "1" "4" "";
sha256 = "sha256-o9VYeaDfqx1xQf3xDSKgfb+OXNxEFdob3gYSfVzDx7Y="; hash = "sha256-o9VYeaDfqx1xQf3xDSKgfb+OXNxEFdob3gYSfVzDx7Y=";
}; };
ruby_3_2 = generic { ruby_3_2 = generic {
version = rubyVersion "3" "2" "2" ""; version = rubyVersion "3" "2" "2" "";
sha256 = "sha256-lsV1WIcaZ0jeW8nydOk/S1qtBs2PN776Do2U57ikI7w="; hash = "sha256-lsV1WIcaZ0jeW8nydOk/S1qtBs2PN776Do2U57ikI7w=";
cargoSha256 = "sha256-6du7RJo0DH+eYMOoh3L31F3aqfR5+iG1iKauSV1uNcQ="; cargoHash = "sha256-6du7RJo0DH+eYMOoh3L31F3aqfR5+iG1iKauSV1uNcQ=";
}; };
ruby_3_3 = generic { ruby_3_3 = generic {
version = rubyVersion "3" "3" "0" "rc1"; version = rubyVersion "3" "3" "0" "rc1";
sha256 = "sha256-xP+COVqQ73bH+Qa3aHAm4KuWsJTc86Uy2auXeEoHMiI="; hash = "sha256-xP+COVqQ73bH+Qa3aHAm4KuWsJTc86Uy2auXeEoHMiI=";
cargoSha256 = "sha256-GeelTMRFIyvz1QS2L+Q3KAnyQy7jc0ejhx3TdEFVEbk="; cargoHash = "sha256-GeelTMRFIyvz1QS2L+Q3KAnyQy7jc0ejhx3TdEFVEbk=";
}; };
} }