Files
wordcraft/packaging/linux/nfpm.yaml
T
bmh129andbmh129 639b8133ea Linux: stay on native Wayland when the X11 libraries are missing (#3359)
The deb and rpm only recommend the X11 libraries, and the release tarball
doesn't install them. When the display-server choice (#2184) or
WORDCRAFT_WAYLAND=0 asked for XWayland without them, the app failed to
start: winit panicked in xkbcommon-dl without libxkbcommon-x11 (seen on
Fedora 44 and Ubuntu 26.04).

uses_x11 now also takes a check of the libraries winit's X11 backend opens
(libX11, libXcursor, libX11-xcb, libXi, libxkbcommon-x11), asked only when
X11 would be forced. If any is missing, X11 isn't forced and the log line
names them. The packages now also recommend libX11-xcb and
libxkbcommon-x11, and the README lists the libraries XWayland needs.

Tests: missing_x11_libraries_leave_the_app_on_wayland (every way of asking
for X11, and that asking for Wayland doesn't run the check).

Co-authored-by: bmh129 <11478682+bmh129@users.noreply.github.com>
2026-11-11 12:04:55 -05:00

95 lines
3.5 KiB
YAML

# .deb and .rpm packages (nfpm: https://nfpm.goreleaser.com). Run by package.sh, which stages
# the file tree, substitutes its path for ${STAGE} (nfpm doesn't expand env vars in `src`) and
# exports VERSION and NFPM_ARCH.
#
# nfpm package -f packaging/linux/nfpm.yaml -p deb -t dist/release/
name: wordcraft
arch: ${NFPM_ARCH}
platform: linux
version: ${VERSION}
# semver: 0.2.0-rc.1 becomes 0.2.0~rc.1 in deb/rpm, so pre-releases sort before the release.
version_schema: semver
release: 1
section: graphics
priority: optional
maintainer: ${WORDCRAFT_MAINTAINER}
vendor: Learning Machines LLC
homepage: https://getartcraft.com/apps/wordcraft
license: MIT OR Apache-2.0
description: |-
Open-source, native word processor that works the way Word users expect.
The ribbon, styles, tables, track changes, references and mail merge; reads
and writes .docx, opens .odt, .rtf, .html, .md and .txt, and exports PDF.
Includes wordcraft-cli, a headless converter and command runner.
# The binaries link only glibc and libgcc_s directly. Windowing (X11/Wayland, xkbcommon) and the
# GPU (Vulkan, EGL/GL) are loaded at runtime, so they are dependencies/recommendations here
# rather than ELF NEEDED entries. Read Aloud speaks through espeak-ng (or Speech Dispatcher), a
# program it starts, so that is a recommendation too. Without the X11 libraries the app stays on
# native Wayland rather than starting through XWayland (see `uses_x11` in main.rs).
overrides:
deb:
depends:
- libc6 (>= 2.35)
- libgcc-s1
- libxkbcommon0
- libvulkan1 | libegl1
recommends:
- libwayland-client0
- libx11-6
- libx11-xcb1
- libxkbcommon-x11-0
- libxcursor1
- libxi6
- libxrandr2
- mesa-vulkan-drivers
- xdg-desktop-portal
- espeak-ng | speech-dispatcher
rpm:
# Library sonames rather than package names, so the same requirements resolve on Fedora/RHEL
# and openSUSE (which has no libxkbcommon, vulkan-loader or libglvnd-egl package).
depends:
- libc.so.6()(64bit)
- libm.so.6(GLIBC_2.35)(64bit)
- libgcc_s.so.1()(64bit)
- libxkbcommon.so.0()(64bit)
- (libvulkan.so.1()(64bit) or libEGL.so.1()(64bit))
recommends:
- libwayland-client
- libX11
- libX11-xcb
- libxkbcommon-x11
- libXcursor
- libXi
- libXrandr
- mesa-vulkan-drivers
- xdg-desktop-portal
- espeak-ng
contents:
- src: ${STAGE}/usr/bin/wordcraft
dst: /usr/bin/wordcraft
file_info: { mode: 0755 }
- src: ${STAGE}/usr/bin/wordcraft-cli
dst: /usr/bin/wordcraft-cli
file_info: { mode: 0755 }
# Named one by one rather than as a tree of /usr/share: a tree would also own shared directories
# such as /usr/share/mime, which openSUSE's filesystem package owns with other modes, and RPM
# refuses to install a package that conflicts with it.
- src: ${STAGE}/usr/share/applications/ai.storyteller.wordcraft.desktop
dst: /usr/share/applications/ai.storyteller.wordcraft.desktop
- src: ${STAGE}/usr/share/mime/packages/ai.storyteller.wordcraft.xml
dst: /usr/share/mime/packages/ai.storyteller.wordcraft.xml
- src: ${STAGE}/usr/share/metainfo/ai.storyteller.wordcraft.metainfo.xml
dst: /usr/share/metainfo/ai.storyteller.wordcraft.metainfo.xml
- src: ${STAGE}/usr/share/icons/hicolor/
dst: /usr/share/icons/hicolor/
type: tree
- src: ${STAGE}/usr/share/doc/wordcraft/
dst: /usr/share/doc/wordcraft/
type: tree
scripts:
postinstall: packaging/linux/postinst.sh
postremove: packaging/linux/postinst.sh