nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 buildPackages,
5 fetchurl,
6 zlib,
7 bzip2,
8 perl,
9 cpio,
10 gawk,
11 coreutils,
12}:
13
14stdenv.mkDerivation rec {
15 pname = "blast";
16 version = "2.14.1";
17
18 src = fetchurl {
19 url = "https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/${version}/ncbi-blast-${version}+-src.tar.gz";
20 sha256 = "sha256-cSwtvfD7E8wcLU9O9d0c5LBsO1fpbf6o8j5umfWxZQ4=";
21 };
22
23 sourceRoot = "ncbi-blast-${version}+-src/c++";
24
25 configureFlags = [
26 # With flat Makefile we can use all_projects in order not to build extra.
27 # These extra cause clang to hang on Darwin.
28 "--with-flat-makefile"
29 "--without-makefile-auto-update"
30 "--with-dll" # build dynamic libraries (static are default)
31 ];
32
33 makeFlags = [ "all_projects=app/" ];
34
35 preConfigure = ''
36 export NCBICXX_RECONF_POLICY=warn
37 export PWD=$(pwd)
38 export HOME=$PWD
39
40 # The configure scripts wants to set AR="ar cr" unless it is already set in
41 # the environment. Because stdenv sets AR="ar", the result is a bad call to
42 # the assembler later in the process. Thus, we need to unset AR
43 unset AR
44
45 for awks in scripts/common/impl/is_log_interesting.awk \
46 scripts/common/impl/report_duplicates.awk; do
47
48 substituteInPlace $awks \
49 --replace /usr/bin/awk ${gawk}/bin/awk
50 done
51
52 for mk in src/build-system/Makefile.meta.in \
53 src/build-system/helpers/run_with_lock.c ; do
54
55 substituteInPlace $mk \
56 --replace /bin/rm ${coreutils}/bin/rm
57 done
58
59 for mk in src/build-system/Makefile.meta.gmake=no \
60 src/build-system/Makefile.meta_l \
61 src/build-system/Makefile.meta_r \
62 src/build-system/Makefile.requirements \
63 src/build-system/Makefile.rules_with_autodep.in; do
64
65 substituteInPlace $mk \
66 --replace /bin/echo ${coreutils}/bin/echo
67 done
68 for mk in src/build-system/Makefile.meta_p \
69 src/build-system/Makefile.rules_with_autodep.in \
70 src/build-system/Makefile.protobuf.in ; do
71
72 substituteInPlace $mk \
73 --replace /bin/mv ${coreutils}/bin/mv
74 done
75
76
77 substituteInPlace src/build-system/configure \
78 --replace /bin/pwd ${coreutils}/bin/pwd \
79 --replace /bin/ln ${coreutils}/bin/ln
80
81 substituteInPlace src/build-system/configure.ac \
82 --replace /bin/pwd ${coreutils}/bin/pwd \
83 --replace /bin/ln ${coreutils}/bin/ln
84
85 substituteInPlace src/build-system/Makefile.meta_l \
86 --replace /bin/date ${coreutils}/bin/date
87 '';
88
89 depsBuildBuild = [ buildPackages.stdenv.cc ];
90 nativeBuildInputs = [
91 cpio
92 perl
93 ];
94
95 # perl is necessary in buildInputs so that installed perl scripts get patched
96 # correctly
97 buildInputs = [
98 coreutils
99 perl
100 gawk
101 zlib
102 bzip2
103 ];
104
105 strictDeps = true;
106
107 hardeningDisable = [ "format" ];
108
109 postInstall = ''
110 substituteInPlace $out/bin/get_species_taxids.sh \
111 --replace /bin/rm ${lib.getExe' coreutils "rm"}
112 '';
113 patches = [ ./no_slash_bin.patch ];
114
115 enableParallelBuilding = true;
116
117 # Many tests require either network access or locally available databases
118 doCheck = false;
119
120 meta = with lib; {
121 description = ''Basic Local Alignment Search Tool (BLAST) finds regions of similarity between biological sequences'';
122 homepage = "https://blast.ncbi.nlm.nih.gov/Blast.cgi";
123 license = licenses.publicDomain;
124
125 # Version 2.10.0 fails on Darwin
126 # See https://github.com/NixOS/nixpkgs/pull/61430
127 platforms = platforms.linux;
128 maintainers = with maintainers; [ luispedro ];
129 };
130}