nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 fetchpatch,
6 zlib,
7}:
8
9stdenv.mkDerivation rec {
10 pname = "bowtie";
11 version = "1.3.1";
12
13 src = fetchFromGitHub {
14 owner = "BenLangmead";
15 repo = "bowtie";
16 rev = "v${version}";
17 sha256 = "sha256-mWItmrTMPst/NnzSpxxTHcBztDqHPCza9yOsZPwp7G4=";
18 };
19
20 patches = [
21 # Without this patch, compiling with clang on an M1 Mac fails because
22 # 'cpuid.h' is included. It only works on x86 and throws an error.
23 (fetchpatch {
24 name = "fix_compilation_on_arm64";
25 url = "https://github.com/BenLangmead/bowtie/commit/091d72f4cb69ca0713704d38bd7f9b37e6c4ff2d.patch";
26 sha256 = "sha256-XBvgICUBnE5HKpJ36IHTDiKjJgLFKETsIaJC46uN+2I=";
27 })
28
29 # Without this patch, compilation adds the current source directory to the
30 # include search path, and #include <version> in standard library code can
31 # end up picking the unrelated VERSION source code file on case-insensitive
32 # file systems.
33 (fetchpatch {
34 name = "fix_include_search_path";
35 url = "https://github.com/BenLangmead/bowtie/commit/c208b9db936eab0bc3ffdf0182b4f59a9017a1c4.patch";
36 sha256 = "sha256-772EE+oWFWXssSMabPryb0AfIS1tC10mPTRCBm7RrUs=";
37 })
38 ];
39
40 buildInputs = [ zlib ];
41
42 installFlags = [ "prefix=$(out)" ];
43
44 meta = with lib; {
45 description = "Ultrafast memory-efficient short read aligner";
46 license = licenses.artistic2;
47 homepage = "https://bowtie-bio.sourceforge.net";
48 maintainers = with maintainers; [ prusnak ];
49 platforms = platforms.all;
50 };
51}