groff: Add site.tmac to fix man page coloring

This enables groff to correctly respond to the LESS_TERMCAP_*
environment variables, allowing colorized man pages.

Patch is taken from Arch Linux;
see https://bugs.archlinux.org/task/33760.

+19
+3
pkgs/tools/text/groff/default.nix
··· 59 59 postInstall = '' 60 60 rm $doc/share/doc/groff/examples/hdtbl/*color*ps 61 61 find $doc/share/doc/groff/ -type f -print0 | xargs -0 sed -i -e 's/%%CreationDate: .*//' 62 + for f in 'man.local' 'mdoc.local'; do 63 + cat '${./site.tmac}' >>"$out/share/groff/site-tmac/$f" 64 + done 62 65 ''; 63 66 64 67 meta = with stdenv.lib; {
+16
pkgs/tools/text/groff/site.tmac
··· 1 + . 2 + .if n \{\ 3 + . \" Character translations for non-keyboard 4 + . \" characters - to make them searchable 5 + . if '\*[.T]'utf8' \{\ 6 + . char \- \N'45' 7 + . char - \N'45' 8 + . char ' \N'39' 9 + . char \' \N'39' 10 + . \} 11 + . 12 + . \" Shut off SGR by default (groff colors) 13 + . \" Require GROFF_SGR envvar defined to turn it on 14 + . if '\V[GROFF_SGR]'' \ 15 + . output x X tty: sgr 0 16 + .\}