Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

aneeshusa
Copy link
Contributor

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.

  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@mention-bot
Copy link

@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)
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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"
Copy link
Contributor

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.)

Copy link
Member

@Mic92 Mic92 Jul 3, 2017

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"$doc"

Copy link
Contributor Author

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 1db1ba9.

@Mic92 Mic92 added the 1.severity: mass-rebuild This PR causes a large number of packages to rebuild label Jul 3, 2017
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.
@aneeshusa aneeshusa changed the base branch from master to staging July 5, 2017 00:29
@aneeshusa
Copy link
Contributor Author

@Mic92 I didn't realize this was a mass-rebuild, I switched the base to staging.

@0xABAB, since I'm pulling it from an upstream I'd prefer to avoid cosmetic changes to the site.tmac file.

vcunat added a commit that referenced this pull request Jul 5, 2017
@aneeshusa
Copy link
Contributor Author

@vcunat looks like you merged this into staging already and addressed the other nit, so closing the PR. Thanks!

@aneeshusa aneeshusa closed this Jul 6, 2017
@vcunat
Copy link
Member

vcunat commented Jul 11, 2017

@aneeshusa: this causes a blocker problem – nixos-rebuild --help | grep SYNOPSIS won't work anymore, breaking tests.misc.*. I don't know why that would happen, as it shows OK even when I pipe that into less or cat...

@vcunat
Copy link
Member

vcunat commented Jul 11, 2017

I unblocked this one now in 0be14a5, but it would still be nice to understand if it can cause some real problems.

vcunat added a commit that referenced this pull request Jul 11, 2017
I'm not sure what's wrong, but the pages look OK.  Discussion:
#27061 (comment)
@aneeshusa aneeshusa deleted the add-site-tmac-for-groff branch January 7, 2022 03:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.severity: mass-rebuild This PR causes a large number of packages to rebuild
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants