about summary refs log tree commit diff
path: root/pkgs/by-name/al/algol68g/package.nix
diff options
context:
space:
mode:
authorAnderson Torres2023-09-15 18:00:47 -0300
committerAnderson Torres2023-09-16 13:22:03 +0000
commit057496d1b240d2ce5670979cbacb9700eb91d600 (patch)
tree048684a211a093a672b2fbd83d80c4911ce3f185 /pkgs/by-name/al/algol68g/package.nix
parent39c2bcdf1a8a4c9e17ade5eb50844904adf0b798 (diff)
algol68g: refactor
- finalAttrs
- add withPDFDoc option
- split output
Diffstat (limited to 'pkgs/by-name/al/algol68g/package.nix')
-rw-r--r--pkgs/by-name/al/algol68g/package.nix21
1 files 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;
   };
-}
+})