anchor.diff:      sha256 = "18bp7fcpv7879q3ppdxlqj7ayqmlh5zwrkz8gch6rq9lkmmrklrf";
     };
   
  -  buildInputs = [ libxslt systemd libaio docbook_xsl ];
  +  nativeBuildInputs = [ libxslt docbook_xsl makeWrapper ];
  +
  +  buildInputs = [ systemd libaio ];
   
     makeFlags = [
       "PREFIX=${placeholder "out"}"
  
positive.code: { stdenv, fetchFromGitHub, libxslt, libaio, systemd, perl, perlPackages
  , docbook_xsl }:
  
  stdenv.mkDerivation rec {
    pname = "tgt";
  
negative.code:   '';
  
    postInstall = ''
      substituteInPlace $out/sbin/tgt-admin \
        --replace "#!/usr/bin/perl" "#! ${perl}/bin/perl -I${perlPackages.ConfigGeneral}/${perl.libPrefix}"
      wrapProgram $out/sbin/tgt-admin --prefix PATH : \
        ${lib.makeBinPath [ lsof sg3_utils (placeholder "out") ]}
  
      install -D scripts/tgtd.service $out/etc/systemd/system/tgtd.service
      substituteInPlace $out/etc/systemd/system/tgtd.service \
        --replace "/usr/sbin/tgt" "$out/bin/tgt"
  
      # See https://bugzilla.redhat.com/show_bug.cgi?id=848942
      sed -i '/ExecStart=/a ExecStartPost=${coreutils}/bin/sleep 5' $out/etc/systemd/system/tgtd.service
    '';
  
    enableParallelBuilding = true;
  
    meta = with stdenv.lib; {
      description = "iSCSI Target daemon with RDMA support";
      homepage = "http://stgt.sourceforge.net/";
      license = licenses.gpl2;
      platforms = platforms.linux;
      maintainers = with maintainers; [ johnazoidberg ];
    };
  }
  