1{
2 lib,
3 stdenv,
4 fetchurl,
5 gettext,
6}:
7
8stdenv.mkDerivation rec {
9 pname = "enscript";
10 version = "1.6.6";
11
12 src = fetchurl {
13 url = "mirror://gnu/enscript/enscript-${version}.tar.gz";
14 sha256 = "1fy0ymvzrrvs889zanxcaxjfcxarm2d3k43c9frmbl1ld7dblmkd";
15 };
16
17 patches = [
18 # fix compile failure on macos. use system getopt like linux
19 # requires that compat/getopt.h is also removed
20 # https://savannah.gnu.org/bugs/?64307
21 ./0001-use-system-getopt.patch
22 ];
23
24 postPatch = ''
25 # the delete component of 0001-use-system-getopt.patch
26 rm compat/getopt.h
27 # Fix building on Darwin with GCC.
28 substituteInPlace compat/regex.c --replace \
29 __private_extern__ '__attribute__ ((visibility ("hidden")))'
30 '';
31
32 buildInputs = [ gettext ];
33
34 doCheck = true;
35
36 meta = {
37 description = "Converter from ASCII to PostScript, HTML, or RTF";
38
39 longDescription = ''
40 GNU Enscript converts ASCII files to PostScript, HTML, or RTF and
41 stores generated output to a file or sends it directly to the
42 printer. It includes features for `pretty-printing'
43 (language-sensitive code highlighting) in several programming
44 languages.
45
46 Enscript can be easily extended to handle different output media and
47 it has many options that can be used to customize printouts.
48 '';
49
50 license = lib.licenses.gpl3Plus;
51
52 homepage = "https://www.gnu.org/software/enscript/";
53
54 maintainers = [ ];
55 platforms = lib.platforms.all;
56 mainProgram = "enscript";
57 };
58}