about summary refs log tree commit diff
path: root/pkgs/applications/science
diff options
context:
space:
mode:
authorSergei Trofimovich <slyich@gmail.com>2022-05-08 08:56:43 +0100
committerSergei Trofimovich <slyich@gmail.com>2022-05-08 08:56:43 +0100
commit428045f39b3ad96ce0e9276dbebab317200c3ada (patch)
tree603a3b0a760c69645ba5b9d29e9b20bba54f7c14 /pkgs/applications/science
parent60480a51d566582d69425a168b3982e0477c322d (diff)
bwa: pull upstream fix for -fno-common tollchains
Without the change build fails on -fno-common toolchains like upstream
gcc-10 as:

    $ nix build -L --impure --expr 'with import ./. {}; bwa.overrideAttrs (oa: {   NIX_CFLAGS_COMPILE = (oa.NIX_CFLAGS_COMPILE or "") + "-fno-common"; })'
    ...
    ld: ./libbwa.a(rope.o):/build/bwa-0.7.17/rle.h:33:
      multiple definition of `rle_auxtab'; ./libbwa.a(bwtindex.o):/build/bwa-0.7.17/rle.h:33: first defined here
    ld: ./libbwa.a(rle.o):/build/bwa-0.7.17/rle.h:33:
      multiple definition of `rle_auxtab'; ./libbwa.a(bwtindex.o):/build/bwa-0.7.17/rle.h:33: first defined here
Diffstat (limited to 'pkgs/applications/science')
-rw-r--r--pkgs/applications/science/biology/bwa/default.nix12
1 files changed, 11 insertions, 1 deletions
diff --git a/pkgs/applications/science/biology/bwa/default.nix b/pkgs/applications/science/biology/bwa/default.nix
index d4727b41bd0e0..801ad00876bf5 100644
--- a/pkgs/applications/science/biology/bwa/default.nix
+++ b/pkgs/applications/science/biology/bwa/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchurl, zlib }:
+{ lib, stdenv, fetchurl, fetchpatch, zlib }:
 
 stdenv.mkDerivation rec {
   pname = "bwa";
@@ -9,6 +9,16 @@ stdenv.mkDerivation rec {
     sha256 = "1zfhv2zg9v1icdlq4p9ssc8k01mca5d1bd87w71py2swfi74s6yy";
   };
 
+  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";
+    })
+  ];
+
   buildInputs = [ zlib ];
 
   # Avoid hardcoding gcc to allow environments with a different