Bug#1092444: sdl2-config.1: Some remarks and a patch with editorial changes for this man page
Bjarni Ingi Gislason
bjarniig at simnet.is
Tue Jan 7 21:21:08 GMT 2025
Package: libsdl2-dev
Version: 2.30.11+dfsg-1
Severity: minor
Tags: patch
* What led up to the situation?
Checking for defects with a new version
test-[g|n]roff -mandoc -t -K utf8 -rF0 -rHY=0 -rCHECKSTYLE=10 -ww -z < "man page"
[Use "groff -e ' $' <file>" to find trailing spaces.]
["test-groff" is a script in the repository for "groff"; is not shipped]
(local copy and "troff" slightly changed by me).
[The fate of "test-nroff" was decided in groff bug #55941.]
* What was the outcome of this action?
an.tmac:<stdin>:59: misuse, warning: .BI is for at least 2 arguments, got 1
Use macro '.B' for one argument or split argument.
an.tmac:<stdin>:87: misuse, warning: .BI is for at least 2 arguments, got 1
Use macro '.B' for one argument or split argument.
* What outcome did you expect instead?
No output (no warnings).
-.-
General remarks and further material, if a diff-file exist, are in the
attachments.
-- System Information:
Debian Release: trixie/sid
APT prefers testing
APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Kernel: Linux 6.12.6-amd64 (SMP w/2 CPU threads; PREEMPT)
Locale: LANG=is_IS.iso88591, LC_CTYPE=is_IS.iso88591 (charmap=ISO-8859-1), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: sysvinit (via /sbin/init)
Versions of packages libsdl2-dev depends on:
ii libasound2-dev 1.2.13-1
ii libdbus-1-dev 1.16.0-1
ii libdecor-0-dev 0.2.2-2
ii libdrm-dev 2.4.123-1
ii libegl-dev 1.7.0-1+b2
ii libgbm-dev 24.2.8-1
ii libgl-dev 1.7.0-1+b2
ii libgles-dev 1.7.0-1+b2
ii libibus-1.0-dev 1.5.31-1
ii libpulse-dev 17.0+dfsg1-1
ii libsamplerate0-dev 0.2.2-4+b2
ii libsdl2-2.0-0 2.30.11+dfsg-1
ii libsndio-dev 1.10.0-0.1
ii libudev-dev 257.1-5
ii libwayland-dev 1.23.0-1+b1
ii libx11-dev 2:1.8.10-2
ii libxcursor-dev 1:1.2.2-1+b1
ii libxext-dev 2:1.3.4-1+b3
ii libxfixes-dev 1:6.0.0-2+b3
ii libxi-dev 2:1.8.2-1
ii libxinerama-dev 2:1.1.4-3+b3
ii libxkbcommon-dev 1.7.0-2
ii libxrandr-dev 2:1.5.4-1+b2
ii libxss-dev 1:1.2.3-1+b3
ii libxt-dev 1:1.2.1-1.2+b2
ii libxv-dev 2:1.0.11-1.1+b3
ii libxxf86vm-dev 1:1.1.4-1+b4
libsdl2-dev recommends no packages.
libsdl2-dev suggests no packages.
-- no debconf information
-------------- next part --------------
Input file is sdl2-config.1
Any program (person), that produces man pages, should check the output
for defects by using (both groff and nroff)
[gn]roff -mandoc -t -ww -b -z -K utf8 <man page>
The same goes for man pages that are used as an input.
For a style guide use
mandoc -T lint
-.-
So any 'generator' should check its products with the above mentioned
'groff', 'mandoc', and additionally with 'nroff ...'.
This is just a simple quality control measure.
The 'generator' may have to be corrected to get a better man page,
the source file may, and any additional file may.
Common defects:
Input text line longer than 80 bytes.
Not removing trailing spaces (in in- and output).
The reason for these trailing spaces should be found and eliminated.
Not beginning each input sentence on a new line.
Lines should thus be shorter.
See man-pages(7), item 'semantic newline'.
-.-
The difference between the formatted output of the original and patched file
can be seen with:
nroff -mandoc <file1> > <out1>
nroff -mandoc <file2> > <out2>
diff -u <out1> <out2>
and for groff, using
"printf '%s\n%s\n' '.kern 0' '.ss 12 0' | groff -mandoc -Z - "
instead of 'nroff -mandoc'
Add the option '-t', if the file contains a table.
Read the output of 'diff -u' with 'less -R' or similar.
-.-.
If 'man' (man-db) is used to check the manual for warnings,
the following must be set:
The option "-warnings=w"
The environmental variable:
export MAN_KEEP_STDERR=yes (or any non-empty value)
or
(produce only warnings):
export MANROFFOPT="-ww -b -z"
export MAN_KEEP_STDERR=yes (or any non-empty value)
-.-.
Output from "mandoc -T lint sdl2-config.1": (shortened list)
1 input text line longer than 80 bytes
-.-.
Output from "test-groff -mandoc -t -ww -z sdl2-config.1": (shortened list)
2 Use macro '.B' for one argument or split argument.
2 .BI is for at least 2 arguments, got 1
-.-.
Change two HYPHEN-MINUSES (code 0x2D) to an em-dash (\(em),
if one is intended.
" \(em " creates a too big gap in the text (in "troff").
An en-dash is usually surrounded by a space,
while an em-dash is used without spaces.
"man" (1 byte characters in input) transforms an en-dash (\(en) to one
HYPHEN-MINUS,
and an em-dash to two HYPHEN-MINUSES without considering the space
around it.
If "--" are two single "-"
(begin of an option or end of options)
then use "\-\-".
sdl2-config.1:57:.BR "${PKG_CONFIG:-pkg-config} --cflags sdl2" .
sdl2-config.1:63:.BR "${PKG_CONFIG:-pkg-config} --variable=exec_prefix sdl2" .
sdl2-config.1:79:.BR "${PKG_CONFIG:-pkg-config} --libs sdl2" .
sdl2-config.1:85:.BR "${PKG_CONFIG:-pkg-config} --static --libs sdl2" .
sdl2-config.1:90:.BR "${PKG_CONFIG:-pkg-config} --variable=prefix sdl2" .
sdl2-config.1:106:.B ${PKG_CONFIG:-pkg-config} --modversion
sdl2-config.1:110:gcc -o main.o $(sdl2-config --cflags) main.c
sdl2-config.1:115:gcc -o my_app $(sdl2-config --libs) main.o util.o
-.-.
Wrong distance between sentences in the input file.
Separate the sentences and subordinate clauses; each begins on a new
line. See man-pages(7) ("Conventions for source file layout") and
"info groff" ("Input Conventions").
The best procedure is to always start a new sentence on a new line,
at least, if you are typing on a computer.
Remember coding: Only one command ("sentence") on each (logical) line.
E-mail: Easier to quote exactly the relevant lines.
Generally: Easier to edit the sentence.
Patches: Less unaffected text.
Search for two adjacent words is easier, when they belong to the same line,
and the same phrase.
The amount of space between sentences in the output can then be
controlled with the ".ss" request.
Mark a final abbreviation point as such by suffixing it with "\&".
130:Updated in 2013 by Manuel A. Fernandez Montecelo <mafm at debian.org>.
-.-.
Split lines longer than 80 characters into two or more lines.
Appropriate break points are the end of a sentence and a subordinate
clause; after punctuation marks.
Line 82, length 85
Print the linker flags that are necessary to statically link a program that uses SDL.
-.-.
Split a punctuation from a single argument, if a two-font macro is meant.
24:.B sdl2-config.
-.-.
Put a subordinate sentence (after a comma) on a new line.
15:flags that should be used to compile and link programs, libraries, and
19:In new code, consider using
25:To support cross-compiling, if the environment variable
27:is set, its value should be used instead of the literal name
32:In Autotools build systems, the preferred way to detect SDL is with the
33:.B "PKG_CHECK_MODULES([SDL], [sdl2])"
37:In Meson build systems, the preferred way to detect SDL is with Meson's
42:In CMake build systems, the preferred way to detect SDL is to use
60:If \fIDIR\fR is not specified, print the exec prefix of the current SDL
65:If \fIDIR\fR is specified, use it instead of the installation exec prefix that
66:SDL was built with when computing the output for the --cflags, --libs and
68:--cflags, --libs and --static-libs.
88:If \fIDIR\fR is not specified, print the prefix of the current SDL installation.
92:If \fIDIR\fR is specified, use it instead of the installation prefix that SDL
93:was built with when computing the output for the --cflags, --libs and
127:This manual page was written by Branden Robinson, originally for Progeny
128:Linux Systems, Inc., and the Debian Project.
-.-.
Remove quotes when there is no space character between them
and the quotes are not for emphasis (markup),
for example as an argument to a macro.
1:.TH sdl2-config 1 "2024-01-10" "SDL 2.0"
72:.BR "" [ --cflags | --libs "|...]"
100:.BR "" [ --cflags | --libs "|...]"
-.-.
Output from "test-groff -mandoc -t -K utf8 -rF0 -rHY=0 -rCHECKSTYLE=10 -ww -z ":
an.tmac:<stdin>:59: misuse, warning: .BI is for at least 2 arguments, got 1
Use macro '.B' for one argument or split argument.
an.tmac:<stdin>:87: misuse, warning: .BI is for at least 2 arguments, got 1
Use macro '.B' for one argument or split argument.
-.-.
Additionally (general):
Abbreviations get a '\&' added after their final full stop (.) to mark them
as such and not as an end of a sentence.
-------------- next part --------------
--- sdl2-config.1 2025-01-07 20:36:58.357689930 +0000
+++ sdl2-config.1.new 2025-01-07 21:12:29.025057078 +0000
@@ -1,45 +1,54 @@
-.TH sdl2-config 1 "2024-01-10" "SDL 2.0"
+.TH sdl2-config 1 2024-01-10 "SDL 2.0"
.SH NAME
sdl2-config \- script to get information about the installed version of SDL
.SH SYNOPSIS
.B sdl2-config
-[\fB--prefix\fR[\fB=\fIDIR\fR]]
-[\fB--exec-prefix\fR[\fB=\fIDIR\fR]]
-[\fB--version\fR]
-[\fB--cflags\fR]
-[\fB--libs\fR]
-[\fB--static-libs\fR]
+[\fB\-\-prefix\fR[\fB=\fIDIR\fR]]
+[\fB\-\-exec-prefix\fR[\fB=\fIDIR\fR]]
+[\fB\-\-version\fR]
+[\fB\-\-cflags\fR]
+[\fB\-\-libs\fR]
+[\fB\-\-static-libs\fR]
.SH DESCRIPTION
.B sdl2-config
-is a tool that is used to configure and determine the compiler and linker
-flags that should be used to compile and link programs, libraries, and
-plugins that use SDL. It is also used internally by the m4 macros that are
-included with SDL.
+is a tool
+that is used to configure
+and determine the compiler
+and linker flags
+that should be used to compile and link programs,
+libraries, and plugins that use SDL.
+It is also used internally by the m4 macros
+that are included with SDL.
.P
-In new code, consider using
+In new code,
+consider using
.BR pkg-config (1)
or
.BR pkgconf (1)
instead of
-.B sdl2-config.
-To support cross-compiling, if the environment variable
+.BR sdl2-config .
+To support cross-compiling,
+if the environment variable
.B PKG_CONFIG
-is set, its value should be used instead of the literal name
+is set,
+its value should be used instead of the literal name
.B pkg-config
or
.BR pkgconf .
.P
-In Autotools build systems, the preferred way to detect SDL is with the
+In Autotools build systems,
+the preferred way to detect SDL is with the
.B "PKG_CHECK_MODULES([SDL], [sdl2])"
macro invocation from
.BR pkg.m4 (7).
.P
-In Meson build systems, the preferred way to detect SDL is with Meson's
-usual
+In Meson build systems,
+the preferred way to detect SDL is with Meson's usual
.B dependency('sdl2')
function call.
.P
-In CMake build systems, the preferred way to detect SDL is to use
+In CMake build systems,
+the preferred way to detect SDL is to use
.B "find_package(SDL2 CONFIG)"
and optionally
.BR "find_package(SDL2 CONFIG COMPONENTS SDL2main)" ,
@@ -49,70 +58,81 @@ and optionally
.BR SDL2::SDL2main .
.SH OPTIONS
.TP
-.B --cflags
-Print the compiler flags that are necessary to compile a program or library
+.B \-\-cflags
+Print the compiler flags
+that are necessary to compile a program or library
that uses SDL.
.IP
The pkg-config equivalent is
-.BR "${PKG_CONFIG:-pkg-config} --cflags sdl2" .
+.BR "${PKG_CONFIG:\-pkg-config} \-\-cflags sdl2" .
.TP
-.BI --exec-prefix\fR[=\fIDIR\fR]
-If \fIDIR\fR is not specified, print the exec prefix of the current SDL
-installation.
+.BR \-\-exec-prefix [ = \fIDIR\fR]
+If \fIDIR\fR is not specified,
+print the exec prefix of the current SDL installation.
The pkg-config equivalent is
-.BR "${PKG_CONFIG:-pkg-config} --variable=exec_prefix sdl2" .
+.BR "${PKG_CONFIG:\-pkg-config} \-\-variable=exec_prefix sdl2" .
.IP
-If \fIDIR\fR is specified, use it instead of the installation exec prefix that
-SDL was built with when computing the output for the --cflags, --libs and
---static-libs options. This option must be specified before any of the options
---cflags, --libs and --static-libs.
-The pkg-config equivalent is
-.B ${PKG_CONFIG:-pkg-config}
-.BI --define-variable=exec_prefix= DIR
-.BR "" [ --cflags | --libs "|...]"
+If \fIDIR\fR is specified,
+use it instead of the installation exec prefix
+that SDL was built with
+when computing the output for the \-\-cflags, \-\-libs and
+\-\-static-libs options.
+This option must be specified before any of the options
+\-\-cflags, \-\-libs and \-\-static-libs.
+The pkg-config equivalent is
+.B ${PKG_CONFIG:\-pkg-config}
+.BI \-\-define-variable=exec_prefix= DIR
+.BR "" [ \-\-cflags | \-\-libs |...]
.BR sdl2 .
.TP
-.B --libs
+.B \-\-libs
Print the linker flags that are necessary to link a program that uses SDL.
.IP
The pkg-config equivalent is
-.BR "${PKG_CONFIG:-pkg-config} --libs sdl2" .
+.BR "${PKG_CONFIG:\-pkg-config} \-\-libs sdl2" .
.TP
-.B --static-libs
-Print the linker flags that are necessary to statically link a program that uses SDL.
+.B \-\-static-libs
+Print the linker flags
+that are necessary to statically link a program
+that uses SDL.
.IP
The pkg-config equivalent is
-.BR "${PKG_CONFIG:-pkg-config} --static --libs sdl2" .
+.BR "${PKG_CONFIG:\-pkg-config} \-\-static \-\-libs sdl2" .
.TP
-.BI --prefix\fR[=\fIDIR\fR]
-If \fIDIR\fR is not specified, print the prefix of the current SDL installation.
+.BR \-\-prefix [ = \fIDIR\fR]
+If \fIDIR\fR is not specified,
+print the prefix of the current SDL installation.
The pkg-config equivalent is
-.BR "${PKG_CONFIG:-pkg-config} --variable=prefix sdl2" .
+.BR "${PKG_CONFIG:\-pkg-config} \-\-variable=prefix sdl2" .
.IP
-If \fIDIR\fR is specified, use it instead of the installation prefix that SDL
-was built with when computing the output for the --cflags, --libs and
---static-libs options. This option is also used for the exec prefix if
---exec-prefix was not specified. This option must be specified before any of
-the options --cflags, --libs and --static-libs.
+If \fIDIR\fR is specified,
+use it instead of the installation prefix
+that SDL was built with
+when computing the output for the \-\-cflags, \-\-libs and
+\-\-static-libs options.
+This option is also used for the exec prefix
+if \-\-exec-prefix was not specified.
+This option must be specified before any of the options \-\-cflags,
+\-\-libs and \-\-static-libs.
The pkg-config equivalent is
.B ${PKG_CONFIG:-pkg-config}
-.BI --define-variable=prefix= DIR
-.BR "" [ --cflags | --libs "|...]"
+.BI \-\-define-variable=prefix= DIR
+.BR "" [ \-\-cflags | \-\-libs |...]
.BR sdl2 .
.TP
-.B --version
+.B \-\-version
Prints the currently installed version of SDL on standard output.
The pkg-config equivalent is
-.B ${PKG_CONFIG:-pkg-config} --modversion
+.B ${PKG_CONFIG:\-pkg-config} \-\-modversion
.BR sdl2 .
.SH EXAMPLES
.TP
-gcc -o main.o $(sdl2-config --cflags) main.c
+gcc \-o main.o $(sdl2-config \-\-cflags) main.c
is how you might use
.B sdl2-config
to compile a C source file for an executable program.
.TP
-gcc -o my_app $(sdl2-config --libs) main.o util.o
+gcc \-o my_app $(sdl2-config \-\-libs) main.o util.o
is how you might use
.B sdl2-config
to link compiled objects into an executable program.
@@ -124,9 +144,10 @@ to link compiled objects into an executa
.SH AUTHOR
The Simple DirectMedia Layer (SDL) library was written by Sam Lantinga.
.PP
-This manual page was written by Branden Robinson, originally for Progeny
-Linux Systems, Inc., and the Debian Project.
+This manual page was written by Branden Robinson,
+originally for Progeny Linux Systems, Inc.,
+and the Debian Project.
.br
-Updated in 2013 by Manuel A. Fernandez Montecelo <mafm at debian.org>.
+Updated in 2013 by Manuel A.\& Fernandez Montecelo <mafm at debian.org>.
.br
Updated in 2024 by Simon McVittie.
More information about the Pkg-sdl-maintainers
mailing list