2021-02-13 14:23:35 +00:00
|
|
|
{ lib, stdenv, buildPackages, fetchurl, zlib, bzip2, perl, cpio, gawk, coreutils, ApplicationServices }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "blast";
|
2021-02-13 14:23:35 +00:00
|
|
|
version = "2.11.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-02-13 14:23:35 +00:00
|
|
|
url = "https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/${version}/ncbi-blast-${version}+-src.tar.gz";
|
|
|
|
sha256 = "0m0r9vkw631ky1za1wilsfk9k9spwqh22nkrb9a57rbwmrc1i3nq";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
sourceRoot = "ncbi-blast-${version}+-src/c++";
|
2021-02-05 17:12:51 +00:00
|
|
|
|
|
|
|
configureFlags = [
|
2020-04-24 23:36:52 +00:00
|
|
|
# With flat Makefile we can use all_projects in order not to build extra.
|
|
|
|
# These extra cause clang to hang on Darwin.
|
|
|
|
"--with-flat-makefile"
|
2021-02-05 17:12:51 +00:00
|
|
|
"--without-makefile-auto-update"
|
2020-04-24 23:36:52 +00:00
|
|
|
"--with-dll" # build dynamic libraries (static are default)
|
|
|
|
];
|
2021-02-05 17:12:51 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
makeFlags = [ "all_projects=app/" ];
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
export NCBICXX_RECONF_POLICY=warn
|
|
|
|
export PWD=$(pwd)
|
|
|
|
export HOME=$PWD
|
|
|
|
|
|
|
|
# The configure scripts wants to set AR="ar cr" unless it is already set in
|
|
|
|
# the environment. Because stdenv sets AR="ar", the result is a bad call to
|
|
|
|
# the assembler later in the process. Thus, we need to unset AR
|
|
|
|
unset AR
|
|
|
|
|
|
|
|
for awks in scripts/common/impl/is_log_interesting.awk \
|
|
|
|
scripts/common/impl/report_duplicates.awk; do
|
|
|
|
|
|
|
|
substituteInPlace $awks \
|
|
|
|
--replace /usr/bin/awk ${gawk}/bin/awk
|
|
|
|
done
|
|
|
|
|
|
|
|
for mk in src/build-system/Makefile.meta.in \
|
|
|
|
src/build-system/helpers/run_with_lock.c ; do
|
|
|
|
|
|
|
|
substituteInPlace $mk \
|
|
|
|
--replace /bin/rm ${coreutils}/bin/rm
|
|
|
|
done
|
|
|
|
|
|
|
|
for mk in src/build-system/Makefile.meta.gmake=no \
|
|
|
|
src/build-system/Makefile.meta_l \
|
|
|
|
src/build-system/Makefile.meta_r \
|
|
|
|
src/build-system/Makefile.requirements \
|
|
|
|
src/build-system/Makefile.rules_with_autodep.in; do
|
|
|
|
|
|
|
|
substituteInPlace $mk \
|
|
|
|
--replace /bin/echo ${coreutils}/bin/echo
|
|
|
|
done
|
|
|
|
for mk in src/build-system/Makefile.meta_p \
|
|
|
|
src/build-system/Makefile.rules_with_autodep.in \
|
|
|
|
src/build-system/Makefile.protobuf.in ; do
|
|
|
|
|
|
|
|
substituteInPlace $mk \
|
|
|
|
--replace /bin/mv ${coreutils}/bin/mv
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
substituteInPlace src/build-system/configure \
|
|
|
|
--replace /bin/pwd ${coreutils}/bin/pwd \
|
|
|
|
--replace /bin/ln ${coreutils}/bin/ln
|
|
|
|
|
|
|
|
substituteInPlace src/build-system/configure.ac \
|
|
|
|
--replace /bin/pwd ${coreutils}/bin/pwd \
|
|
|
|
--replace /bin/ln ${coreutils}/bin/ln
|
|
|
|
|
|
|
|
substituteInPlace src/build-system/Makefile.meta_l \
|
|
|
|
--replace /bin/date ${coreutils}/bin/date
|
|
|
|
'';
|
|
|
|
|
2021-02-13 14:23:35 +00:00
|
|
|
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
2020-04-24 23:36:52 +00:00
|
|
|
nativeBuildInputs = [ perl ];
|
|
|
|
|
|
|
|
# perl is necessary in buildInputs so that installed perl scripts get patched
|
|
|
|
# correctly
|
|
|
|
buildInputs = [ coreutils perl gawk zlib bzip2 cpio ]
|
|
|
|
++ lib.optionals stdenv.isDarwin [ ApplicationServices ];
|
|
|
|
hardeningDisable = [ "format" ];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
substituteInPlace $out/bin/get_species_taxids.sh \
|
|
|
|
--replace /bin/rm ${coreutils}/bin/rm
|
|
|
|
'';
|
|
|
|
patches = [ ./no_slash_bin.patch ];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
# Many tests require either network access or locally available databases
|
|
|
|
doCheck = false;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = ''Basic Local Alignment Search Tool (BLAST) finds regions of
|
|
|
|
similarity between biological sequences'';
|
|
|
|
homepage = "https://blast.ncbi.nlm.nih.gov/Blast.cgi";
|
|
|
|
license = licenses.publicDomain;
|
|
|
|
|
|
|
|
# Version 2.10.0 fails on Darwin
|
|
|
|
# See https://github.com/NixOS/nixpkgs/pull/61430
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ luispedro ];
|
|
|
|
};
|
|
|
|
}
|