2024-06-05 15:53:02 +00:00
|
|
|
{ lib, stdenv, fetchurl, zlib, htslib, perl, ncurses ? null }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "samtools";
|
2024-02-07 01:22:34 +00:00
|
|
|
version = "1.19.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/samtools/samtools/releases/download/${version}/${pname}-${version}.tar.bz2";
|
2024-02-07 01:22:34 +00:00
|
|
|
hash = "sha256-cfYEmWaOTAjn10X7/yTBXMigl3q6sazV0rtBm9sGXpY=";
|
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
|
|
|
};
|
|
|
|
}
|