From 3ec130156ecc251cc64a77bf050b184fbc38bedd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Bori?= Date: Tue, 28 Apr 2026 21:40:38 +0200 Subject: [PATCH] phylophlan: cleanup the nix declaration --- pkgs/by-name/ph/phylophlan/package.nix | 97 +++++++++++++------------- 1 file changed, 50 insertions(+), 47 deletions(-) diff --git a/pkgs/by-name/ph/phylophlan/package.nix b/pkgs/by-name/ph/phylophlan/package.nix index 78b307e46972..729c93d9fcbf 100644 --- a/pkgs/by-name/ph/phylophlan/package.nix +++ b/pkgs/by-name/ph/phylophlan/package.nix @@ -8,60 +8,63 @@ diamond, python3Packages, }: -let - finalAttrs = { - pname = "phylophlan"; - version = "3.2.1"; - pyproject = true; - src = fetchFromGitHub { - owner = "biobakery"; - repo = "phylophlan"; - tag = finalAttrs.version; - hash = "sha256-rPTEdu0W3LD27tDIWCOQ3K+RJuj97I9aEeYFdM77jOs="; - }; +python3Packages.buildPythonApplication (finalAttrs: { + pname = "phylophlan"; + version = "3.2.1"; + pyproject = true; - build-system = with python3Packages; [ setuptools ]; + src = fetchFromGitHub { + owner = "biobakery"; + repo = "phylophlan"; + tag = finalAttrs.version; + hash = "sha256-rPTEdu0W3LD27tDIWCOQ3K+RJuj97I9aEeYFdM77jOs="; + }; - # It has no tests - doCheck = false; + build-system = with python3Packages; [ setuptools ]; - dependencies = with python3Packages; [ - biopython - dendropy - matplotlib - numpy - pandas - seaborn - distutils - requests - scipy - tqdm - ]; + # It has no tests + doCheck = false; + dependencies = with python3Packages; [ + biopython + dendropy + matplotlib + numpy + pandas + seaborn + distutils + requests + scipy + tqdm + ]; + + preFixup = '' # Minimum needed external tools # See https://github.com/biobakery/phylophlan/wiki#dependencies - propagatedBuildInputs = [ - raxml - mafft - trimal - blast - diamond - ]; + makeWrapperArgs+=(--prefix PATH : ${ + lib.makeBinPath [ + raxml + mafft + trimal + blast + diamond + ] + } + ) + ''; - postInstall = '' - # Not revelant in this context - rm -f $out/bin/phylophlan_write_default_configs.sh - ''; + postInstall = '' + # Not revelant in this context + rm -f $out/bin/phylophlan_write_default_configs.sh + ''; - meta = { - homepage = "https://github.com/biobakery/phylophlan"; - description = "Precise phylogenetic analysis of microbial isolates and genomes from metagenomes"; - changelog = "https://github.com/biobakery/phylophlan/releases"; - license = lib.licenses.mit; - maintainers = with lib.maintainers; [ theobori ]; - mainProgram = "phylophlan"; - }; + meta = { + homepage = "https://github.com/biobakery/phylophlan"; + description = "Precise phylogenetic analysis of microbial isolates and genomes from metagenomes"; + changelog = "https://github.com/biobakery/phylophlan/releases"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ theobori ]; + mainProgram = "phylophlan"; }; -in -python3Packages.buildPythonApplication finalAttrs +})