2021-12-06 16:07:01 +00:00
|
|
|
{ lib, stdenv, fetchurl, fetchpatch, zlib, htslib, perl, ncurses ? null }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "samtools";
|
2023-04-29 16:46:19 +00:00
|
|
|
version = "1.17";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/samtools/samtools/releases/download/${version}/${pname}-${version}.tar.bz2";
|
2023-04-29 16:46:19 +00:00
|
|
|
sha256 = "sha256-Ot85C2KCGf1kCPFGAqTEqpDmPhizldrXIqtRlDiipyk";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
# tests require `bgzip` from the htslib package
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ htslib ];
|
2022-08-12 12:06:08 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
nativeBuildInputs = [ perl ];
|
|
|
|
|
|
|
|
buildInputs = [ zlib ncurses htslib ];
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
preConfigure = lib.optional stdenv.hostPlatform.isStatic ''
|
|
|
|
export LIBS="-lz -lbz2 -llzma"
|
|
|
|
'';
|
|
|
|
makeFlags = lib.optional stdenv.hostPlatform.isStatic "AR=${stdenv.cc.targetPrefix}ar";
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
configureFlags = [ "--with-htslib=${htslib}" ]
|
2022-04-27 09:35:20 +00:00
|
|
|
++ lib.optional (ncurses == null) "--without-curses"
|
2022-10-30 15:09:59 +00:00
|
|
|
++ lib.optionals stdenv.hostPlatform.isStatic ["--without-curses" ]
|
2022-04-27 09:35:20 +00:00
|
|
|
;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
patchShebangs test/
|
|
|
|
'';
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Tools for manipulating SAM/BAM/CRAM format";
|
|
|
|
license = licenses.mit;
|
|
|
|
homepage = "http://www.htslib.org/";
|
|
|
|
platforms = platforms.unix;
|
2020-11-03 02:18:15 +00:00
|
|
|
maintainers = with maintainers; [ mimame unode ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|