nixpkgs/pkgs/tools/text/ansifilter/default.nix
Sergei Trofimovich caeefb8bd1 ansifilter: fix non-determinism in gzipped manpages with s/gzip/gzip -n/
Before the change ansifilter diffoscope shows non-determinism as:

    $ diffoscope '...-ansifilter-2.18' '...-ansifilter-2.18.check'
    --- ...-ansifilter-2.18/share/man/man1/ansifilter.1.gz
    +++ ...-ansifilter-2.18.check/share/man/man1/ansifilter.1.gz
    ─ filetype from file(1)
    @@ -1 +1 @@
    -gzip compressed data, was "ansifilter.1", last modified: Sat Oct 30 13:16:29 2021, max compression, from Unix
    +gzip compressed data, was "ansifilter.1", last modified: Sat Nov  6 18:04:36 2021, max compression, from Unix
2021-11-06 18:05:04 +00:00

38 lines
1.1 KiB
Nix

{ fetchurl, lib, stdenv, pkg-config, boost, lua }:
stdenv.mkDerivation rec {
pname = "ansifilter";
version = "2.18";
src = fetchurl {
url = "http://www.andre-simon.de/zip/ansifilter-${version}.tar.bz2";
sha256 = "sha256-Zs8BfTakPV9q4gYJzjtYZHSU7mwOQfxoLFmL/859fTk=";
};
nativeBuildInputs = [ pkg-config ];
buildInputs = [ boost lua ];
postPatch = ''
substituteInPlace src/makefile --replace "CC=g++" "CC=c++"
# avoid timestamp non-determinism with '-n'
substituteInPlace makefile --replace 'gzip -9f' 'gzip -9nf'
'';
makeFlags = [
"PREFIX=${placeholder "out"}"
"conf_dir=/etc/ansifilter"
];
meta = with lib; {
description = "Tool to convert ANSI to other formats";
longDescription = ''
Tool to remove ANSI or convert them to another format
(HTML, TeX, LaTeX, RTF, Pango or BBCode)
'';
homepage = "http://www.andre-simon.de/doku/ansifilter/en/ansifilter.php";
license = licenses.gpl3;
maintainers = [ maintainers.Adjective-Object ];
platforms = platforms.linux ++ platforms.darwin;
};
}