about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/science/biology/blast/bin.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/science/biology/blast/bin.nix')
-rw-r--r--nixpkgs/pkgs/applications/science/biology/blast/bin.nix61
1 files changed, 61 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/science/biology/blast/bin.nix b/nixpkgs/pkgs/applications/science/biology/blast/bin.nix
new file mode 100644
index 000000000000..48537a568e4b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/blast/bin.nix
@@ -0,0 +1,61 @@
+{ lib
+, stdenv
+, fetchurl
+, python3
+, perl
+, blast
+, autoPatchelfHook
+, zlib
+, bzip2
+, glib
+, libxml2
+, coreutils
+}:
+let
+  pname = "blast-bin";
+  version = "2.14.1";
+
+  srcs = rec {
+    x86_64-linux = fetchurl {
+      url = "https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/${version}/ncbi-blast-${version}+-x64-linux.tar.gz";
+      hash = "sha256-OO8MNOk6k0J9FlAGyCOhP+hirEIT6lL+rIInB8dQWEU=";
+    };
+    aarch64-linux = fetchurl {
+      url = "https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/${version}/ncbi-blast-${version}+-aarch64-linux.tar.gz";
+      hash = "sha256-JlOyoxZQBbvUcHIMv5muTuGQgrh2uom3rzDurhHQ+FM=";
+    };
+    x86_64-darwin = fetchurl {
+      url = "https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/${version}/ncbi-blast-${version}+-x64-macosx.tar.gz";
+      hash = "sha256-eMfuwMCD6VlDgeshLslDhYBBp0YOpL+6q/zSchR0bAs=";
+    };
+    aarch64-darwin = x86_64-darwin;
+  };
+  src = srcs.${stdenv.hostPlatform.system};
+in
+stdenv.mkDerivation {
+  inherit pname version src;
+
+  nativeBuildInputs = lib.optionals stdenv.isLinux [ autoPatchelfHook ];
+
+  buildInputs = [ python3 perl ] ++ lib.optionals stdenv.isLinux [ zlib bzip2 glib libxml2 ];
+
+  installPhase = ''
+    runHook preInstall
+
+    install -Dm755 bin/* -t $out/bin
+
+    runHook postInstall
+  '';
+
+  preFixup = ''
+    substituteInPlace $out/bin/get_species_taxids.sh \
+      --replace /bin/rm ${coreutils}/bin/rm
+  '';
+
+  meta = with lib; {
+    inherit (blast.meta) description homepage license;
+    platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
+    sourceProvenance = with sourceTypes; [ binaryNativeCode ];
+    maintainers = with maintainers; [ natsukium ];
+  };
+}