nixpkgs/pkgs/by-name/ks/kssd/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

58 lines
1.4 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, fetchpatch
, zlib
, kssd
, runCommand
}:
stdenv.mkDerivation (finalAttrs: {
pname = "kssd";
version = "2.21";
src = fetchFromGitHub {
owner = "yhg926";
repo = "public_kssd";
rev = "v${finalAttrs.version}";
hash = "sha256-D/s1jL2oKE0rSdRMVljskYFsw5UPOv1L95Of+K+e17w=";
};
patches = [
# https://github.com/yhg926/public_kssd/pull/11
(fetchpatch {
name = "allocate-enough-memory.patch";
url = "https://github.com/yhg926/public_kssd/commit/b1e66bbcc04687bc3201301cd742a0b26a87cb5d.patch";
hash = "sha256-yFyJetpsGKeu+H6Oxrmn5ea4ESVtblb3YJDja4JEAEM=";
})
];
buildInputs = [ zlib ];
installPhase = ''
runHook preInstall
install -vD kssd $out/bin/kssd
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 = platforms.linux;
mainProgram = "kssd";
};
})