anchor.diff:            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 = ''
  
positive.code:       , 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
        }:
        stdenv.mkDerivation rec {
          pname = "ruby";
          inherit version;
  
          src = if buildFromGit then fetchFromGitHub {
            owner  = "ruby";
            repo   = "ruby";
            rev    = tag;
            sha256 = sha256.git;
          } else fetchurl {
            url = "https://cache.ruby-lang.org/pub/ruby/${ver.majMin}/ruby-${ver}.tar.gz";
            sha256 = sha256.src;
          };
  
          # Have `configure' avoid `/usr/bin/nroff' in non-chroot builds.
  
negative.code:   # Contains the ruby version heuristics
    rubyVersion = import ./ruby-version.nix { inherit lib; };
  
    generic = { version, sha256 }: let
      ver = version;
      tag = ver.gitTag;
      atLeast30 = lib.versionAtLeast ver.majMin "3.0";
  