8 stdenv.mkDerivation (finalAttrs: {
10 version = "unstable-2022-12-18";
12 src = fetchFromGitHub {
15 rev = "352a313313dd0a15a47288c8f8031b54ac8c92a2";
16 hash = "sha256-aA/ivRap+aDd2wi6KWXam9eP/21lOn6OWTeZ4i/S9Bs=";
28 # NOTE: cbmbasic uses microsoft style linebreaks `\r\n`, and testing has to
29 # accommodate that, else you get very cryptic diffs
32 runCommand "cbmbasic-test-run"
34 nativeBuildInputs = [ finalAttrs.finalPackage ];
37 echo '#!${lib.getExe finalAttrs.finalPackage}' > helloI.bas;
38 echo 'PRINT"Hello, World!"' >> helloI.bas;
41 diff -U3 --color=auto <(./helloI.bas) <(echo -e "Hello, World!\r");
43 echo '#!/usr/bin/env cbmbasic' > hello.bas;
44 echo 'PRINT"Hello, World!"' >> hello.bas;
47 diff -U3 --color=auto <(cbmbasic ./hello.bas) <(echo -e "Hello, World!\r");
54 description = "Portable version of Commodore's version of Microsoft BASIC 6502 as found on the Commodore 64";
56 "Commodore BASIC" (cbmbasic) is a 100% compatible version of Commodore's
57 version of Microsoft BASIC 6502 as found on the Commodore 64. You can use
58 it in interactive mode or pass a BASIC file as a command line parameter.
60 This source does not emulate 6502 code; all code is completely native. On
61 a 1 GHz CPU you get about 1000x speed compared to a 1 MHz 6502.
63 homepage = "https://github.com/mist64/cbmbasic";
64 license = licenses.bsd2;
65 maintainers = [ maintainers.cafkafk ];
66 mainProgram = "cbmbasic";
67 platforms = platforms.all;