-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
groff: Add site.tmac to fix man page coloring #27061
Conversation
@aneeshusa, thanks for your PR! By analyzing the history of the files in this pull request, we identified @pSub, @RamKromberg and @expipiplus1 to be potential reviewers. |
. char \' \N'39' | ||
. \} | ||
. | ||
. \" Shut off SGR by default (groff colors) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGR
-> SGR (a.k.a. ANSI color escapes)
. \} | ||
. | ||
. \" Shut off SGR by default (groff colors) | ||
. \" Require GROFF_SGR envvar defined to turn it on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor, but I'd just write out "environment variable" here.
@@ -59,6 +59,9 @@ stdenv.mkDerivation rec { | |||
postInstall = '' | |||
rm $doc/share/doc/groff/examples/hdtbl/*color*ps | |||
find $doc/share/doc/groff/ -type f -print0 | xargs -0 sed -i -e 's/%%CreationDate: .*//' | |||
for f in 'man.local' 'mdoc.local'; do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to quote these constants.
@@ -59,6 +59,9 @@ stdenv.mkDerivation rec { | |||
postInstall = '' | |||
rm $doc/share/doc/groff/examples/hdtbl/*color*ps | |||
find $doc/share/doc/groff/ -type f -print0 | xargs -0 sed -i -e 's/%%CreationDate: .*//' | |||
for f in 'man.local' 'mdoc.local'; do | |||
cat '${./site.tmac}' >>"$out/share/groff/site-tmac/$f" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure this does anything useful? (The single quotes seem to be off, turning cat's argument into a constant.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'${./site.tmac}' expands to '/nix/store/<hash>-site.tmac'
before the build script is executed.
@@ -59,6 +59,9 @@ stdenv.mkDerivation rec { | |||
postInstall = '' | |||
rm $doc/share/doc/groff/examples/hdtbl/*color*ps |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"$doc"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unrelated to the change, so I'm going to leave it untouched in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 1db1ba9.
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.
111b5eb
to
6eada39
Compare
@vcunat looks like you merged this into staging already and addressed the other nit, so closing the PR. Thanks! |
@aneeshusa: this causes a blocker problem – |
I unblocked this one now in 0be14a5, but it would still be nice to understand if it can cause some real problems. |
I'm not sure what's wrong, but the pages look OK. Discussion: #27061 (comment)
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.
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)