From f6e2b681222f4b06ca45f7299890e89f3c3ee465 Mon Sep 17 00:00:00 2001 From: natsukium Date: Fri, 14 Jul 2023 11:02:10 +0900 Subject: [PATCH 1/2] paml: 4.9j -> 4.10.7 Diff: https://github.com/abacus-gene/paml/compare/d59d538939422a31d8a0f23822c1ddb072409bfd...4.10.7 Changelog: https://github.com/abacus-gene/paml/releases/tag/4.10.7 --- .../science/biology/paml/default.nix | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/pkgs/applications/science/biology/paml/default.nix b/pkgs/applications/science/biology/paml/default.nix index 871c76dc6e31..fc61caea458f 100644 --- a/pkgs/applications/science/biology/paml/default.nix +++ b/pkgs/applications/science/biology/paml/default.nix @@ -1,22 +1,22 @@ -{stdenv, fetchurl}: +{lib, stdenv, fetchFromGitHub}: stdenv.mkDerivation rec { - version = "4.9j"; pname = "paml"; - src = fetchurl { - url = "http://abacus.gene.ucl.ac.uk/software/paml${version}.tgz"; - sha256 = "0qflf3i27x6jwks3c6q560m1q8r043ja96syah145113iz5wdalp"; + version = "4.10.7"; + + src = fetchFromGitHub { + owner = "abacus-gene"; + repo = "paml"; + rev = "refs/tags/${version}"; + hash = "sha256-P/oHaLxoQzjFuvmHyRdShHv1ayruy6O/I9w8aTyya2s="; }; - # Workaround build failure on -fno-common toolchains like upstream - # gcc-10. Otherwise build fails as: - # ld: /build/ccKomtcd.o:(.bss+0x4544): multiple definition of `SeqTypes'; - # /build/ccx7EsgU.o:(.bss+0x2a0dfdc): first defined here - env.NIX_CFLAGS_COMPILE = "-fcommon"; + env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-D_POSIX_C_SOURCE"; preBuild = '' cd ./src/ ''; + installPhase = '' mkdir -pv $out/bin cp -v codeml $out/bin @@ -33,7 +33,7 @@ stdenv.mkDerivation rec { meta = { description = "Phylogenetic Analysis by Maximum Likelihood (PAML)"; longDescription = "PAML is a package of programs for phylogenetic analyses of DNA or protein sequences using maximum likelihood. It is maintained and distributed for academic use free of charge by Ziheng Yang. ANSI C source codes are distributed for UNIX/Linux/Mac OSX, and executables are provided for MS Windows. PAML is not good for tree making. It may be used to estimate parameters and test hypotheses to study the evolutionary process, when you have reconstructed trees using other programs such as PAUP*, PHYLIP, MOLPHY, PhyML, RaxML, etc."; - license = "non-commercial"; + license = lib.licenses.gpl3Only; homepage = "http://abacus.gene.ucl.ac.uk/software/paml.html"; }; } From d2c506948b538b6c0b178e6db59aad47a747f831 Mon Sep 17 00:00:00 2001 From: natsukium Date: Fri, 14 Jul 2023 11:06:19 +0900 Subject: [PATCH 2/2] paml: refactor --- .../science/biology/paml/default.nix | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/science/biology/paml/default.nix b/pkgs/applications/science/biology/paml/default.nix index fc61caea458f..c593b5ed3d34 100644 --- a/pkgs/applications/science/biology/paml/default.nix +++ b/pkgs/applications/science/biology/paml/default.nix @@ -1,13 +1,16 @@ -{lib, stdenv, fetchFromGitHub}: +{ lib +, stdenv +, fetchFromGitHub +}: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "paml"; version = "4.10.7"; src = fetchFromGitHub { owner = "abacus-gene"; repo = "paml"; - rev = "refs/tags/${version}"; + rev = "refs/tags/${finalAttrs.version}"; hash = "sha256-P/oHaLxoQzjFuvmHyRdShHv1ayruy6O/I9w8aTyya2s="; }; @@ -18,6 +21,8 @@ stdenv.mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -pv $out/bin cp -v codeml $out/bin cp -v baseml $out/bin @@ -28,6 +33,8 @@ stdenv.mkDerivation rec { cp -v mcmctree $out/bin cp -v pamp $out/bin cp -v yn00 $out/bin + + runHook postInstall ''; meta = { @@ -35,5 +42,7 @@ stdenv.mkDerivation rec { longDescription = "PAML is a package of programs for phylogenetic analyses of DNA or protein sequences using maximum likelihood. It is maintained and distributed for academic use free of charge by Ziheng Yang. ANSI C source codes are distributed for UNIX/Linux/Mac OSX, and executables are provided for MS Windows. PAML is not good for tree making. It may be used to estimate parameters and test hypotheses to study the evolutionary process, when you have reconstructed trees using other programs such as PAUP*, PHYLIP, MOLPHY, PhyML, RaxML, etc."; license = lib.licenses.gpl3Only; homepage = "http://abacus.gene.ucl.ac.uk/software/paml.html"; + changelog = "https://github.com/abacus-gene/paml/releases/tag/${finalAttrs.src.rev}"; + platforms = lib.platforms.unix; }; -} +})