summary refs log tree commit diff
path: root/pkgs/applications
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2023-10-21 06:00:57 +0000
committerGitHub <noreply@github.com>2023-10-21 06:00:57 +0000
commit1c4183d88a7857526ee4a62e45aa0c203d56b1de (patch)
tree62791f17daa58a7cc65a23d255fd06d73c36ba96 /pkgs/applications
parentfb3e2499b78f73e27cc256bc3516abeb822654bd (diff)
parent171a116a56485ec6c511c571d0fdc18374924ad6 (diff)
downloadnixpkgs-1c4183d88a7857526ee4a62e45aa0c203d56b1de.tar
nixpkgs-1c4183d88a7857526ee4a62e45aa0c203d56b1de.tar.gz
nixpkgs-1c4183d88a7857526ee4a62e45aa0c203d56b1de.tar.bz2
nixpkgs-1c4183d88a7857526ee4a62e45aa0c203d56b1de.tar.lz
nixpkgs-1c4183d88a7857526ee4a62e45aa0c203d56b1de.tar.xz
nixpkgs-1c4183d88a7857526ee4a62e45aa0c203d56b1de.tar.zst
nixpkgs-1c4183d88a7857526ee4a62e45aa0c203d56b1de.zip
Merge master into staging-next
Diffstat (limited to 'pkgs/applications')
-rw-r--r--pkgs/applications/science/biology/bowtie2/default.nix52
1 files changed, 44 insertions, 8 deletions
diff --git a/pkgs/applications/science/biology/bowtie2/default.nix b/pkgs/applications/science/biology/bowtie2/default.nix
index e5c9c286422..356e90555f8 100644
--- a/pkgs/applications/science/biology/bowtie2/default.nix
+++ b/pkgs/applications/science/biology/bowtie2/default.nix
@@ -1,26 +1,62 @@
-{ lib, stdenv, fetchFromGitHub, cmake, tbb, zlib, python3, perl }:
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, perl
+, python3
+, tbb
+, zlib
+, runCommand
+, bowtie2
+}:
 
-stdenv.mkDerivation rec {
+stdenv.mkDerivation (finalAttrs: {
   pname = "bowtie2";
   version = "2.5.2";
 
   src = fetchFromGitHub {
     owner = "BenLangmead";
-    repo = pname;
-    rev = "v${version}";
-    sha256 = "sha256-Bem4SHY/74suZPDbw/rwKMLBn3bRq5ooHbBoVnKuYk0=";
+    repo = "bowtie2";
+    rev = "refs/tags/v${finalAttrs.version}";
+    fetchSubmodules = true;
+    hash = "sha256-rWeopeYuCk9ZhJX2SFCcxZWcjXjjTiVRiwkzLQcIgd0=";
   };
 
+  # because of this flag, gcc on aarch64 cannot find the Threads
+  # Could NOT find Threads (missing: Threads_FOUND)
+  # TODO: check with other distros and report upstream
+  postPatch = ''
+    substituteInPlace CMakeLists.txt \
+      --replace "-m64" ""
+  '';
+
   nativeBuildInputs = [ cmake ];
 
   buildInputs = [ tbb zlib python3 perl ];
 
+  cmakeFlags = lib.optional (!stdenv.hostPlatform.isx86) ["-DCMAKE_CXX_FLAGS=-I${finalAttrs.src}/third_party"];
+
+  # ctest fails because of missing dependencies between tests
+  doCheck = false;
+
+  passthru.tests = {
+    ctest = runCommand "${finalAttrs.pname}-test" { } ''
+      mkdir $out
+      ${lib.getExe bowtie2} -x ${finalAttrs.src}/example/index/lambda_virus ${finalAttrs.src}/example/reads/longreads.fq -u 10
+      ${bowtie2}/bin/bowtie2-build-s -c GGGCGGCGACCTCGCGGGTTTTCGCTA $out/small
+      ${bowtie2}/bin/bowtie2-inspect-s $out/small
+      ${bowtie2}/bin/bowtie2-build-l -c GGGCGGCGACCTCGCGGGTTTTCGCTA $out/large
+      ${bowtie2}/bin/bowtie2-inspect-l $out/large
+    '';
+  };
+
   meta = with lib; {
     description = "An ultrafast and memory-efficient tool for aligning sequencing reads to long reference sequences";
-    license = licenses.gpl3;
+    license = licenses.gpl3Plus;
     homepage = "http://bowtie-bio.sf.net/bowtie2";
+    changelog = "https://github.com/BenLangmead/bowtie2/releases/tag/${finalAttrs.src.rev}";
     maintainers = with maintainers; [ rybern ];
     platforms = platforms.all;
-    broken = stdenv.isAarch64; # only x86 is supported
+    mainProgram = "bowtie2";
   };
-}
+})