1 { lib, stdenv, buildPackages, fetchurl, zlib, bzip2, perl, cpio, gawk, coreutils, ApplicationServices }:
3 stdenv.mkDerivation rec {
8 url = "https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/${version}/ncbi-blast-${version}+-src.tar.gz";
9 sha256 = "sha256-cSwtvfD7E8wcLU9O9d0c5LBsO1fpbf6o8j5umfWxZQ4=";
12 sourceRoot = "ncbi-blast-${version}+-src/c++";
15 # With flat Makefile we can use all_projects in order not to build extra.
16 # These extra cause clang to hang on Darwin.
17 "--with-flat-makefile"
18 "--without-makefile-auto-update"
19 "--with-dll" # build dynamic libraries (static are default)
22 makeFlags = [ "all_projects=app/" ];
25 export NCBICXX_RECONF_POLICY=warn
29 # The configure scripts wants to set AR="ar cr" unless it is already set in
30 # the environment. Because stdenv sets AR="ar", the result is a bad call to
31 # the assembler later in the process. Thus, we need to unset AR
34 for awks in scripts/common/impl/is_log_interesting.awk \
35 scripts/common/impl/report_duplicates.awk; do
37 substituteInPlace $awks \
38 --replace /usr/bin/awk ${gawk}/bin/awk
41 for mk in src/build-system/Makefile.meta.in \
42 src/build-system/helpers/run_with_lock.c ; do
44 substituteInPlace $mk \
45 --replace /bin/rm ${coreutils}/bin/rm
48 for mk in src/build-system/Makefile.meta.gmake=no \
49 src/build-system/Makefile.meta_l \
50 src/build-system/Makefile.meta_r \
51 src/build-system/Makefile.requirements \
52 src/build-system/Makefile.rules_with_autodep.in; do
54 substituteInPlace $mk \
55 --replace /bin/echo ${coreutils}/bin/echo
57 for mk in src/build-system/Makefile.meta_p \
58 src/build-system/Makefile.rules_with_autodep.in \
59 src/build-system/Makefile.protobuf.in ; do
61 substituteInPlace $mk \
62 --replace /bin/mv ${coreutils}/bin/mv
66 substituteInPlace src/build-system/configure \
67 --replace /bin/pwd ${coreutils}/bin/pwd \
68 --replace /bin/ln ${coreutils}/bin/ln
70 substituteInPlace src/build-system/configure.ac \
71 --replace /bin/pwd ${coreutils}/bin/pwd \
72 --replace /bin/ln ${coreutils}/bin/ln
74 substituteInPlace src/build-system/Makefile.meta_l \
75 --replace /bin/date ${coreutils}/bin/date
78 depsBuildBuild = [ buildPackages.stdenv.cc ];
79 nativeBuildInputs = [ perl ];
81 # perl is necessary in buildInputs so that installed perl scripts get patched
83 buildInputs = [ coreutils perl gawk zlib bzip2 cpio ]
84 ++ lib.optionals stdenv.hostPlatform.isDarwin [ ApplicationServices ];
85 hardeningDisable = [ "format" ];
88 substituteInPlace $out/bin/get_species_taxids.sh \
89 --replace /bin/rm ${coreutils}/bin/rm
91 patches = [ ./no_slash_bin.patch ];
93 enableParallelBuilding = true;
95 # Many tests require either network access or locally available databases
99 description = ''Basic Local Alignment Search Tool (BLAST) finds regions of similarity between biological sequences'';
100 homepage = "https://blast.ncbi.nlm.nih.gov/Blast.cgi";
101 license = licenses.publicDomain;
103 # Version 2.10.0 fails on Darwin
104 # See https://github.com/NixOS/nixpkgs/pull/61430
105 platforms = platforms.linux;
106 maintainers = with maintainers; [ luispedro ];