diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/shared-libs.md | 9 | ||||
| -rw-r--r-- | docs/typ/building.typ | 12 | ||||
| -rw-r--r-- | docs/typ/install.typ | 5 |
3 files changed, 22 insertions, 4 deletions
diff --git a/docs/shared-libs.md b/docs/shared-libs.md index b9f64fdf..f6031a0d 100644 --- a/docs/shared-libs.md +++ b/docs/shared-libs.md @@ -29,6 +29,15 @@ pdf` (or `zig build addons`, both) builds and installs each library in home install). MuPDF is compiled only for a step that needs it (`pdf`, the tests); `-Dmupdf` is gone. +Since 2026-11-07 MuPDF, and FreeType with the zlib and libpng it brings, +are lazy dependencies: a build fetches MuPDF only with `-Dpdf` (on by +itself once MuPDF is fetched, and off Linux), and FreeType only for it or a +window, so a fresh checkout's `zig build -Dplatform=tui` downloads none of +them. Zig 0.17's configure is handed the options and never the steps, so +the guard is that option, not the step: without it `pdf`, `addons`, +`static`, `mupdf-check`, `pdf-harness` and the PDF benches say to add +`-Dpdf`, and the tests leave their PDF cases out. + ## One static pardes (2026-11-06) `zig build static -Dplatform=tui -Dtarget=x86_64-linux-musl` links the diff --git a/docs/typ/building.typ b/docs/typ/building.typ index 8520fbbf..151d4b3f 100644 --- a/docs/typ/building.typ +++ b/docs/typ/building.typ @@ -14,8 +14,15 @@ fetched and pinned by the manifest; the terminal build needs no system package. The SDL shell builds SDL3 and FreeType from source. Pictures and PDFs are addons, each its own step: `zig build image`, `zig build pdf` (`pdf.so`, over MuPDF, its own FreeType and zlib in it), or `zig build -addons` for both; the binaries hold neither, and MuPDF is compiled only -for the `pdf` step and the tests. +addons` for both; the binaries hold neither. MuPDF, and the FreeType and +zlib the terminal build takes only for it, are lazy: a build fetches them +only with `-Dpdf`, which is on by itself once MuPDF is fetched, so a fresh +checkout's `zig build -Dplatform=tui` downloads none of them, and its +first `zig build pdf -Dpdf` (or `addons`, `static`, `mupdf-check`, a PDF +bench) fetches MuPDF once; without it those steps say to add `-Dpdf`, and +the tests leave their PDF cases out. (Zig 0.17's configure is handed the +options and never the steps asked for, so a step cannot fetch for itself.) +MuPDF is compiled only for the steps and tests that use `pdf.so`. #pairs( [`zig build`], [the terminal shell and the SDL window together, *installed into `~/.local/bin`* (`pardes` and `pardes-gui`)], @@ -41,6 +48,7 @@ must share with its session; `pardes --help` lists every flag. #pairs( [`-Dplatform`], [`tui`, `gui`, `macos`; absent: the tui and SDL shells together, installed into `~/.local`], + [`-Dpdf`], [bool: build the pdf addon, fetching MuPDF the first time; default on once MuPDF is fetched, and off Linux], [`-Djpx`], [bool, `true`: JPEG 2000, and with it scanned PDFs], [`-Dtree-sitter`], [`disabled`, `zig`, `minimal`, `full`; `full`], [`-Dembed-sources`], [bool, `false`: serve the sources under #file("/src")], diff --git a/docs/typ/install.typ b/docs/typ/install.typ index 28ed67c8..9b23669f 100644 --- a/docs/typ/install.typ +++ b/docs/typ/install.typ @@ -22,9 +22,10 @@ With Zig 0.17 (the build fetches everything else; once that is downloaded, a first build from a clean cache took 62 seconds on 16 cores): #cmd("# pardes, in a terminal\nzig build -Dplatform=tui --prefix ~/.local") #cmd("# pardes-gui, its own window\nzig build -Dplatform=gui --prefix ~/.local") -#cmd("# the image and PDF addons (or `zig build image pdf`)\nzig build addons -Dplatform=tui --prefix ~/.local") +#cmd("# the image and PDF addons (or `zig build image pdf`)\nzig build addons -Dpdf -Dplatform=tui --prefix ~/.local") Then run `pardes` or `pardes FILE`. The addons are steps of their own: `lib/pardes/addons/image.so`, the image addon, and -`lib/pardes/addons/pdf.so`, the PDF addon (over MuPDF), which pardes +`lib/pardes/addons/pdf.so`, the PDF addon (over MuPDF, which `-Dpdf` +fetches the first time and every build after takes as fetched), which pardes loads at start from its prefix; a pardes without them (a downloaded binary alone) shows image files and PDFs as text. |
