2022-05-18 14:49:53 +00:00
|
|
|
{ lib, stdenv, fetchurl, fetchpatch, zlib }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "bwa";
|
|
|
|
version = "0.7.17";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://sourceforge/bio-bwa/${pname}-${version}.tar.bz2";
|
|
|
|
sha256 = "1zfhv2zg9v1icdlq4p9ssc8k01mca5d1bd87w71py2swfi74s6yy";
|
|
|
|
};
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
patches = [
|
|
|
|
# Pull upstream patch for -fno-common toolchain support like upstream
|
|
|
|
# gcc-10: https://github.com/lh3/bwa/pull/267
|
|
|
|
(fetchpatch {
|
|
|
|
name = "fno-common.patch";
|
|
|
|
url = "https://github.com/lh3/bwa/commit/2a1ae7b6f34a96ea25be007ac9d91e57e9d32284.patch";
|
|
|
|
sha256 = "1lihfxai6vcshv5vr3m7yhk833bdivkja3gld6ilwrc4z28f6wqy";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [ zlib ];
|
|
|
|
|
2020-12-03 08:41:04 +00:00
|
|
|
# Avoid hardcoding gcc to allow environments with a different
|
|
|
|
# C compiler to build
|
|
|
|
preConfigure = ''
|
|
|
|
sed -i '/^CC/d' Makefile
|
|
|
|
'';
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
makeFlags = lib.optional stdenv.hostPlatform.isStatic "AR=${stdenv.cc.targetPrefix}ar";
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
# it's unclear which headers are intended to be part of the public interface
|
|
|
|
# so we may find ourselves having to add more here over time
|
2020-04-24 23:36:52 +00:00
|
|
|
installPhase = ''
|
2020-09-25 04:45:31 +00:00
|
|
|
install -vD -t $out/bin bwa
|
|
|
|
install -vD -t $out/lib libbwa.a
|
|
|
|
install -vD -t $out/include bntseq.h
|
|
|
|
install -vD -t $out/include bwa.h
|
|
|
|
install -vD -t $out/include bwamem.h
|
|
|
|
install -vD -t $out/include bwt.h
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A software package for mapping low-divergent sequences against a large reference genome, such as the human genome";
|
|
|
|
license = licenses.gpl3;
|
2023-02-02 18:25:31 +00:00
|
|
|
homepage = "https://bio-bwa.sourceforge.net/";
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ luispedro ];
|
2020-12-03 08:41:04 +00:00
|
|
|
platforms = platforms.x86_64;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|