On Sat, Aug 25 2018, Ingo Schwarze <schwa...@usta.de> wrote:
> Hi,

Hi Ingo,

> you may have noticed a flurry of mandoc commits lately: mandoc is now
> able to format the manual pages of the GNU troff package.  As usual,
> a few unimportant formatting differences remain, mostly whitespace,
> but nothing very serious.
>
> So i think it is time for groff to switch over to install manual
> page sources and have mandoc do the formatting on demand like for
> (almost) every other package.
>
> You might wonder whether this is a good idea - couldn't it happen
> that groff might use even more crazy stuff in its manual pages
> in the future, putting unfair workload on the maintainer of the
> groff port for future updates?  There are five answers to that:
>
>  1. That maintainer is - schwarze@.
>     So in the worst case, i'm hurting myself.

"It's not torture if you do it to yourself."

>     But i care a lot about groff/mandoc compatibility in the
>     first place, so such future changes would cause grief for
>     me either way.
>  2. We already know that the manual pages of the next release,
>     1.22.4, will also be fine with mandoc.
>  3. It isn't actually likely to get worse quickly because groff
>     isn't a fast-moving target nowadays, quite to the contrary.
>  4. Even if somebody pops up and threatens to commit bad stuff,
>     i'll notice right away because i have commit access to groff
>     upstream, and i'll certainly try to forestall further upstream
>     degradation of quality.
>  5. It's actually likely that i will be able to talk people out
>     of making things worse.  The other groff developers pay more
>     attention to portability nowadays, compared to years ago when
>     groff was practically the only maintained roff implementation.
>
> There is one weird special case: the manual page documenting the
> groff_www(7) macro set stupidly uses a few of its own macros for
> formatting instead of just using macros of identical functionality
> that are available in the man(7) language, or more precisely, in
> the man-ext GNU extensions which everyone has to support anyway.
> For now, i'm patching that up in a minimal way using .de and .als,
> but i'm in the process of pushing a real fix upstream for the
> groff-1.22.4 release.

Hah, groff_www(7) was the first manpage I checked after testing your
diff and before I read your mail.  FWIW the x11/ratpoison manpage was
using .de before I rewrote it using mdoc(7).

