summary refs log tree commit diff
path: root/pkgs/applications/science/biology/sambamba/default.nix
blob: abfac6ce083f86fbd6a3cb217265535ac699cac0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{ lib, stdenv, fetchFromGitHub, fetchpatch, python3, which, ldc, zlib }:

stdenv.mkDerivation rec {
  pname = "sambamba";
  version = "0.8.0";

  src = fetchFromGitHub {
    owner = "biod";
    repo = "sambamba";
    rev = "v${version}";
    sha256 = "sha256:0kx5a0fmvv9ldz2hnh7qavgf7711kqc73zxf51k4cca4hr58zxr9";
    fetchSubmodules = true;
  };

  patches = [
    # Fixes hardcoded gcc, making clang build possible.
    (fetchpatch {
      url = "https://github.com/biod/sambamba/commit/c50a1c91e1ba062635467f197139bf6784e9be15.patch";
      sha256 = "1y0vlybmb9wpg4z1nca7m96mk9hxmvd3yrg7w8rxscj45hcqvf8q";
    })
  ];

  nativeBuildInputs = [ which python3 ldc ];
  buildInputs = [ zlib ];

  # Upstream's install target is broken; copy manually
  installPhase = ''
    mkdir -p $out/bin
    cp bin/sambamba-${version} $out/bin/sambamba
  '';

  meta = with lib; {
    description = "SAM/BAM processing tool";
    homepage = "https://lomereiter.github.io/sambamba/";
    maintainers = with maintainers; [ jbedo ];
    license = with licenses; gpl2;
    platforms = platforms.x86_64;
  };
}