doc: generate manpages with scdoc

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I76a1ac451259af5b4eb86a609b367ca36a6a6964
This commit is contained in:
raf 2026-06-25 11:12:25 +03:00
commit 206449a95d
No known key found for this signature in database
GPG key ID: 29D95B64378DB4BF
4 changed files with 219 additions and 0 deletions

View file

@ -4,6 +4,8 @@
pkg-config,
makeBinaryWrapper,
ncurses,
scdoc,
installShellFiles,
wayland,
libxkbcommon,
freetype,
@ -24,6 +26,7 @@ rustPlatform.buildRustPackage (finalAttrs: {
(s + /Cargo.lock)
(s + /Cargo.toml)
(s + /terminfo)
(s + /doc)
];
};
@ -35,6 +38,8 @@ rustPlatform.buildRustPackage (finalAttrs: {
pkg-config
makeBinaryWrapper
ncurses # tic
scdoc # man page generation
installShellFiles # installManPage
];
buildInputs = [
@ -49,6 +54,12 @@ rustPlatform.buildRustPackage (finalAttrs: {
postInstall = ''
mkdir -p "$out/share/terminfo"
tic -x -o "$out/share/terminfo" terminfo/beer.info
# Generate the man pages from their scdoc sources.
scdoc < doc/beer.1.scd > beer.1
scdoc < doc/beer.toml.5.scd > beer.toml.5
installManPage beer.1 beer.toml.5
wrapProgram "$out/bin/beer" \
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [wayland libxkbcommon]}
'';

View file

@ -9,6 +9,7 @@
cargo-deny,
pkg-config,
ncurses,
scdoc,
wayland,
wayland-protocols,
wayland-scanner,
@ -31,6 +32,7 @@ mkShell {
cargo-deny
pkg-config
ncurses # tic, to compile the terminfo entry
scdoc # generate man pages from doc/*.scd
];
buildInputs = [