audiobookshelf: 2.18.1 -> 2.19.0 (#378967)
[NixPkgs.git] / pkgs / by-name / sv / svaba / package.nix
blobcdc15398d3c9a71ddd48fb53a248159dc2cb4135
2   lib,
3   stdenv,
4   zlib,
5   bzip2,
6   xz,
7   fetchFromGitHub,
8 }:
10 stdenv.mkDerivation rec {
11   version = "1.1.0";
12   pname = "svaba";
14   src = fetchFromGitHub {
15     owner = "walaj";
16     repo = pname;
17     rev = version;
18     sha256 = "1vv5mc9z5d22kgdy7mm27ya5aahnqgkcrskdr2405058ikk9g8kp";
19     fetchSubmodules = true;
20   };
22   buildInputs = [
23     zlib
24     bzip2
25     xz
26   ];
28   postPatch = ''
29     # Fix gcc-13 build failure due to missing includes
30     sed -e '1i #include <cstdint>' -i \
31       SeqLib/src/non_api/Histogram.h \
32       src/svaba/Histogram.h
33   '';
35   # Workaround build failure on -fno-common toolchains like upstream
36   # gcc-10. Otherwise build fails as:
37   #   ld: ./libfml.a(rle.o):/build/source/SeqLib/fermi-lite/rle.h:33: multiple definition of
38   #     `rle_auxtab'; ./libfml.a(misc.o):/build/source/SeqLib/fermi-lite/rle.h:33: first defined here
39   env.NIX_CFLAGS_COMPILE = "-fcommon";
41   installPhase = ''
42     runHook preInstall
43     install -Dm555 src/svaba/svaba $out/bin/svaba
44     runHook postInstall
45   '';
47   meta = with lib; {
48     broken = (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64);
49     description = "Structural variant and INDEL caller for DNA sequencing data, using genome-wide local assembly";
50     mainProgram = "svaba";
51     license = licenses.gpl3;
52     homepage = "https://github.com/walaj/svaba";
53     maintainers = with maintainers; [ scalavision ];
54     platforms = platforms.linux;
55     longDescription = ''
56       SvABA is a method for detecting structural variants in sequencing data
57       using genome-wide local assembly. Under the hood, SvABA uses a custom
58       implementation of SGA (String Graph Assembler) by Jared Simpson,
59       and BWA-MEM by Heng Li. Contigs are assembled for every 25kb window
60       (with some small overlap) for every region in the genome.
61       The default is to use only clipped, discordant, unmapped and indel reads,
62       although this can be customized to any set of reads at the command line using VariantBam rules.
63       These contigs are then immediately aligned to the reference with BWA-MEM and parsed to identify variants.
64       Sequencing reads are then realigned to the contigs with BWA-MEM, and variants are scored by their read support.
65     '';
67   };