From 057496d1b240d2ce5670979cbacb9700eb91d600 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Fri, 15 Sep 2023 18:00:47 -0300 Subject: [PATCH] algol68g: refactor - finalAttrs - add withPDFDoc option - split output --- pkgs/by-name/al/algol68g/package.nix | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/pkgs/by-name/al/algol68g/package.nix b/pkgs/by-name/al/algol68g/package.nix index 6bbd51717a59..05e57ff3da2c 100644 --- a/pkgs/by-name/al/algol68g/package.nix +++ b/pkgs/by-name/al/algol68g/package.nix @@ -4,17 +4,20 @@ , gsl , plotutils , postgresql +, withPDFDoc ? true }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "algol68g"; version = "2.8.4"; src = fetchurl { - url = "https://jmvdveer.home.xs4all.nl/${pname}-${version}.tar.gz"; + url = "https://jmvdveer.home.xs4all.nl/algol68g-${finalAttrs.version}.tar.gz"; hash = "sha256-WCPM0MGP4Qo2ihF8w5JHSMSl0P6N/w2dgY/3PDQlZfA="; }; + outputs = [ "out" ] ++ lib.optional withPDFDoc "doc"; + patches = [ # add PNG support ./0001-plotutils-png-support.diff @@ -31,12 +34,12 @@ stdenv.mkDerivation rec { url = "https://jmvdveer.home.xs4all.nl/learning-algol-68-genie.pdf"; hash = "sha256-QCwn1e/lVfTYTeolCFErvfMhvwCgsBnASqq2K+NYmlU="; }; - in + in lib.optionalString withPDFDoc '' - install -m644 ${pdfdoc} $out/share/doc/${pname}/learning-algol-68-genie.pdf + install -m644 ${pdfdoc} ${placeholder "doc"}/share/doc/algol68g/learning-algol-68-genie.pdf ''; - meta = with lib; { + meta = { homepage = "https://jmvdveer.home.xs4all.nl/en.algol-68-genie.html"; description = "Algol 68 Genie compiler-interpreter"; longDescription = '' @@ -48,9 +51,9 @@ stdenv.mkDerivation rec { regular expressions and sounds. It can be linked to GNU plotutils, the GNU scientific library and PostgreSQL. ''; - license = licenses.gpl3Plus; - maintainers = with maintainers; [ AndersonTorres ]; + license = lib.licenses.gpl3Plus; + maintainers = with lib.maintainers; [ AndersonTorres ]; mainProgram = "a68g"; - platforms = platforms.unix; + platforms = lib.platforms.unix; }; -} +})