ruby: always build from the tarball, drop support for git builds

This commit is contained in:
Andrew Childs 2022-03-11 11:53:36 +09:00
parent 9634895022
commit 6e859afe34

View file

@ -17,7 +17,7 @@ let
# Contains the ruby version heuristics
rubyVersion = import ./ruby-version.nix { inherit lib; };
generic = { version, revision, sha256 }: let
generic = { version, sha256 }: let
ver = version;
tag = ver.gitTag;
atLeast30 = lib.versionAtLeast ver.majMin "3.0";
@ -49,26 +49,19 @@ let
, libiconv, libobjc, libunwind, Foundation
, makeWrapper, buildRubyGem, defaultGemConfig
, baseRuby ? buildPackages.ruby.override {
buildFromGit = false;
useRailsExpress = false;
docSupport = false;
rubygemsSupport = false;
}
, buildFromGit ? true
, useBaseRuby ? stdenv.hostPlatform != stdenv.buildPlatform || useRailsExpress || buildFromGit
, useBaseRuby ? stdenv.hostPlatform != stdenv.buildPlatform || useRailsExpress
}:
stdenv.mkDerivation rec {
pname = "ruby";
inherit version;
src = if buildFromGit then fetchFromGitHub {
owner = "ruby";
repo = "ruby";
rev = tag;
sha256 = sha256.git;
} else fetchurl {
src = fetchurl {
url = "https://cache.ruby-lang.org/pub/ruby/${ver.majMin}/ruby-${ver}.tar.gz";
sha256 = sha256.src;
inherit sha256;
};
# Have `configure' avoid `/usr/bin/nroff' in non-chroot builds.
@ -123,11 +116,6 @@ let
rm -rf $sourceRoot/{lib,test}/rubygems*
cp -r ${rubygems}/lib/rubygems* $sourceRoot/lib
cp -r ${rubygems}/test/rubygems $sourceRoot/test
'' + opString buildFromGit ''
cat <<EOF > $sourceRoot/revision.h
#define RUBY_REVISION "${lib.substring 0 8 revision}"
#define RUBY_FULL_REVISION "${revision}"
EOF
'';
postPatch = ''
@ -270,28 +258,16 @@ let
in {
ruby_2_7 = generic {
version = rubyVersion "2" "7" "5" "";
revision = "f69aeb83146be640995753667fdd6c6f157527f5";
sha256 = {
src = "1wc1hwmz4m6iqlmqag8liyld917p6a8dvnhnpd1v8d8jl80bjm97";
git = "16565fyl7141hr6q6d74myhsz46lvgam8ifnacshi68vzibwjbbh";
};
sha256 = "1wc1hwmz4m6iqlmqag8liyld917p6a8dvnhnpd1v8d8jl80bjm97";
};
ruby_3_0 = generic {
version = rubyVersion "3" "0" "3" "";
revision = "3fb7d2cadc18472ec107b14234933b017a33c14d";
sha256 = {
src = "1b4j39zyyvdkf1ax2c6qfa40b4mxfkr87zghhw19fmnzn8f8d1im";
git = "1q19w5i1jkfxn7qq6f9v9ngax9h52gxwijk7hp312dx6amwrkaim";
};
sha256 = "1b4j39zyyvdkf1ax2c6qfa40b4mxfkr87zghhw19fmnzn8f8d1im";
};
ruby_3_1 = generic {
version = rubyVersion "3" "1" "1" "";
revision = "53f5fc4236a754ddf94b20dbb70ab63bd5109b18";
sha256 = {
src = "sha256-/m5Hgt6XRDl43bqLpL440iKqJNw+PwKmqOdwHA7rYZ0=";
git = "sha256-76t/tGyK5nz7nvcRdHJTjjckU+Kv+/kbTMiNWJ93jU8=";
};
sha256 = "sha256-/m5Hgt6XRDl43bqLpL440iKqJNw+PwKmqOdwHA7rYZ0=";
};
}