diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index d89688b15cba..a257ec9d5b3f 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -5753,6 +5753,12 @@ githubId = 4162215; keys = [ { fingerprint = "CE97 9DEE 904C 26AA 3716 78C2 96A4 38F9 EE72 572F"; } ]; }; + croots = { + name = "Cameron Roots"; + github = "croots"; + githubId = 38054423; + keys = [ { fingerprint = "8496 ECF3 0961 115C A6DE 919F A01D C430 0605 1618"; } ]; + }; crop = { email = "crop_tech@proton.me"; name = "crop"; diff --git a/pkgs/by-name/br/breseq/package.nix b/pkgs/by-name/br/breseq/package.nix new file mode 100644 index 000000000000..589c5ddeed20 --- /dev/null +++ b/pkgs/by-name/br/breseq/package.nix @@ -0,0 +1,94 @@ +{ + stdenv, + lib, + fetchFromGitHub, + callPackage, + nix-update-script, + libz, + libtool, + perl, + R, + bowtie2, + which, + ghostscript, + makeWrapper, + autoreconfHook, + versionCheckHook, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "breseq"; + version = "0.39.0"; + + strictDeps = true; + __structuredAttrs = true; + + src = fetchFromGitHub { + owner = "barricklab"; + repo = "breseq"; + tag = "v${finalAttrs.version}"; + hash = "sha256-DsDX2oGn7Ex50Wnp1phJjCziCzZIeeZOHriUGJbejsk="; + }; + + buildInputs = [ + perl + libz + libtool + ]; + + nativeBuildInputs = [ + makeWrapper + autoreconfHook + ]; + + postInstall = '' + # Make wrappers + wrapProgram $out/bin/breseq --prefix PATH : ${ + lib.makeBinPath [ + which + ghostscript + bowtie2 + R + ] + } + wrapProgram $out/bin/gdtools --prefix PATH : ${ + lib.makeBinPath [ + which + ghostscript + bowtie2 + R + ] + } + # Copy over tests (incl necessary datasets) and license + cp LICENSE $out/license + mkdir $out/tests + mkdir $out/tests/data + cp tests/data/tmv_plasmid $out/tests/data/tmv_plasmid -r + cp tests/data/lambda $out/tests/data/lambda -r + cp tests/common.sh $out/tests/common.sh + cp tests/tmv_plasmid_circular_deletion $out/tests/tmv_plasmid_circular_deletion -r + cp tests/gdtools_compare_1 $out/tests/gdtools_compare_1 -r + ''; + + nativeInstallCheckInputs = [ + versionCheckHook + ]; + doInstallCheck = true; + + passthru.tests = { + breseq_works = callPackage ./tests/breseq.nix { }; + gdtools_works = callPackage ./tests/gdtools.nix { }; + }; + passthru.updateScript = nix-update-script { }; + + meta = { + description = "Computational pipeline for finding mutations relative to a reference sequence in short-read DNA re-sequencing data"; + mainProgram = "breseq"; + homepage = "https://github.com/barricklab/breseq"; + license = with lib.licenses; [ + gpl2Plus # See barricklab/breseq#398 + ]; + maintainers = with lib.maintainers; [ croots ]; + platforms = lib.platforms.all; + }; +}) diff --git a/pkgs/by-name/br/breseq/tests/breseq.nix b/pkgs/by-name/br/breseq/tests/breseq.nix new file mode 100644 index 000000000000..0b0975206373 --- /dev/null +++ b/pkgs/by-name/br/breseq/tests/breseq.nix @@ -0,0 +1,21 @@ +{ + runCommand, + breseq, +}: + +let + inherit (breseq) pname version; +in + +runCommand "breseq-tests" { meta.timeout = 60; } '' + echo "Testing breseq - breseq executable" + export TESTBINPREFIX=${breseq}/bin + cp ${breseq}/tests $PWD/breseqtests -r + chmod -R +w $PWD/breseqtests + output=$($PWD/breseqtests/tmv_plasmid_circular_deletion/testcmd.sh 2>&1) || { + echo "$output" + echo "Error testing breseq - breseq executable" + exit 1 + } + touch $out +'' diff --git a/pkgs/by-name/br/breseq/tests/gdtools.nix b/pkgs/by-name/br/breseq/tests/gdtools.nix new file mode 100644 index 000000000000..fbb78e221d97 --- /dev/null +++ b/pkgs/by-name/br/breseq/tests/gdtools.nix @@ -0,0 +1,21 @@ +{ + runCommand, + breseq, +}: + +let + inherit (breseq) pname version; +in + +runCommand "breseq-tests" { meta.timeout = 60; } '' + echo "Testing breseq - gdtools executable" + export TESTBINPREFIX=${breseq}/bin + cp ${breseq}/tests $PWD/breseqtests -r + chmod -R +w $PWD/breseqtests + output=$($PWD/breseqtests/gdtools_compare_1/testcmd.sh 2>&1) || { + echo "$output" + echo "Error testing breseq - gdtools executable" + exit 1 + } + touch $out +''