about summary refs log tree commit diff
path: root/pkgs/by-name
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/by-name')
-rw-r--r--pkgs/by-name/al/algol68g/package.nix23
-rw-r--r--pkgs/by-name/cb/cbmbasic/package.nix65
2 files changed, 84 insertions, 4 deletions
diff --git a/pkgs/by-name/al/algol68g/package.nix b/pkgs/by-name/al/algol68g/package.nix
index a5dbf958e8a25..1622952b3ce56 100644
--- a/pkgs/by-name/al/algol68g/package.nix
+++ b/pkgs/by-name/al/algol68g/package.nix
@@ -1,29 +1,44 @@
 { lib
 , stdenv
 , fetchurl
+, curl
+, gmp
 , gsl
+, mpfr
+, ncurses
 , plotutils
 , postgresql
+, pkg-config
 , withPDFDoc ? true
 }:
 
 stdenv.mkDerivation (finalAttrs: {
   pname = "algol68g";
-  version = "3.3.24";
+  version = "3.4.2";
 
   src = fetchurl {
     url = "https://jmvdveer.home.xs4all.nl/algol68g-${finalAttrs.version}.tar.gz";
-    hash = "sha256-vSbj3YlyCs4bADpDqxAkcSC1VsoQZ2j+jIKe577WtDU=";
+    hash = "sha256-hKiRMU98sZhGgHhjgtwUNSIv2iPgb4T+dgYw58IGK8Q=";
   };
 
-  outputs = [ "out" "man" ] ++ lib.optional withPDFDoc "doc";
+  outputs = [ "out" "man" ] ++ lib.optionals withPDFDoc [ "doc" ];
+
+  nativeBuildInputs = [
+    pkg-config
+  ];
 
   buildInputs = [
+    curl
+    mpfr
+    ncurses
+    gmp
     gsl
     plotutils
     postgresql
   ];
 
+  strictDeps = true;
+
   postInstall = let
     pdfdoc = fetchurl {
       url = "https://jmvdveer.home.xs4all.nl/learning-algol-68-genie.pdf";
@@ -47,8 +62,8 @@ stdenv.mkDerivation (finalAttrs: {
       scientific library and PostgreSQL.
     '';
     license = lib.licenses.gpl3Plus;
-    maintainers = with lib.maintainers; [ AndersonTorres ];
     mainProgram = "a68g";
+    maintainers = with lib.maintainers; [ AndersonTorres ];
     platforms = lib.platforms.unix;
   };
 })
diff --git a/pkgs/by-name/cb/cbmbasic/package.nix b/pkgs/by-name/cb/cbmbasic/package.nix
new file mode 100644
index 0000000000000..a7d6d841012fa
--- /dev/null
+++ b/pkgs/by-name/cb/cbmbasic/package.nix
@@ -0,0 +1,65 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, runCommand
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "cbmbasic";
+  version = "unstable-2022-12-18";
+
+  src = fetchFromGitHub {
+    owner = "mist64";
+    repo = "cbmbasic";
+    rev = "352a313313dd0a15a47288c8f8031b54ac8c92a2";
+    hash = "sha256-aA/ivRap+aDd2wi6KWXam9eP/21lOn6OWTeZ4i/S9Bs=";
+  };
+
+  installPhase = ''
+  runHook preInstall
+
+  mkdir -p $out/bin/
+  mv cbmbasic $out/bin/
+
+  runHook postInstall
+  '';
+
+  # NOTE: cbmbasic uses microsoft style linebreaks `\r\n`, and testing has to
+  # accommodate that, else you get very cryptic diffs
+  passthru = {
+    tests.run = runCommand "cbmbasic-test-run" {
+      nativeBuildInputs = [finalAttrs.finalPackage];
+    } ''
+      echo '#!${lib.getExe finalAttrs.finalPackage}' > helloI.bas;
+      echo 'PRINT"Hello, World!"' >> helloI.bas;
+      chmod +x helloI.bas
+
+      diff -U3 --color=auto <(./helloI.bas) <(echo -e "Hello, World!\r");
+
+      echo '#!/usr/bin/env cbmbasic' > hello.bas;
+      echo 'PRINT"Hello, World!"' >> hello.bas;
+      chmod +x hello.bas
+
+      diff -U3 --color=auto <(cbmbasic ./hello.bas) <(echo -e "Hello, World!\r");
+
+      touch $out;
+    '';
+  };
+
+  meta = with lib; {
+    description = "Portable version of Commodore's version of Microsoft BASIC 6502 as found on the Commodore 64";
+    longDescription = ''
+      "Commodore BASIC" (cbmbasic) is a 100% compatible version of Commodore's
+      version of Microsoft BASIC 6502 as found on the Commodore 64. You can use
+      it in interactive mode or pass a BASIC file as a command line parameter.
+
+      This source does not emulate 6502 code; all code is completely native. On
+      a 1 GHz CPU you get about 1000x speed compared to a 1 MHz 6502.
+    '';
+    homepage =  "https://github.com/mist64/cbmbasic";
+    license = licenses.bsd2;
+    maintainers = [ maintainers.cafkafk ];
+    mainProgram = "cbmbasic";
+    platforms = platforms.all;
+  };
+})