help: send readers to the install targets, in the alert and the manual
The failure alert told people to run `cmake --install build --prefix ~/.local`; that still works, but `cmake --build build --target install-help-user` is the form that needs no prefix guessing and prints the path it wrote, so the alert names it and stays its former length. The manual gains a short "Installing this manual" section on the overview page naming both targets -- the no-root user one and the prefix-driven one for a system-wide or packaged install, which the caller wraps in sudo -- and README and the GTK invariants doc follow the alert's new command.
This commit is contained in:
1 parent
669db6df9a
commit
395c9caec3
4 files changed
+27
-9
No files matched your search
@@ -2466,10 +2466,11 @@ alert says **which** thing is missing, because the two have different fixes: `he
|
||||
looks for the document under `$XDG_DATA_HOME/help/<lang>/org.udpscope.app/` then
|
||||
`$XDG_DATA_DIRS/help/<lang>/org.udpscope.app/`, so with the set installed the alert names the missing
|
||||
*viewer* (`yelp`), and without it the alert names the identifier, the expected installed path and the
|
||||
install command — `cmake --install build --prefix ~/.local`, which writes
|
||||
`~/.local/share/help/C/org.udpscope.app/`. Two opt-in targets install the manual *alone*, without a
|
||||
whole `cmake --install`: `cmake --build build --target install-help-user` writes the same
|
||||
`$XDG_DATA_HOME` (default `~/.local/share`) copy the alert describes and needs no root, while
|
||||
install command — `cmake --build build --target install-help-user`, the no-root form below, which
|
||||
writes the set under `$XDG_DATA_HOME` (default `~/.local/share/help/C/org.udpscope.app/`) and prints
|
||||
the path it wrote. Two opt-in targets install the manual *alone*, without a
|
||||
whole `cmake --install`: `install-help-user` writes that `$XDG_DATA_HOME` (default `~/.local/share`)
|
||||
copy and needs no root, while
|
||||
`cmake --build build --target install-help` writes to the configured `CMAKE_INSTALL_PREFIX` for a
|
||||
packager or a system-wide user to wrap in `sudo`; both print where they wrote. A build tree has
|
||||
neither the installed copy nor a
|
||||
|
||||
@@ -159,7 +159,8 @@ Part of [CLAUDE.md](../../CLAUDE.md). These are rules that cost a defect to lear
|
||||
`$XDG_DATA_HOME/help/<lang>/<id>/` then `$XDG_DATA_DIRS/help/<lang>/<id>/` for an `index.page` and
|
||||
the dialog says which one it is: with the manual there, install a viewer (for example `yelp`); with
|
||||
it absent, the identifier, the expected installed path and the install command
|
||||
(`cmake --install build --prefix ~/.local`, which writes `~/.local/share/help/C/<id>/`) — and a
|
||||
(`cmake --build build --target install-help-user`, which installs it under the user data
|
||||
directory; `install-help` is the prefix-wide form for a system or packaged install) — and a
|
||||
viewer as well, the second possibility the error alone cannot rule out. Reporting a missing
|
||||
*document* as a missing *handler* is the defect that shape avoids.
|
||||
|
||||
|
||||
@@ -167,4 +167,20 @@
|
||||
</list>
|
||||
</section>
|
||||
|
||||
<section id="installing">
|
||||
<title>Installing this manual</title>
|
||||
<p>The manual is a help set the desktop viewer reads off disk, so <key>F1</key> opens it only
|
||||
once a copy sits where <cmd>help:</cmd> resolves. Either of two targets installs it on its own,
|
||||
without building the application, and each prints where it wrote:</p>
|
||||
<list>
|
||||
<item><p>For your own account, needing no root:
|
||||
<cmd>cmake --build build --target install-help-user</cmd> writes it under
|
||||
<file>$XDG_DATA_HOME</file> (default <file>~/.local/share</file>).</p></item>
|
||||
<item><p>For a system-wide or packaged install:
|
||||
<cmd>cmake --build build --target install-help</cmd> writes it under the configured
|
||||
<cmd>CMAKE_INSTALL_PREFIX</cmd>, so point that at <file>/usr</file> and wrap the target in
|
||||
<cmd>sudo</cmd>.</p></item>
|
||||
</list>
|
||||
</section>
|
||||
|
||||
</page>
|
||||
+4
-4
@@ -80,10 +80,10 @@ void on_help_launched(GObject* source, GAsyncResult* result, gpointer user) {
|
||||
detail += "The manual does not look installed: nothing named \"help:" UDPSCOPE_HELP_NAME
|
||||
"\" was found under $XDG_DATA_HOME/help/<lang>/" UDPSCOPE_HELP_NAME "/ or "
|
||||
"$XDG_DATA_DIRS/help/<lang>/" UDPSCOPE_HELP_NAME "/. Install it with\n\n"
|
||||
" cmake --install build --prefix ~/.local\n\n"
|
||||
"which writes ~/.local/share/help/C/" UDPSCOPE_HELP_NAME "/ -- the directory "
|
||||
"`help:" UDPSCOPE_HELP_NAME "` resolves to. If there is no `help:` viewer either, "
|
||||
"install one as well (for example `yelp`).";
|
||||
" cmake --build build --target install-help-user\n\n"
|
||||
"which writes the manual where `help:" UDPSCOPE_HELP_NAME "` resolves it under "
|
||||
"your data directory, and prints the path it wrote. If there is no `help:` viewer "
|
||||
"either, install one as well (for example `yelp`).";
|
||||
}
|
||||
gtk_alert_dialog_set_detail(alert, detail.c_str());
|
||||
gtk_alert_dialog_show(alert, launch->parent);
|
||||
|
||||
Reference in new issue
Block a user