From bb317093e86714c78a21f57f2480da513544eb8f Mon Sep 17 00:00:00 2001 From: natsukium Date: Thu, 8 Jun 2023 12:15:17 +0900 Subject: [PATCH 1/2] aragorn: 1.2.38 -> 1.2.41 - change the source and homepage - change the license --- .../science/biology/aragorn/default.nix | 28 +++++++++++++------ 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/pkgs/applications/science/biology/aragorn/default.nix b/pkgs/applications/science/biology/aragorn/default.nix index fa0c10b00c20..4d5b3a4d017a 100644 --- a/pkgs/applications/science/biology/aragorn/default.nix +++ b/pkgs/applications/science/biology/aragorn/default.nix @@ -1,27 +1,39 @@ -{ lib, stdenv, fetchurl }: +{ lib, stdenv, fetchurl, installShellFiles }: +let + man = fetchurl { + url = "https://web.archive.org/web/20230608093053if_/http://www.ansikte.se/ARAGORN/Downloads/aragorn.1"; + hash = "sha256-bjD22dpkQZcGR0TwMxdpaed4VZZO2NUOoAw4o66iyS4="; + }; +in stdenv.mkDerivation rec { - version = "1.2.38"; + version = "1.2.41"; pname = "aragorn"; src = fetchurl { - url = "http://mbio-serv2.mbioekol.lu.se/ARAGORN/Downloads/${pname}${version}.tgz"; - sha256 = "09i1rg716smlbnixfm7q1ml2mfpaa2fpn3hwjg625ysmfwwy712b"; + url = "http://www.ansikte.se/ARAGORN/Downloads/aragorn${version}.c"; + hash = "sha256-kqMcxcCwrRbU17AZkZibd18H0oFd8TX+bj6riPXpf0o="; }; + dontUnpack = true; + + nativeBuildInputs = [ + installShellFiles + ]; + buildPhase = '' - $CC -O3 -ffast-math -finline-functions -o aragorn aragorn${version}.c + $CC -O3 -ffast-math -finline-functions -o aragorn $src ''; installPhase = '' mkdir -p $out/bin && cp aragorn $out/bin - mkdir -p $out/man/1 && cp aragorn.1 $out/man/1 + installManPage ${man} ''; meta = with lib; { description = "Detects tRNA, mtRNA, and tmRNA genes in nucleotide sequences"; - homepage = "http://mbio-serv2.mbioekol.lu.se/ARAGORN/"; - license = licenses.gpl2; + homepage = "http://www.ansikte.se/ARAGORN/"; + license = licenses.gpl3Plus; maintainers = [ maintainers.bzizou ]; platforms = platforms.unix; }; From 597e4e8652452df886c863c4ccc671ddb491ecae Mon Sep 17 00:00:00 2001 From: natsukium Date: Thu, 8 Jun 2023 12:20:21 +0900 Subject: [PATCH 2/2] aragorn: fix format - use finalAttrs instead of rec - add runHook --- .../science/biology/aragorn/default.nix | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/science/biology/aragorn/default.nix b/pkgs/applications/science/biology/aragorn/default.nix index 4d5b3a4d017a..4ee8501e8e13 100644 --- a/pkgs/applications/science/biology/aragorn/default.nix +++ b/pkgs/applications/science/biology/aragorn/default.nix @@ -1,4 +1,8 @@ -{ lib, stdenv, fetchurl, installShellFiles }: +{ lib +, stdenv +, fetchurl +, installShellFiles +}: let man = fetchurl { url = "https://web.archive.org/web/20230608093053if_/http://www.ansikte.se/ARAGORN/Downloads/aragorn.1"; @@ -6,12 +10,12 @@ let }; in -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { version = "1.2.41"; pname = "aragorn"; src = fetchurl { - url = "http://www.ansikte.se/ARAGORN/Downloads/aragorn${version}.c"; + url = "http://www.ansikte.se/ARAGORN/Downloads/aragorn${finalAttrs.version}.c"; hash = "sha256-kqMcxcCwrRbU17AZkZibd18H0oFd8TX+bj6riPXpf0o="; }; @@ -22,12 +26,20 @@ stdenv.mkDerivation rec { ]; buildPhase = '' + runHook preBuild + $CC -O3 -ffast-math -finline-functions -o aragorn $src + + runHook postBuild ''; installPhase = '' + runHook preInstall + mkdir -p $out/bin && cp aragorn $out/bin installManPage ${man} + + runHook postInstall ''; meta = with lib; { @@ -37,4 +49,4 @@ stdenv.mkDerivation rec { maintainers = [ maintainers.bzizou ]; platforms = platforms.unix; }; -} +})