default.nix (1310B)
1 { 2 lib, 3 stdenv, 4 fetchwebarchive, 5 fetchpatch, 6 readline, 7 ncurses, 8 bison, 9 flex, 10 installShellFiles, 11 }: 12 13 stdenv.mkDerivation (finalAttrs: { 14 pname = "aamath"; 15 version = "0.3"; 16 17 src = fetchwebarchive { 18 url = "http://fuse.superglue.se/aamath/aamath-${finalAttrs.version}.tar.gz"; 19 timestamp = "20190303013301"; 20 hash = "sha256-mEP0WIaV4s1Vzl2PWJIdTyVeDmXtlWnh3N3z9o93tjE="; 21 }; 22 23 patches = ( 24 fetchpatch { 25 url = "https://raw.githubusercontent.com/macports/macports-ports/6c3088afddcf34ca2bcc5c209f85f264dcf0bc69/math/aamath/files/patch-expr.h.diff"; 26 hash = "sha256-JtLcqdBq/88Bemj4NQYnpEVVTUyiCLWX2zE3CuXtRlM="; 27 } 28 ); 29 30 patchFlags = [ "-p0" ]; 31 32 postPatch = '' 33 substituteInPlace Makefile \ 34 --replace-fail "lex " "flex " \ 35 --replace-fail "-ltermcap" "-lncurses" 36 ''; 37 38 nativeBuildInputs = [ 39 bison 40 flex 41 installShellFiles 42 ]; 43 44 buildInputs = [ 45 readline 46 ncurses 47 ]; 48 49 installPhase = '' 50 install -Dm755 aamath -t $out/bin 51 installManPage aamath.1 52 ''; 53 54 meta = { 55 description = "ASCII art mathematics"; 56 homepage = "http://fuse.superglue.se/aamath/"; 57 license = lib.licenses.gpl2Only; 58 maintainers = [ lib.maintainers.sikmir ]; 59 platforms = lib.platforms.linux; 60 skip.ci = stdenv.isDarwin; 61 }; 62 })