anchor.diff:    # cannot happen during build.
     configureFlags = [ "--disable-dvbscan" ];
   
  -  buildInputs = [ avahi dbus git gzip libav libiconv openssl pkgconfig python
  +  buildInputs = [ avahi dbus git gnutar gzip libav libiconv openssl pkgconfig python
       which zlib ];
   
  -  preConfigure = "patchShebangs ./configure";
  +  preConfigure = ''
  +    patchShebangs ./configure
  +    substituteInPlace src/config.c --replace /usr/bin/tar ${gnutar}/bin/tar
  +  '';
   
     meta = {
       description = "TV steaming server";
  
positive.code: {avahi, dbus, fetchurl, git, gzip, libav, libiconv, openssl, pkgconfig, python
  , stdenv, which, zlib}:
  
  with stdenv.lib;
  
  let version = "4.0.6";
      pkgName = "tvheadend";
  
  in
  
negative.code: 
    src = fetchurl {
      url = "https://github.com/tvheadend/tvheadend/archive/v${version}.tar.gz";
      sha256 = "0vhj4vkgl4brjw1pdc80g1wbjn6hyy57jrxkwilnivqfd1mwx3aw";
    };
  
    enableParallelBuilding = true;
  