From 84726cfe4263043e3c55290680c6e47dfc3d9e9d Mon Sep 17 00:00:00 2001 From: natsukium Date: Thu, 2 May 2024 16:59:53 +0900 Subject: [PATCH] fastahack: init at 1.0.0 --- pkgs/by-name/fa/fastahack/package.nix | 43 +++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 pkgs/by-name/fa/fastahack/package.nix diff --git a/pkgs/by-name/fa/fastahack/package.nix b/pkgs/by-name/fa/fastahack/package.nix new file mode 100644 index 000000000000..ed8f342007ba --- /dev/null +++ b/pkgs/by-name/fa/fastahack/package.nix @@ -0,0 +1,43 @@ +{ + lib, + stdenv, + fetchFromGitHub, + runCommand, + fastahack, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "fastahack"; + version = "1.0.0"; + + src = fetchFromGitHub { + owner = "ekg"; + repo = "fastahack"; + rev = "refs/tags/v${finalAttrs.version}"; + hash = "sha256-SWu2iRwNgdhsn4sH9/3jPNG3+l1xFAHXPq5/ODVd4WY="; + }; + + installFlags = [ "PREFIX=${placeholder "out"}" ]; + + passthru.tests = { + simple = runCommand "${finalAttrs.pname}-test" { } '' + mkdir $out + cp ${fastahack.src}/tests/* $out + grep -v ERROR <(${lib.getExe fastahack} $out/correct.fasta 2>&1) + grep -v ERROR <(${lib.getExe fastahack} $out/crlf.fasta 2>&1) + grep "ERROR: embedded newline " <(${lib.getExe fastahack} $out/embedded_newline.fasta 2>&1) + grep "ERROR: mismatched line lengths" <(${lib.getExe fastahack} $out/mismatched_lines.fasta 2>&1) + grep -v ERROR <(${lib.getExe fastahack} $out/trailing_newlines.fasta 2>&1) + ''; + }; + + meta = { + description = "Utilities for indexing and sequence extraction from FASTA files"; + homepage = "https://github.com/ekg/fastahack"; + changelog = "https://github.com/ekg/fastahack/releases/tag/v${finalAttrs.version}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ natsukium ]; + mainProgram = "fastahack"; + platforms = lib.platforms.unix; + }; +})