commit b7053fcdb951dd159565ad3f67bf0d3b54e5173f
parent 9df9fe93acfe2f0f9fbe80c281547de8614df5d1
Author: Nikolay Korotkiy <sikmir@gmail.com>
Date: Fri, 19 Feb 2021 00:51:43 +0300
Add aamath
Diffstat:
2 files changed, 42 insertions(+), 0 deletions(-)
diff --git a/pkgs/default.nix b/pkgs/default.nix
@@ -135,6 +135,7 @@ lib.makeScope newScope (
### TOOLS
+ aamath = callPackage ./tools/text/aamath { };
csvquote = callPackage ./tools/text/csvquote { };
csvtools = callPackage ./tools/text/csvtools { };
datamaps = callPackage ./tools/geo/datamaps { };
diff --git a/pkgs/tools/text/aamath/default.nix b/pkgs/tools/text/aamath/default.nix
@@ -0,0 +1,41 @@
+{ lib, stdenv, fetchurl, fetchpatch, readline, ncurses, bison, flex }:
+
+stdenv.mkDerivation rec {
+ pname = "aamath";
+ version = "0.3";
+
+ src = fetchurl {
+ url = "http://fuse.superglue.se/aamath/aamath-${version}.tar.gz";
+ sha256 = "0cdnfy7zdwyxvkhnk5gdcl75w9ag3n95i3sxrrawvqlmhrcg8hwq";
+ };
+
+ patches = (fetchpatch {
+ url = "https://raw.githubusercontent.com/macports/macports-ports/6c3088afddcf34ca2bcc5c209f85f264dcf0bc69/math/aamath/files/patch-expr.h.diff";
+ sha256 = "0ls6xpjhldrivfbva2529i6maid44w33by38g80wzzvas2lxrli6";
+ });
+
+ patchFlags = [ "-p0" ];
+
+ postPatch = ''
+ substituteInPlace Makefile \
+ --replace "lex " "flex " \
+ --replace "-ltermcap" "-lncurses"
+ '';
+
+ nativeBuildInputs = [ bison flex ];
+
+ buildInputs = [ readline ncurses ];
+
+ installPhase = ''
+ install -Dm755 aamath -t $out/bin
+ install -Dm644 aamath.1 -t $out/share/man/man1
+ '';
+
+ meta = with lib; {
+ description = "ASCII art mathematics";
+ homepage = "http://fuse.superglue.se/aamath/";
+ license = licenses.gpl2Only;
+ maintainers = [ maintainers.sikmir ];
+ platforms = platforms.unix;
+ };
+}