anchor.diff:        homepage = http://ipxe.org/;
         license = licenses.gpl2;
         maintainers = with maintainers; [ ehmry ];
  -      platforms = platforms.all;
  +      platforms = [ "x86_64-linux" "i686-linux" ];
       };
   }
  
positive.code: { stdenv, lib, fetchgit, perl, cdrkit, syslinux, xz, openssl, gnu-efi
  , embedScript ? null
  }:
  
  let
    date = "20190318";
    rev = "ebf2eaf515e46abd43bc798e7e4ba77bfe529218";
    targets = (lib.optional stdenv.isx86_64 "bin-x86_64-efi/ipxe.efi") ++ [
      "bin/ipxe.dsk"
      "bin/ipxe.usb"
      "bin/ipxe.iso"
      "bin/ipxe.lkrn"
      "bin/undionly.kpxe"
    ];
  in
  
  stdenv.mkDerivation {
    name = "ipxe-${date}-${builtins.substring 0 7 rev}";
  
    buildInputs = [ perl cdrkit syslinux xz openssl gnu-efi ];
  
    src = fetchgit {
      url = https://git.ipxe.org/ipxe.git;
  
negative.code: 
    preBuild = "cd src";
  
    buildFlags = lib.attrNames targets;
  
    installPhase = ''
      mkdir -p $out
      ${lib.concatStringsSep "\n" (lib.mapAttrsToList (from: to:
        if to == null
        then "cp -v ${from} $out"
        else "cp -v ${from} $out/${to}") targets)}
  
      # Some PXE constellations especially with dnsmasq are looking for the file with .0 ending
      # let's provide it as a symlink to be compatible in this case.
  