Files
craft-libs/crates/print/Cargo.toml
T
Dylan M. Taylor 733a038aa5 craft-print: log why the printer list is empty when lpstat can't run; document Flatpak needs (#429)
* craft-print: log why the printer list is empty when lpstat can't run; document Flatpak needs

Flatpak apps saw "No printers found" with working CUPS printers: the Freedesktop
runtime has libcups but not lpstat/lp, and the sandbox had neither the CUPS socket
nor Avahi (driverless printers come from lpstat -e). Log the spawn failure and say
in the README what a Flatpak must bundle and grant.

* craft-print: log a failed lpstat -p -d; README separates what each Flatpak piece is for

Review (CodeRabbit): a non-zero lpstat exit was dropped silently, and the README
said any missing piece empties the printer list when only lpstat and the socket do.

* craft-print README: driver options need the PPD, remote servers need network, socket paths are remapped

Review (CodeRabbit): printer_options reads /etc/cups/ppd before lpoptions, so it is
the PPD, not lpoptions, that a Flatpak lacks; a client.conf server is reached only
with --share=network.

* craft-print README: scope the CUPS_SERVER override to one app; describe the stricter socket wrapper

Review (CodeRabbit): flatpak override without an app id applies to every app.
2026-10-29 18:48:26 -04:00

42 lines
1.7 KiB
TOML

[package]
name = "craft-print"
version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true
description = "System PDF print spooler for the Craft apps: CUPS and Windows"
[dependencies]
# Safe API; Win32 calls are isolated in this maintained MIT OR Apache-2.0 dependency.
craft-winprint-gdi = { git = "https://github.com/storytold/winprint.rs", rev = "417ac3c4d14d3da5485a99c7d5ce8f05664ec312" }
[lints]
workspace = true
[target.'cfg(unix)'.dependencies]
# Says why the printer list is empty when lpstat can't run (e.g. a Flatpak without CUPS tools).
log = "0.4"
[target.'cfg(windows)'.dependencies]
# Printing without starting anything (storytold/pdfcraft#1107): the printer list (EnumPrinters)
# and the job (Windows.Data.Pdf drawn with Direct2D into the XPS print API, options as a
# PrintTicket) are safe wrappers over Win32 and WinRT (BSD-3-Clause). Its default `pdfium`
# feature downloads PDFium at build time and is off. The maintained BSD-3-Clause fork
# preserves terminal failures/cancellation and bounds the completion notification wait.
# Pinned to an immutable revision; review before bumping.
winprint = { git = "https://github.com/storytold/winprint.rs", rev = "5f80b9baf6b58937c401656634e42d33f00ddf49", default-features = false }
# GetDefaultPrinter (MIT).
winsafe = { version = "0.0.29", default-features = false, features = ["winspool"] }
# The job file's private folder.
tempfile = "3"
# Reading the PrintTicket and PrintCapabilities the driver hands back.
roxmltree = "0.21"
# Inflating the print-ready PDF's cross-reference and object streams (src/sheets.rs).
miniz_oxide = "0.9"
[dev-dependencies]
tempfile = "3"
roxmltree = "0.21"
miniz_oxide = "0.9"