anchor.diff:      install -D -m0644 gptsync/gptsync_${HOSTARCH}.efi $out/share/refind/tools_${HOSTARCH}/gptsync_${HOSTARCH}.efi
   
       # helper scripts
  -    install -D -m0755 install.sh $out/bin/refind-install
  -    install -D -m0755 mkrlconf.sh $out/bin/refind-mkrlconf
  -    install -D -m0755 mvrefind.sh $out/bin/refind-mvrefind
  +    install -D -m0755 refind-install $out/bin/refind-install
  +    install -D -m0755 mkrlconf $out/bin/refind-mkrlconf
  +    install -D -m0755 mvrefind $out/bin/refind-mvrefind
       install -D -m0755 fonts/mkfont.sh $out/bin/refind-mkfont
   
       # sample config files
  
positive.code:   srcName = "refind-src-${meta.version}";
  
    src = fetchurl {
      url = "mirror://sourceforge/project/refind/${meta.version}/${srcName}.zip";
      sha256 = "0ai150rzx20sfl92j6y1p6qnyy0wbmazrlp2fg19acs98qyxl8lh";
    };
  
    buildInputs = [ unzip gnu-efi efibootmgr dosfstools imagemagick ];
  
    HOSTARCH =
      if stdenv.system == "x86_64-linux" then "x64"
      else if stdenv.system == "i686-linux" then "ia32"
      else "null";
  
    patchPhase = ''
      sed -e 's|-DEFI_FUNCTION_WRAPPER|-DEFI_FUNCTION_WRAPPER -maccumulate-outgoing-args|g' -i Make.common
      sed -e 's|-DEFIX64|-DEFIX64 -maccumulate-outgoing-args|g' -i Make.common
      sed -e 's|-m64|-maccumulate-outgoing-args -m64|g' -i filesystems/Make.gnuefi
  
negative.code:     # Post-install fixes
      sed -e "s|^ThisDir=.*|ThisDir=$out/share/refind/|g" -i $out/bin/refind-install
      sed -e "s|^RefindDir=.*|RefindDir=$out/share/refind/|g" -i $out/bin/refind-install
    '';
  
    meta = with stdenv.lib; {
      version = "0.10.3";
      description = "A graphical {,U}EFI boot manager";
      longDescription = ''
        rEFInd is a graphical boot manager for EFI- and UEFI-based
  