anchor.diff:      any
       mapAttrsToList
       optionals
  -    optionalString;
  +    optionalString
  +    replaceStrings;
   
     typeMap = {
       "bios-i386" = {
  
positive.code:     platform
      target;
  
    version = "2.02";
  in
  stdenv.mkDerivation rec {
    name = "grub-${version}-${type}";
  
    src = fetchurl {
      url = "mirror://gnu/grub/grub-${version}.tar.xz";
      hashOutput = false;
      sha256 = "810b3798d316394f94096ec2797909dbf23c858e48f7b3830826b8daa06b7b0f";
    };
  
    nativeBuildInputs = [
      autogen
      bison
      flex
      makeWrapper
    ];
  
    buildInputs = [
      freetype
      fuse_2
      gettext
      libusb_1
      lvm2
      ncurses
      xz
      zfs
    ];
  
negative.code:   ];
  
    postPatch = ''
      grep -q '/usr/share/fonts/truetype' configure
      sed -i 's,/usr/share/fonts/truetype,${dejavu-fonts}/share/fonts/truetype,g' configure
    '';
  
    configureFlags = [
      "--program-prefix="
      "--program-suffix="
      "--target=${target}"
    ] ++ optionals (platform != "efi") [
      "--enable-efiemu"
    ] ++ [
      "--enable-cache-stats"
      "--enable-boot-time"
      "--enable-grub-mkfont"
      "--enable-grub-themes"
      "--enable-grub-mount"
      "--enable-device-mapper"
      "--enable-liblzma"
      "--enable-libzfs"
      "--disable-werror"
      "--with-platform=${platform}"
    ];
  
    postFixup = optionalString ("efi" == platform) ''
  