about summary refs log tree commit diff
path: root/pkgs/applications/science/biology/megahit/default.nix
blob: 185f763c2fb8c5285ab95c41a1f359c552b2dc8c (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
{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake, zlib }:

stdenv.mkDerivation rec {
  pname    = "megahit";
  version = "1.2.9";

  src = fetchFromGitHub {
    owner = "voutcn";
    repo = "megahit";
    rev = "v${version}";
    sha256 = "1r5d9nkdmgjsbrpj43q9hy3s8jwsabaz3ji561v18hy47v58923c";
  };

  patches = [
    # Fix gcc-13 build failure:
    #   https://github.com/voutcn/megahit/pull/366
    (fetchpatch {
      name = "gcc-13.patch";
      url = "https://github.com/voutcn/megahit/commit/4cb2f793503087163bda8592222f105f27e33e66.patch";
      hash = "sha256-b5mhzif+OPcMjmg+BnaUc5CB6Acn/KTBOJEw+WYEhbs=";
    })
  ];

  nativeBuildInputs = [ cmake ];
  buildInputs = [ zlib ];

  cmakeFlags = lib.optionals stdenv.hostPlatform.isStatic [
    "-DSTATIC_BUILD=ON"
    ];
  meta = with lib; {
    description = "Ultra-fast single-node solution for large and complex metagenomics assembly via succinct de Bruijn graph";
    license     = licenses.gpl3;
    homepage    = "https://github.com/voutcn/megahit";
    maintainers = with maintainers; [ luispedro ];
    platforms = [ "x86_64-linux" ];
  };
}