diff options
Diffstat (limited to 'pkgs/development/compilers/algol68g')
-rw-r--r-- | pkgs/development/compilers/algol68g/0001-plotutils-png-support.diff | 27 | ||||
-rw-r--r-- | pkgs/development/compilers/algol68g/default.nix | 55 |
2 files changed, 82 insertions, 0 deletions
diff --git a/pkgs/development/compilers/algol68g/0001-plotutils-png-support.diff b/pkgs/development/compilers/algol68g/0001-plotutils-png-support.diff new file mode 100644 index 00000000000..14e7ccd5624 --- /dev/null +++ b/pkgs/development/compilers/algol68g/0001-plotutils-png-support.diff @@ -0,0 +1,27 @@ +diff -Naur algol68g-2.8.4-old/source/plotutils.c algol68g-2.8.4-new/source/plotutils.c +--- algol68g-2.8.4-old/source/plotutils.c 2016-10-11 18:14:48.000000000 -0300 ++++ algol68g-2.8.4-new/source/plotutils.c 2021-07-30 02:42:29.762627511 -0300 +@@ -1026,10 +1026,10 @@ + X_COORD (&DEVICE (f)) = 0; + Y_COORD (&DEVICE (f)) = 0; + return (PLOTTER (&DEVICE (f))); +- } else if (!strcmp (device_type, "gif")) { +-/*------------------------------------+ +-| Supported plotter type - pseudo GIF | +-+------------------------------------*/ ++ } else if (!strcmp (device_type, "gif") || !strcmp (device_type, "png")) { ++/*-------------------------------------------+ ++| Supported plotter type - pseudo GIF or PNG | +++-------------------------------------------*/ + char *z = DEREF (char, &A68_PAGE_SIZE (&DEVICE (f))), size[BUFFER_SIZE]; + /* Establish page size */ + if (!scan_int (&z, &(WINDOW_X_SIZE (&DEVICE (f))))) { +@@ -1067,7 +1067,7 @@ + (void) pl_setplparam (PLOTTER_PARAMS (&DEVICE (f)), "BITMAPSIZE", size); + (void) pl_setplparam (PLOTTER_PARAMS (&DEVICE (f)), "BG_COLOR", (void *) "black"); + (void) pl_setplparam (PLOTTER_PARAMS (&DEVICE (f)), "GIF_ANIMATION", (void *) "no"); +- PLOTTER (&DEVICE (f)) = pl_newpl_r ("gif", NULL, STREAM (&DEVICE (f)), stderr, PLOTTER_PARAMS (&DEVICE (f))); ++ PLOTTER (&DEVICE (f)) = pl_newpl_r (device_type, NULL, STREAM (&DEVICE (f)), stderr, PLOTTER_PARAMS (&DEVICE (f))); + if (PLOTTER (&DEVICE (f)) == NULL) { + diagnostic_node (A68_RUNTIME_ERROR, p, ERROR_DEVICE_CANNOT_OPEN); + exit_genie (p, A68_RUNTIME_ERROR); diff --git a/pkgs/development/compilers/algol68g/default.nix b/pkgs/development/compilers/algol68g/default.nix new file mode 100644 index 00000000000..88210ca5b72 --- /dev/null +++ b/pkgs/development/compilers/algol68g/default.nix @@ -0,0 +1,55 @@ +{ lib +, stdenv +, fetchurl +, gsl +, plotutils +, postgresql +}: + +stdenv.mkDerivation rec { + pname = "algol68g"; + version = "2.8.4"; + + src = fetchurl { + url = "https://jmvdveer.home.xs4all.nl/${pname}-${version}.tar.gz"; + hash = "sha256-WCPM0MGP4Qo2ihF8w5JHSMSl0P6N/w2dgY/3PDQlZfA="; + }; + + patches = [ + # add PNG support + ./0001-plotutils-png-support.diff + ]; + + buildInputs = [ + gsl + plotutils + postgresql + ]; + + postInstall = let + pdfdoc = fetchurl { + url = "https://jmvdveer.home.xs4all.nl/learning-algol-68-genie.pdf"; + hash = "sha256-QCwn1e/lVfTYTeolCFErvfMhvwCgsBnASqq2K+NYmlU="; + }; + in + '' + install -m644 ${pdfdoc} $out/share/doc/${pname}/learning-algol-68-genie.pdf + ''; + + meta = with lib; { + homepage = "https://jmvdveer.home.xs4all.nl/en.algol-68-genie.html"; + description = "Algol 68 Genie compiler-interpreter"; + longDescription = '' + Algol 68 Genie (a68g) is a recent checkout hybrid compiler-interpreter, + written from scratch by Marcel van der Veer. It ranks among the most + complete Algol 68 implementations. It implements for example arbitrary + precision arithmetic, complex numbers, parallel processing, partial + parametrisation and formatted transput, as well as support for curses, + regular expressions and sounds. It can be linked to GNU plotutils, the GNU + scientific library and PostgreSQL. + ''; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ AndersonTorres ]; + platforms = platforms.unix; + }; +} |