anchor.diff:      in
         import ./bash-4.4-patches.nix patch;
   
  -  inherit (stdenv.lib) optional optionalString;
  +  inherit (stdenv.lib) optional optionals;
   in
   
   stdenv.mkDerivation rec {
  
positive.code: { stdenv, fetchurl, readline70 ? null, interactive ? false, texinfo ? null
  , binutils ? null, bison
  }:
  
  assert interactive -> readline70 != null;
  assert stdenv.isDarwin -> binutils != null;
  
  let
    version = "4.4";
    realName = "bash-${version}";
    shortName = "bash44";
    baseConfigureFlags = if interactive then "--with-installed-readline" else "--disable-readline";
    sha256 = "1jyz6snd63xjn6skk7za6psgidsd53k05cr3lksqybi0q6936syq";
  
    upstreamPatches =
  
negative.code:   patchFlags = "-p0";
  
    patches = upstreamPatches
        ++ optional hostPlatform.isCygwin ./cygwin-bash-4.3.33-1.src.patch;
  
    configureFlags = [
      (if interactive then "--with-installed-readline" else "--disable-readline")
    ] ++ optionals (hostPlatform != buildPlatform) [
      "bash_cv_job_control_missing=nomissing bash_cv_sys_named_pipes=nomissing bash_cv_getcwd_malloc=yes"
    ] ++ optionals hostPlatform.isCygwin [
      "--without-libintl-prefix --without-libiconv-prefix"
      "--with-installed-readline"
      "bash_cv_dev_stdin=present"
      "bash_cv_dev_fd=standard"
      "bash_cv_termcap_lib=libncurses"
    ];
  
    # Note: Bison is needed because the patches above modify parse.y.
    nativeBuildInputs = [bison]
      ++ optional (texinfo != null) texinfo
      ++ optional hostPlatform.isDarwin binutils
      ++ optional (hostPlatform != buildPlatform) buildPackages.stdenv.cc;
  
    buildInputs = optional interactive readline70;
  
  