Bug 234000 - editors/nano: Remove groff dependency
Summary: editors/nano: Remove groff dependency
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Danilo Egea Gondolfo
Keywords: needs-qa
Depends on:
Reported: 2018-12-14 03:10 UTC by Daniel Eisele
Modified: 2018-12-15 13:17 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (danilo)

Diff of editors/nano/Makefile (894 bytes, patch)
2018-12-14 03:10 UTC, Daniel Eisele
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Eisele 2018-12-14 03:10:41 UTC
Created attachment 200098 [details]
Diff of editors/nano/Makefile

I just upgraded to 12.0 noticed that the nano port suddenly had about 80 new dependencies. The reason for this is that the DOCS option depends on groff, which was removed from the base system with 12.0 (base r319664), so now groff and all its dependencies are installed when building nano.

The nano configure script checks for groff and, if it's available, uses it to compile each of the 3 manpages (nano.1, rnano.1 and nanorc.5) into an HTML page.
But all this isn't actually needed, as all of the HTML files are already included in the original .tar.gz file, which means that they can just be copied. This is probably the best and easiest solution.

Another solution would be to use mandoc instead of groff. mandoc can also generate HTML, but the result is not exactly the same as with groff.

Also I think that the post-configure and post-build target can be removed, as they only try to search and replace some text which doesn't exist anymore.

Diff is attached, it should work exactly the same whether groff is installed or not, because the groff-generated files would just be overwritten with the already included HTML files. (I didn't actually tested this, as I didn't want to install groff)

Also other ports which depend on groff might have the same problem...
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2018-12-14 03:18:51 UTC
If groff is (incidentally) installed, via say another ports dependency, will configure still find it? An explicit way to unconditionally disable 'with groff' is necessary if so.

Previous similar issues with other ports:

 * https://reviews.freebsd.org/D11793 - security/openssh-portable: Remove groff dependency
 * https://reviews.freebsd.org/D14732 - databases/rrdtool: Make groff a conditional dependency
Comment 2 Daniel Eisele 2018-12-14 03:47:27 UTC
(In reply to Kubilay Kocak from comment #1)
Yes, the configure script will find groff if it is already installed.
But this shouldn't make a difference because if the DOCS option is...
* ...disabled, then the generated files just won't get into the final package
* ...enabled, then the generated files will be overwritten by the INSTALL_DATA command

So groff might be run, but the output will never be used.

I didn't completely disable groff because I don't know the best way to do it. Maybe patch the configure script? Maybe use BINARY_ALIAS to replace groff with an empty script?
Comment 3 Daniel Eisele 2018-12-14 04:06:07 UTC
(In reply to Kubilay Kocak from comment #1)
Also nano's configure script only looks for groff and if it can't find it, then it just won't generate any HTML files (the HTML files from the .tar.gz file are of course still copied if the DOCS option is enabled).
Comment 4 commit-hook freebsd_committer 2018-12-15 11:56:09 UTC
A commit references this bug:

Author: danilo
Date: Sat Dec 15 11:55:13 UTC 2018
New revision: 487507
URL: https://svnweb.freebsd.org/changeset/ports/487507

  - Remove groff dependency. The tarball already has the HTML files
  - Remove unecessary REINPLACE_CMD
  - Use post-install-{EXAMPLES,DOCS}-on to install the extra files

  while here:
  - Disable groff execution by the configure script

  PR:		234000
  Submitted by:	Daniel Eisele <daniel_eisele AT gmx.de>

Comment 5 Danilo Egea Gondolfo freebsd_committer 2018-12-15 11:57:07 UTC
Committed with some minor changes. Thanks!

Nice PR number BTW.
Comment 6 Daniel Eisele 2018-12-15 13:17:05 UTC
(In reply to Danilo Egea Gondolfo from comment #5)
Thanks for the fast commit.

> Nice PR number BTW.
... and I thought I was the only one to notice this :D