about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/text/enscript/default.nix
blob: e5aeb75ca6266e4f456fd0e275e873139c156514 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
{ lib, stdenv, fetchurl, gettext }:

stdenv.mkDerivation rec {
  pname = "enscript";
  version = "1.6.6";

  src = fetchurl {
    url = "mirror://gnu/enscript/enscript-${version}.tar.gz";
    sha256 = "1fy0ymvzrrvs889zanxcaxjfcxarm2d3k43c9frmbl1ld7dblmkd";
  };

  patches = [
    # fix compile failure on macos. use system getopt like linux
    # requires that compat/getopt.h is also removed
    # https://savannah.gnu.org/bugs/?64307
    ./0001-use-system-getopt.patch
  ];

  postPatch = ''
    # the delete component of 0001-use-system-getopt.patch
    rm compat/getopt.h
    # Fix building on Darwin with GCC.
    substituteInPlace compat/regex.c --replace \
       __private_extern__  '__attribute__ ((visibility ("hidden")))'
  '';

  buildInputs = [ gettext ];

  doCheck = true;

  meta = {
    description = "Converter from ASCII to PostScript, HTML, or RTF";

    longDescription =
      '' GNU Enscript converts ASCII files to PostScript, HTML, or RTF and
         stores generated output to a file or sends it directly to the
         printer.  It includes features for `pretty-printing'
         (language-sensitive code highlighting) in several programming
         languages.

         Enscript can be easily extended to handle different output media and
         it has many options that can be used to customize printouts.
      '';

    license = lib.licenses.gpl3Plus;

    homepage = "https://www.gnu.org/software/enscript/";

    maintainers = [ ];
    platforms = lib.platforms.all;
  };
}