> (A few years ago, i would have run off
> screaming when finding .de and .als in a manual page; now they can
> be used in a routine fashion to patch up stuff that is even more
> broken.  But don't you dare attempting to use those in base =;-).
>
> OK?
>   Ingo

Sure.

> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/textproc/groff/Makefile,v
> retrieving revision 1.38
> diff -u -p -r1.38 Makefile
> --- Makefile  22 Aug 2017 23:28:52 -0000      1.38
> +++ Makefile  25 Aug 2018 19:42:57 -0000
> @@ -4,7 +4,7 @@ COMMENT =             GNU troff typesetter
>  VERSION =            1.22.3
>  SUBST_VARS =         VERSION
>  DISTNAME =           groff-${VERSION}
> -REVISION =           8
> +REVISION =           9
>  
>  CATEGORIES =         textproc
>  DPB_PROPERTIES =     parallel
> Index: patches/patch-Makefile_comm
> ===================================================================
> RCS file: patches/patch-Makefile_comm
> diff -N patches/patch-Makefile_comm
> --- patches/patch-Makefile_comm       6 Nov 2014 22:15:22 -0000       1.3
> +++ /dev/null 1 Jan 1970 00:00:00 -0000
> @@ -1,60 +0,0 @@
> -$OpenBSD: patch-Makefile_comm,v 1.3 2014/11/06 22:15:22 schwarze Exp $
> -# Install preformatted manuals
> -# since mandoc(1) does not format the groff manuals well.
> -# But install groff_mdoc(7) as source
> -# because mandoc(1) handles that one better than groff.
> ---- Makefile.comm.orig       Mon Oct 13 00:16:08 2014
> -+++ Makefile.comm    Mon Oct 13 00:32:56 2014
> -@@ -172,27 +172,44 @@ install_man:
> -     -test -d $(DESTDIR)$(man1dir) || $(mkinstalldirs) $(DESTDIR)$(man1dir)
> -     @-pages="$(MAN1)"; \
> -      for p in $$pages; do \
> --       prog=`basename $$p .n`; \
> --       target=$(DESTDIR)$(man1dir)/$(NAMEPREFIX)$$prog.$(man1ext); \
> -+       p0="$${p%.n}.0"; \
> -+       echo "groff -t -mandoc -Tascii -P -c $$p > $$p0"; \
> -+       $(top_srcdir)/test-groff -t -mandoc -Tascii -P -c $$p > $$p0; \
> -+       target=$(DESTDIR)$(man1dir)/$(NAMEPREFIX)$$p0; \
> -        rm -f $$target; \
> --       echo $(INSTALL_DATA) $$p $$target; \
> --       $(INSTALL_DATA) $$p $$target; \
> -+       echo $(INSTALL_DATA) $$p0 $$target; \
> -+       $(INSTALL_DATA) $$p0 $$target; \
> -     done
> -     -test -d $(DESTDIR)$(man5dir) || $(mkinstalldirs) $(DESTDIR)$(man5dir)
> -     @-pages="$(MAN5)"; \
> -      for p in $$pages; do \
> --       target=$(DESTDIR)$(man5dir)/`basename $$p .n`.$(man5ext); \
> -+       p0="$${p%.n}.0"; \
> -+       echo "groff -t -mandoc -Tascii -P -c $$p > $$p0"; \
> -+       $(top_srcdir)/test-groff -t -mandoc -Tascii -P -c $$p > $$p0; \
> -+       target=$(DESTDIR)$(man5dir)/$$p0; \
> -        rm -f $$target; \
> --       echo $(INSTALL_DATA) $$p $$target; \
> --       $(INSTALL_DATA) $$p $$target; \
> -+       echo $(INSTALL_DATA) $$p0 $$target; \
> -+       $(INSTALL_DATA) $$p0 $$target; \
> -     done
> -     -test -d $(DESTDIR)$(man7dir) || $(mkinstalldirs) $(DESTDIR)$(man7dir)
> -     @-pages="$(MAN7)"; \
> -      for p in $$pages; do \
> --       target=$(DESTDIR)$(man7dir)/`basename $$p .n`.$(man7ext); \
> -+      if [ "X$$p" = "Xgroff_mdoc.n" ]; then \
> -+       mdocdir=$(DESTDIR)$(manroot)/man$(man7ext); \
> -+       test -d $$mdocdir || $(mkinstalldirs) $$mdocdir; \
> -+       target=$$mdocdir/groff_mdoc.7; \
> -        rm -f $$target; \
> -        echo $(INSTALL_DATA) $$p $$target; \
> -        $(INSTALL_DATA) $$p $$target; \
> -+      else \
> -+       p0="$${p%.n}.0"; \
> -+       echo "groff -t -mandoc -Tascii -P -c $$p > $$p0"; \
> -+       $(top_srcdir)/test-groff -t -mandoc -Tascii -P -c $$p > $$p0; \
> -+       target=$(DESTDIR)$(man7dir)/$$p0; \
> -+       rm -f $$target; \
> -+       echo $(INSTALL_DATA) $$p0 $$target; \
> -+       $(INSTALL_DATA) $$p0 $$target; \
> -+      fi; \
> -     done
> - 
> - .PHONY: uninstall_man
> Index: patches/patch-Makefile_in
> ===================================================================
> RCS file: /cvs/ports/textproc/groff/patches/patch-Makefile_in,v
> retrieving revision 1.7
> diff -u -p -r1.7 patch-Makefile_in
> --- patches/patch-Makefile_in 13 Sep 2016 11:17:21 -0000      1.7
> +++ patches/patch-Makefile_in 25 Aug 2018 19:42:57 -0000
> @@ -1,29 +1,9 @@
>  $OpenBSD: patch-Makefile_in,v 1.7 2016/09/13 11:17:21 schwarze Exp $
> -chunk 1: Install preformatted manuals, not source pages (local change).
> -chunk 2: src/devices/gropdf depends on arch/misc.
> -chunk 3: avoid bogus "is up to date" during fake.
> -Regarding chunks 2 & 3, current upstream code is completely different now.
> +chunk 1: src/devices/gropdf depends on arch/misc.
> +chunk 2: avoid bogus "is up to date" during fake.
> +Upstream code is completely different now.
>  --- Makefile.in.orig Tue Nov  4 09:38:35 2014
>  +++ Makefile.in      Thu Sep  8 22:27:19 2016
> -@@ -253,15 +253,15 @@ manroot=$(mandir)
> - 
> - # `man1ext' is the man section for user commands.
> - man1ext=1
> --man1dir=$(manroot)/man$(man1ext)
> -+man1dir=$(manroot)/cat$(man1ext)
> - 
> - # `man5ext' is the man section for file formats.
> - man5ext=5
> --man5dir=$(manroot)/man$(man5ext)
> -+man5dir=$(manroot)/cat$(man5ext)
> - 
> - # `man7ext' is the man section for macros.
> - man7ext=7
> --man7dir=$(manroot)/man$(man7ext)
> -+man7dir=$(manroot)/cat$(man7ext)
> - 
> - # `dist' target is disallowed in some `configure' combinations.
> - doc_dist_target_ok=@doc_dist_target_ok@
>  @@ -896,6 +896,8 @@ $(GNULIBDIRS): FORCE
>         $(MAKE) ACLOCAL=: AUTOCONF=: AUTOHEADER=: AUTOMAKE=: $(do) ;; \
>       esac
> Index: patches/patch-tmac_groff_www_man
> ===================================================================
> RCS file: patches/patch-tmac_groff_www_man
> diff -N patches/patch-tmac_groff_www_man
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-tmac_groff_www_man  25 Aug 2018 19:42:57 -0000
> @@ -0,0 +1,21 @@
> +$OpenBSD$
> +
> +This manual page uses the groff_www(7) macro set.
> +Map that to the usual man-ext macros.
> +I'm pushing a slightly more invasive fix upstream.
> +
> +Index: tmac/groff_www.man
> +--- tmac/groff_www.man.orig
> ++++ tmac/groff_www.man
> +@@ -1,4 +1,11 @@
> + .TH GROFF_WWW @MAN7EXT@ "@MDATE@" "Groff Version @VERSION@"
> ++.de URL
> ++.  UR \\$1
> ++.  nop \\$2
> ++.  UE \\$3\\&
> ++..
> ++.als FTP URL
> ++.als MTO URL
> + .SH NAME
> + groff_www \- groff macros for authoring web pages
> + .
> Index: pkg/PLIST
> ===================================================================
> RCS file: /cvs/ports/textproc/groff/pkg/PLIST,v
> retrieving revision 1.7
> diff -u -p -r1.7 PLIST
> --- pkg/PLIST 6 Nov 2014 22:15:23 -0000       1.7
> +++ pkg/PLIST 25 Aug 2018 19:42:57 -0000
> @@ -68,71 +68,71 @@ lib/groff/grog/
>  lib/groff/grog/subs.pl
>  lib/groff/refer/
>  lib/groff/site-tmac/
> -@man man/cat1/addftinfo.0
> -@man man/cat1/afmtodit.0
> -@man man/cat1/chem.0
> -@man man/cat1/eqn.0
> -@man man/cat1/eqn2graph.0
> -@man man/cat1/gdiffmk.0
> -@man man/cat1/glilypond.0
> -@man man/cat1/gperl.0
> -@man man/cat1/gpinyin.0
> -@man man/cat1/grap2graph.0
> -@man man/cat1/grn.0
> -@man man/cat1/grodvi.0
> -@man man/cat1/groff.0
> -@man man/cat1/groffer.0
> -@man man/cat1/grog.0
> -@man man/cat1/grohtml.0
> -@man man/cat1/grolbp.0
> -@man man/cat1/grolj4.0
> -@man man/cat1/gropdf.0
> -@man man/cat1/grops.0
> -@man man/cat1/grotty.0
> -@man man/cat1/hpftodit.0
> -@man man/cat1/indxbib.0
> -@man man/cat1/lkbib.0
> -@man man/cat1/lookbib.0
> -@man man/cat1/mmroff.0
> -@man man/cat1/neqn.0
> -@man man/cat1/nroff.0
> -@man man/cat1/pdfmom.0
> -@man man/cat1/pdfroff.0
> -@man man/cat1/pfbtops.0
> -@man man/cat1/pic.0
> -@man man/cat1/pic2graph.0
> -@man man/cat1/preconv.0
> -@man man/cat1/refer.0
> -@man man/cat1/roff2dvi.0
> -@man man/cat1/roff2html.0
> -@man man/cat1/roff2pdf.0
> -@man man/cat1/roff2ps.0
> -@man man/cat1/roff2text.0
> -@man man/cat1/roff2x.0
> -@man man/cat1/soelim.0
> -@man man/cat1/tbl.0
> -@man man/cat1/tfmtodit.0
> -@man man/cat1/troff.0
> -@man man/cat5/groff_font.0
> -@man man/cat5/groff_out.0
> -@man man/cat5/groff_tmac.0
> -@man man/cat5/lj4_font.0
> -@man man/cat7/ditroff.0
> -@man man/cat7/groff.0
> -@man man/cat7/groff_char.0
> -@man man/cat7/groff_diff.0
> -@man man/cat7/groff_filenames.0
> -@man man/cat7/groff_hdtbl.0
> -@man man/cat7/groff_man.0
> -@man man/cat7/groff_me.0
> -@man man/cat7/groff_mm.0
> -@man man/cat7/groff_mmse.0
> -@man man/cat7/groff_mom.0
> -@man man/cat7/groff_ms.0
> -@man man/cat7/groff_trace.0
> -@man man/cat7/groff_www.0
> -@man man/cat7/roff.0
> +@man man/man1/addftinfo.1
> +@man man/man1/afmtodit.1
> +@man man/man1/chem.1
> +@man man/man1/eqn.1
> +@man man/man1/eqn2graph.1
> +@man man/man1/gdiffmk.1
> +@man man/man1/glilypond.1
> +@man man/man1/gperl.1
> +@man man/man1/gpinyin.1
> +@man man/man1/grap2graph.1
> +@man man/man1/grn.1
> +@man man/man1/grodvi.1
> +@man man/man1/groff.1
> +@man man/man1/groffer.1
> +@man man/man1/grog.1
> +@man man/man1/grohtml.1
> +@man man/man1/grolbp.1
> +@man man/man1/grolj4.1
> +@man man/man1/gropdf.1
> +@man man/man1/grops.1
> +@man man/man1/grotty.1
> +@man man/man1/hpftodit.1
> +@man man/man1/indxbib.1
> +@man man/man1/lkbib.1
> +@man man/man1/lookbib.1
> +@man man/man1/mmroff.1
> +@man man/man1/neqn.1
> +@man man/man1/nroff.1
> +@man man/man1/pdfmom.1
> +@man man/man1/pdfroff.1
> +@man man/man1/pfbtops.1
> +@man man/man1/pic.1
> +@man man/man1/pic2graph.1
> +@man man/man1/preconv.1
> +@man man/man1/refer.1
> +@man man/man1/roff2dvi.1
> +@man man/man1/roff2html.1
> +@man man/man1/roff2pdf.1
> +@man man/man1/roff2ps.1
> +@man man/man1/roff2text.1
> +@man man/man1/roff2x.1
> +@man man/man1/soelim.1
> +@man man/man1/tbl.1
> +@man man/man1/tfmtodit.1
> +@man man/man1/troff.1
> +@man man/man5/groff_font.5
> +@man man/man5/groff_out.5
> +@man man/man5/groff_tmac.5
> +@man man/man5/lj4_font.5
> +@man man/man7/ditroff.7
> +@man man/man7/groff.7
> +@man man/man7/groff_char.7
> +@man man/man7/groff_diff.7
> +@man man/man7/groff_filenames.7
> +@man man/man7/groff_hdtbl.7
> +@man man/man7/groff_man.7
>  @man man/man7/groff_mdoc.7
> +@man man/man7/groff_me.7
> +@man man/man7/groff_mm.7
> +@man man/man7/groff_mmse.7
> +@man man/man7/groff_mom.7
> +@man man/man7/groff_ms.7
> +@man man/man7/groff_trace.7
> +@man man/man7/groff_www.7
> +@man man/man7/roff.7
>  share/doc/groff/
>  share/doc/groff/html/
>  share/doc/groff/html/mom/
>

-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

Reply via email to