blast: Package official ncbi-blast package
Based on initial work by Armin.
This commit is contained in:
@@ -4,6 +4,10 @@
|
|||||||
#
|
#
|
||||||
self: super: pkgs: with pkgs; {
|
self: super: pkgs: with pkgs; {
|
||||||
|
|
||||||
|
blast = callPackage ./blast {
|
||||||
|
stdenv = overrideCC stdenv gcc5;
|
||||||
|
};
|
||||||
|
|
||||||
cryptominisat = callPackage ./cryptominisat.nix { };
|
cryptominisat = callPackage ./cryptominisat.nix { };
|
||||||
|
|
||||||
#firedrake = callPackage ./firedrake { };
|
#firedrake = callPackage ./firedrake { };
|
||||||
|
|||||||
74
pkgs/blast/default.nix
Normal file
74
pkgs/blast/default.nix
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
{ stdenv, fetchurl, gcc5, cpio, curl
|
||||||
|
, python, perl, zlib, bzip2, boost }:
|
||||||
|
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
version = "2.6.0";
|
||||||
|
name = "ncbi-blast-${version}";
|
||||||
|
|
||||||
|
src = fetchurl {
|
||||||
|
url = "ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/${version}/ncbi-blast-${version}+-src.tar.gz";
|
||||||
|
sha256 = "15n937pw5aqmyfjb6l387d18grqbb96l63d5xj4l7yyh0zbf2405";
|
||||||
|
};
|
||||||
|
|
||||||
|
# The install target is broken as it tries to install a subdirectory using install
|
||||||
|
patches = [ ./install.patch ];
|
||||||
|
|
||||||
|
# Contains a lot of hardcoded paths for standard utils and some scripts the just reset PATH for the fun of it.
|
||||||
|
#
|
||||||
|
# - for every $cmd on the path, replace all occurances of /usr/bin/$cmd and /bin/$cmd with it
|
||||||
|
# - delete every line that has PATH=/bin:/usr/bin in it
|
||||||
|
#
|
||||||
|
# A bit of prefix/suffix matching and escaping is required for the first to avoid replacing things like $(foo)/bin/...
|
||||||
|
# and keeping the sed regexps valid in the face of commands like [.
|
||||||
|
#
|
||||||
|
postPatch = ''
|
||||||
|
patchShebangs .
|
||||||
|
echo 'replacing hardcoded /bin and /usr/bin commands with any nix equivalents on the PATH'
|
||||||
|
find -L ''${PATH//:/ } -maxdepth 1 -type f -perm -u=x -print0 |
|
||||||
|
while read -d ''' -r cmd; do
|
||||||
|
cmd=''${cmd//\/\\\\}
|
||||||
|
cmd=''${cmd//{/\\{}
|
||||||
|
cmd=''${cmd//[/\\[}
|
||||||
|
cmd=''${cmd//(/\\(}
|
||||||
|
cmd=''${cmd//)/\\)}
|
||||||
|
cmd=''${cmd//+/\\+}
|
||||||
|
cmd=''${cmd//\*/\\*}
|
||||||
|
cmd=''${cmd//\?/\\?}
|
||||||
|
cmd=''${cmd//!/\\!}
|
||||||
|
echo 's!(^|[[:space:]({>`'\'''";|,=@\!]|&&|\|\|)(/usr)?/bin/'"''${cmd##*/}"'($|[[:space:])}<`'\'''";|,]|&&|\|\|)!\1'"$cmd"'\3!g'
|
||||||
|
done >> commands.sed
|
||||||
|
find c++ -type f -print0 | xargs -0 -n 16 -P $NIX_BUILD_CORES \
|
||||||
|
sed -i -E \
|
||||||
|
-e '/ *PATH=['\'''"]?\/bin:\/usr\/bin/d' \
|
||||||
|
-e 's!/bin/(\$base_action|\$LN_S)!\1!g' \
|
||||||
|
-f commands.sed
|
||||||
|
'';
|
||||||
|
|
||||||
|
# AR command variable is abused to include parameters, but these don't get figured out if $AR is already set
|
||||||
|
preConfigure = ''
|
||||||
|
cd c++
|
||||||
|
test -n "$AR" && AR="$AR cr" || true
|
||||||
|
'';
|
||||||
|
|
||||||
|
configureFlags = "--with-dll --without-debug --with-bin-release --with-strip --with-mt --without-opengl --without-connext";
|
||||||
|
|
||||||
|
buildInputs = [
|
||||||
|
boost
|
||||||
|
zlib
|
||||||
|
bzip2
|
||||||
|
cpio
|
||||||
|
curl
|
||||||
|
python
|
||||||
|
# python3 -- some scripts like ./c++/scripts/projects/magicblast/post_build/blast_utils.py
|
||||||
|
perl
|
||||||
|
];
|
||||||
|
|
||||||
|
meta = with stdenv.lib; {
|
||||||
|
homepage = https://blast.ncbi.nlm.nih.gov/;
|
||||||
|
description = "BLAST finds regions of similarity between biological sequences. The program compares nucleotide or protein sequences to sequence databases and calculates the statistical significance.";
|
||||||
|
platforms = platforms.all;
|
||||||
|
license = licenses.publicDomain;
|
||||||
|
};
|
||||||
|
|
||||||
|
enableParallelBuilding = true;
|
||||||
|
}
|
||||||
16
pkgs/blast/install.patch
Normal file
16
pkgs/blast/install.patch
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
--- ncbi-blast-2.6.0+-src/c++/src/build-system/Makefile.in.top_ 2018-04-23 16:13:57.759988900 -0400
|
||||||
|
+++ ncbi-blast-2.6.0+-src/c++/src/build-system/Makefile.in.top 2018-04-23 16:14:38.270252707 -0400
|
||||||
|
@@ -49,9 +49,10 @@
|
||||||
|
for x in *.a; do \
|
||||||
|
$(LN_S) "$$x" "`$(BASENAME) \"$$x\" .a`-static.a"; \
|
||||||
|
done
|
||||||
|
- cd $(includedir0) && find * -name CVS -prune -o -print |\
|
||||||
|
- cpio -pd $(pincludedir)
|
||||||
|
- $(INSTALL) -m 644 $(incdir)/* $(pincludedir)
|
||||||
|
+ cd $(includedir0) && find * -type f \( -name '*.inl' -o -name '*.h' -o -name '*.hpp' -o -name '*.c' \) \
|
||||||
|
+ -exec $(INSTALL) -m 644 -D \{\} $(pincludedir)/\{\} \;
|
||||||
|
+ cd $(incdir) && find * -type f \( -name '*.inl' -o -name '*.h' -o -name '*.hpp' -o -name '*.c' \) \
|
||||||
|
+ -exec $(INSTALL) -m 644 -D \{\} $(pincludedir)/\{\} \;
|
||||||
|
## set up appropriate build and status directories somewhere under $(libdir)?
|
||||||
|
|
||||||
|
install-gbench:
|
||||||
Reference in New Issue
Block a user