From fdc1ddd305b92850fdf8e2ad1c06bf8f6dc26916 Mon Sep 17 00:00:00 2001 From: natsukium Date: Fri, 14 Jul 2023 16:38:10 +0900 Subject: [PATCH 1/3] kssd: 1.1 -> 2.21 Diff: https://github.com/yhg926/public_kssd/compare/v1.1...v2.21 --- pkgs/applications/science/biology/kssd/default.nix | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/pkgs/applications/science/biology/kssd/default.nix b/pkgs/applications/science/biology/kssd/default.nix index 34d997252f5b..579042ec50bc 100644 --- a/pkgs/applications/science/biology/kssd/default.nix +++ b/pkgs/applications/science/biology/kssd/default.nix @@ -2,22 +2,21 @@ stdenv.mkDerivation rec { pname = "kssd"; - version = "1.1"; + version = "2.21"; src = fetchFromGitHub { owner = "yhg926"; repo = "public_kssd"; rev = "v${version}"; - sha256 = "sha256-8jzYqo9LXF66pQ1EIusm+gba2VbTYpJz2K3NVlA3QxY="; + hash = "sha256-D/s1jL2oKE0rSdRMVljskYFsw5UPOv1L95Of+K+e17w="; }; patches = [ - # Pull upstream patch for -fno-common toolchain support: - # https://github.com/yhg926/public_kssd/pull/9 + # https://github.com/yhg926/public_kssd/pull/11 (fetchpatch { - name = "fno-common.patch"; - url = "https://github.com/yhg926/public_kssd/commit/cdd1e8aae256146f5913a3b4c723b638d53bdf27.patch"; - sha256 = "sha256-HhaTRqPfKR+ouh0PwEH6u22pbuqbX2OypRzw8BXm0W4="; + name = "allocate-enough-memory.patch"; + url = "https://github.com/yhg926/public_kssd/commit/b1e66bbcc04687bc3201301cd742a0b26a87cb5d.patch"; + hash = "sha256-yFyJetpsGKeu+H6Oxrmn5ea4ESVtblb3YJDja4JEAEM="; }) ]; From 847c506eaece0913d4ca995e34bd4c84bac1cb19 Mon Sep 17 00:00:00 2001 From: natsukium Date: Fri, 14 Jul 2023 17:29:33 +0900 Subject: [PATCH 2/3] kssd: refactor --- .../science/biology/kssd/default.nix | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/pkgs/applications/science/biology/kssd/default.nix b/pkgs/applications/science/biology/kssd/default.nix index 579042ec50bc..200b70458ed3 100644 --- a/pkgs/applications/science/biology/kssd/default.nix +++ b/pkgs/applications/science/biology/kssd/default.nix @@ -1,13 +1,18 @@ -{ lib, stdenv, fetchFromGitHub, fetchpatch, zlib, automake, autoconf, libtool }: +{ lib +, stdenv +, fetchFromGitHub +, fetchpatch +, zlib +}: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "kssd"; version = "2.21"; src = fetchFromGitHub { owner = "yhg926"; repo = "public_kssd"; - rev = "v${version}"; + rev = "v${finalAttrs.version}"; hash = "sha256-D/s1jL2oKE0rSdRMVljskYFsw5UPOv1L95Of+K+e17w="; }; @@ -20,11 +25,14 @@ stdenv.mkDerivation rec { }) ]; - nativeBuildInputs = [ autoconf automake ]; - buildInputs = [ zlib libtool ]; + buildInputs = [ zlib ]; installPhase = '' - install -vD kssd $out/bin/kssd + runHook preInstall + + install -vD kssd $out/bin/kssd + + runHook postInstall ''; meta = with lib; { @@ -33,5 +41,6 @@ stdenv.mkDerivation rec { homepage = "https://github.com/yhg926/public_kssd"; maintainers = with maintainers; [ unode ]; platforms = [ "x86_64-linux" ]; + mainProgram = "kssd"; }; -} +}) From 10c3a4062187989d425cd4b0e8ef7e59377e1b6d Mon Sep 17 00:00:00 2001 From: natsukium Date: Fri, 3 Nov 2023 18:00:30 +0900 Subject: [PATCH 3/3] kssd: enable aarch64-linux support & tests --- pkgs/applications/science/biology/kssd/default.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/science/biology/kssd/default.nix b/pkgs/applications/science/biology/kssd/default.nix index 200b70458ed3..8f60b8b991ed 100644 --- a/pkgs/applications/science/biology/kssd/default.nix +++ b/pkgs/applications/science/biology/kssd/default.nix @@ -3,6 +3,8 @@ , fetchFromGitHub , fetchpatch , zlib +, kssd +, runCommand }: stdenv.mkDerivation (finalAttrs: { @@ -35,12 +37,21 @@ stdenv.mkDerivation (finalAttrs: { runHook postInstall ''; + passthru.tests = { + simple = runCommand "${finalAttrs.pname}-test" { } '' + mkdir $out + ${lib.getExe kssd} dist -L ${kssd.src}/shuf_file/L3K10.shuf -r ${kssd.src}/test_fna/seqs1 -o $out/reference + ${lib.getExe kssd} dist -L ${kssd.src}/shuf_file/L3K10.shuf -o $out/query ${kssd.src}/test_fna/seqs2 + ${lib.getExe kssd} dist -r $out/reference -o $out/distout $out/query + ''; + }; + meta = with lib; { description = "K-mer substring space decomposition"; license = licenses.asl20; homepage = "https://github.com/yhg926/public_kssd"; maintainers = with maintainers; [ unode ]; - platforms = [ "x86_64-linux" ]; + platforms = platforms.linux; mainProgram = "kssd"; }; })