{ stdenv, fetchFromGitHub, htslib, zlib, autoreconfHook, pkgconfig, perl }:

stdenv.mkDerivation rec {
  name = "${pname}-${version}";
  pname = "vcftools";
  version = "0.1.15";

  src = fetchFromGitHub {
    repo = pname;
    owner = "vcftools";
    rev = "v${version}";
    sha256 = "15yxr4kidqb42gkbd6rjra6b07wpl6rgivlh9q73yavh5myafqk4";
  };

  buildInputs = [ autoreconfHook pkgconfig zlib perl ];

  meta = with stdenv.lib; {
    description = "A set of tools written in Perl and C++ for working with VCF files, such as those generated by the 1000 Genomes Project";
    license = licenses.lgpl3;
    platforms = platforms.linux;
    homepage = https://vcftools.github.io/index.html;
    maintainers = [ maintainers.rybern ];
  };
}
