nixpkgs/pkgs/by-name/np/npiet/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

69 lines
1.5 KiB
Nix
Raw Normal View History

{
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
}:
stdenv.mkDerivation (finalAttrs: {
2021-09-18 12:23:04 +00:00
pname = "npiet";
version = "1.3f";
src = fetchurl {
url = "https://www.bertnase.de/npiet/npiet-${finalAttrs.version}.tar.gz";
hash = "sha256-Le2FYGKr1zWZ6F4edozmvGC6LbItx9aptidj3KBLhVo=";
2021-09-18 12:23:04 +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 \
--replace-fail '#include <malloc.h>' ""
2021-09-18 12:23:04 +00:00
substituteInPlace npietedit \
--replace-fail 'exec wish' 'exec ${tk}/bin/wish'
2021-09-18 12:23:04 +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
;
};
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/";
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
};
})