nixpkgs/pkgs/by-name/bo/bowtie2/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

63 lines
1.8 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, cmake
, perl
, python3
, tbb
, zlib
, runCommand
, bowtie2
}:
stdenv.mkDerivation (finalAttrs: {
pname = "bowtie2";
version = "2.5.4";
src = fetchFromGitHub {
owner = "BenLangmead";
repo = "bowtie2";
rev = "refs/tags/v${finalAttrs.version}";
fetchSubmodules = true;
hash = "sha256-ZbmVOItfAgKdsMrvQIXgKiPtoQJZYfGblCGDoNPjvTU=";
};
# 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 = "Ultrafast and memory-efficient tool for aligning sequencing reads to long reference sequences";
license = licenses.gpl3Plus;
homepage = "http://bowtie-bio.sf.net/bowtie2";
changelog = "https://github.com/BenLangmead/bowtie2/releases/tag/${lib.removePrefix "refs/tags/" finalAttrs.src.rev}";
maintainers = with maintainers; [ rybern ];
platforms = platforms.all;
mainProgram = "bowtie2";
};
})