Bug 267908 - audio/sox: man page broken badly.
Summary: audio/sox: man page broken badly.
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-21 21:47 UTC by David Gilbert
Modified: 2022-11-25 16:47 UTC (History)
2 users (show)

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


Attachments
work around manpage formatting issues (1.62 KB, patch)
2022-11-25 00:54 UTC, Dan Nelson
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Gilbert 2022-11-21 21:47:32 UTC
man sox gives (on stderr, I assume)

lines 1-52warning: file '<standard input>', around line 2708:
  table wider than line width

... and all the formatted examples are done incorrectly.
Comment 1 Dan Nelson 2022-11-21 22:33:24 UTC
It looks like the warning is being thrown by the table in the "stat" effect section.  It has columns with content that can't be wrapped, and ends up too wide to fit in the standard 80-column text format.  The table does get laid out correctly, but is longer than 80 columns.

I don't see any problems with the examples, though.  Can you point out one that looks strange on your system?
Comment 2 David Gilbert 2022-11-21 23:38:00 UTC
I thought this section with the examples was more readable at one point.

          sox -r 16k -e signed -b 8 -c 1 voice-memo.raw voice-memo.wav
       converts `raw' (a.k.a. `headerless') audio to  a  self-describing  file
       format,
          sox slow.aiff fixed.aiff speed 1.027
       adjusts audio speed,
          sox short.wav long.wav longer.wav
       concatenates two audio files, and
          sox -m music.mp3 voice.wav mixed.flac
       mixes together two audio files.
          play "The Moonbeams/Greatest/*.ogg" bass +3
       plays  a  collection of audio files whilst applying a bass boosting ef-
       fect,
          play -n -c1 synth sin %-12 sin %-9 sin %-5 sin %-2 fade h 0.1 1 0.1
       plays a synthesised `A minor seventh' chord with a pipe-organ sound,
          rec -c 2 radio.aiff trim 0 30:00
       records half an hour of stereo audio, and
          play -q take1.aiff & rec -M take1.aiff take1-dub.aiff
       (with POSIX shell and where supported by hardware) records a new  track
       in a multi-track recording.  Finally,
Comment 3 Dan Nelson 2022-11-22 16:18:11 UTC
It does look a cramped due to the lack of blank lines above and below the examples.  I can't find any text-format versions of the sox manpage that looks any different, though.  A copy of the port from a few years ago looks the same, as do the Debian and RedHat manpages.  Some of the html-format versions look better, but that's due to CSS styles, so that may explain why there are no equivalent blank lines in the text version.

If you can figure out how to make the .EX and .EE macros put blanks above and below in text format, I'll get the patch committed, but I don't know enough roff syntax to do that myself.
Comment 4 Fernando Apesteguía freebsd_committer freebsd_triage 2022-11-24 07:06:36 UTC
(In reply to Dan Nelson from comment #3)
You can just add empty lines inside .EE and .EX:

--- sox.1.orig  2022-11-24 07:48:14.998148000 +0100
+++ sox.1       2022-11-24 07:59:44.110316000 +0100
@@ -93,7 +93,9 @@
 To show how this works in practice, here is a selection of examples of
 how SoX might be used.  The simple
 .EX
+
    sox recital.au recital.wav
+
 .EE
 translates an audio file in Sun AU format to a Microsoft WAV file, whilst
 .EX

I would send this patch upstream instead of keeping this locally.

Also, I don't see those warnings when doing man ./sox.1 in the extracted page. What FreeBSD version are you using? We changed to mandoc(1) some time ago.

Cheers.
Comment 5 Dan Nelson 2022-11-25 00:54:36 UTC
Created attachment 238323 [details]
work around manpage formatting issues

I'm falling deeper into the roff rabbit hole.

Putting manual blanks in every place that EE/EX is used feels like a hack...  I tried putting the blanks inside the definitions of the two blocks at the top of the manpage, but it seems that those two macro definitions are completely unused.  It's as if the default EE/EX macros are overriding the ones defined in the manpage.  Globally renaming the macros to something else makes them work, and they include blank lines already.


As for the warnings, I'm running 13.1-STABLE from October, and the man wrapper decides to call groff because it runs "mandoc -Tlint -Wunsupp" as a test, and if that fails it calls groff.  The test fails with these messages:

mandoc: <stdin>:3535:2: UNSUPP: ignoring macro in table: B dcshift
mandoc: <stdin>:3549:2: UNSUPP: ignoring macro in table: B vol
mandoc: <stdin>:3552:2: UNSUPP: ignoring macro in table: B Clipping

Replacing the B markup macros with \fB..\fR font-selection escapes lets mandoc run without warnings.


The attached patches address both problems.
Comment 6 Fernando Apesteguía freebsd_committer freebsd_triage 2022-11-25 16:46:47 UTC
Committed,

Thanks!
Comment 7 commit-hook freebsd_committer freebsd_triage 2022-11-25 16:47:10 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=0613b0fd68faf2d13925745831b046ed306dbbb8

commit 0613b0fd68faf2d13925745831b046ed306dbbb8
Author:     Dan Nelson <dnelson@allantgroup.com>
AuthorDate: 2022-11-25 06:35:15 +0000
Commit:     Fernando Apesteguía <fernape@FreeBSD.org>
CommitDate: 2022-11-25 16:42:33 +0000

    audio/sox: fix man page.

    Rename custom macros.
    Use \fB..\fR to let mandoc(1) run without warnings.

    PR:             267908
    Reported by:    dgilbert@eicat.ca

 audio/sox/Makefile                |  9 +++++++++
 audio/sox/files/patch-sox.1 (new) | 26 ++++++++++++++++++++++++++
 2 files changed, 35 insertions(+)