2024-08-10 10:52:10 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchurl,
|
|
|
|
gd,
|
|
|
|
giflib,
|
|
|
|
groff,
|
|
|
|
libpng,
|
|
|
|
tk,
|
2024-08-10 11:01:36 +00:00
|
|
|
callPackage,
|
2021-09-18 12:23:04 +00:00
|
|
|
}:
|
|
|
|
|
2024-08-10 10:52:10 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2021-09-18 12:23:04 +00:00
|
|
|
pname = "npiet";
|
|
|
|
version = "1.3f";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2024-08-10 10:52:10 +00:00
|
|
|
url = "https://www.bertnase.de/npiet/npiet-${finalAttrs.version}.tar.gz";
|
|
|
|
hash = "sha256-Le2FYGKr1zWZ6F4edozmvGC6LbItx9aptidj3KBLhVo=";
|
2021-09-18 12:23:04 +00:00
|
|
|
};
|
|
|
|
|
2024-08-10 10:52:10 +00:00
|
|
|
buildInputs = [
|
|
|
|
gd
|
|
|
|
giflib
|
|
|
|
libpng
|
|
|
|
];
|
2021-09-18 12:23:04 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ groff ];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# malloc.h is not needed because stdlib.h is already included.
|
|
|
|
# On macOS, malloc.h does not even exist, resulting in an error.
|
|
|
|
substituteInPlace npiet-foogol.c \
|
2024-08-10 10:52:10 +00:00
|
|
|
--replace-fail '#include <malloc.h>' ""
|
2021-09-18 12:23:04 +00:00
|
|
|
|
|
|
|
substituteInPlace npietedit \
|
2024-08-10 10:52:10 +00:00
|
|
|
--replace-fail 'exec wish' 'exec ${tk}/bin/wish'
|
2021-09-18 12:23:04 +00:00
|
|
|
'';
|
|
|
|
|
2024-08-10 10:52:10 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
2024-08-10 11:01:36 +00:00
|
|
|
passthru.tests =
|
|
|
|
let
|
|
|
|
all-tests = callPackage ./tests { };
|
|
|
|
in
|
|
|
|
{
|
|
|
|
inherit (all-tests)
|
|
|
|
hello
|
|
|
|
prime
|
|
|
|
no-prime
|
|
|
|
brainfuck
|
|
|
|
;
|
|
|
|
};
|
|
|
|
|
2024-08-10 10:52:10 +00:00
|
|
|
meta = {
|
2021-09-18 12:23:04 +00:00
|
|
|
description = "Interpreter for piet programs. Also includes npietedit and npiet-foogol";
|
|
|
|
longDescription = ''
|
|
|
|
npiet is an interpreter for the piet programming language.
|
|
|
|
Instead of text, piet programs are pictures. Commands are determined based on changes in color.
|
|
|
|
'';
|
|
|
|
homepage = "https://www.bertnase.de/npiet/";
|
2024-08-10 10:52:10 +00:00
|
|
|
changelog = "https://www.bertnase.de/npiet/ChangeLog";
|
|
|
|
license = lib.licenses.gpl2Only;
|
|
|
|
platforms = lib.platforms.unix;
|
|
|
|
mainProgram = "npiet";
|
|
|
|
maintainers = with lib.maintainers; [ Luflosi ];
|
2021-09-18 12:23:04 +00:00
|
|
|
};
|
2024-08-10 10:52:10 +00:00
|
|
|
})
|