zoxide: 0.9.6 -> 0.9.7 (#380745)
[NixPkgs.git] / pkgs / by-name / np / npiet / package.nix
blobcbc1592129e457f57439ba811ccd88264722eee4
2   lib,
3   stdenv,
4   fetchurl,
5   gd,
6   giflib,
7   groff,
8   libpng,
9   tk,
10   callPackage,
13 stdenv.mkDerivation (finalAttrs: {
14   pname = "npiet";
15   version = "1.3f";
17   src = fetchurl {
18     url = "https://www.bertnase.de/npiet/npiet-${finalAttrs.version}.tar.gz";
19     hash = "sha256-Le2FYGKr1zWZ6F4edozmvGC6LbItx9aptidj3KBLhVo=";
20   };
22   buildInputs = [
23     gd
24     giflib
25     libpng
26   ];
28   nativeBuildInputs = [ groff ];
30   postPatch = ''
31     # malloc.h is not needed because stdlib.h is already included.
32     # On macOS, malloc.h does not even exist, resulting in an error.
33     substituteInPlace npiet-foogol.c \
34       --replace-fail '#include <malloc.h>' ""
36     substituteInPlace npietedit \
37       --replace-fail 'exec wish' 'exec ${tk}/bin/wish'
38   '';
40   strictDeps = true;
42   passthru.tests =
43     let
44       all-tests = callPackage ./tests { };
45     in
46     {
47       inherit (all-tests)
48         hello
49         prime
50         no-prime
51         brainfuck
52         ;
53     };
55   meta = {
56     description = "Interpreter for piet programs. Also includes npietedit and npiet-foogol";
57     longDescription = ''
58       npiet is an interpreter for the piet programming language.
59       Instead of text, piet programs are pictures. Commands are determined based on changes in color.
60     '';
61     homepage = "https://www.bertnase.de/npiet/";
62     changelog = "https://www.bertnase.de/npiet/ChangeLog";
63     license = lib.licenses.gpl2Only;
64     platforms = lib.platforms.unix;
65     mainProgram = "npiet";
66     maintainers = with lib.maintainers; [ Luflosi ];
67   };