Commit515c6de8Recorded24 Aug 2026Repositorycore-channel

swayimg: declare CXX -- it is a C++ project and my scoping missed that

Message

meson.build:3 is project('swayimg', 'c', 'cpp', ...) with cpp_std=c++20 and about thirty .cpp sources. The scoping pass enumerated every dependency() call carefully and never read the project() line, so the estimate said 'one new package, LuaJIT' when the truth is one new package AND a C++ toolchain requirement. The libraries were right; the language was never looked at.

Fixed the same way core/gperf does it -- CXX is not builder-owned, because the refusal list is derived from the assignments the builder emits and it emits no C++ one, so a package may declare its own. swayimg is the second package in the channel to need it.

Builds and installs. The binary self-reports version 5.5 with png among its supported formats, so the one decoder that was configured in is present.

Worth recording that a prediction of mine came out NEGATIVE: I expected C++ might drag in the DWARF unwinder that LuaJIT needed, since exceptions use the same machinery. It did not -- swayimg links clean without -lunwind.

Changed
 src/core/packages/viewer.sgl | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
Diff
src/core/packages/viewer.sglmodified
@@ -85,6 +85,28 @@
85
dependencies: (list libxkbcommon fontconfig freetype wayland
86
wayland-protocols libpng luajit
87
expat zlib libffi)
+88
;; SWAYIMG IS A C++ PROJECT, AND I MISSED THAT WHEN SCOPING IT.
+89
;;
+90
;; `meson.build:3` is `project('swayimg', 'c', 'cpp', ...)` with
+91
;; `cpp_std=c++20` and roughly thirty `.cpp` sources. My scoping pass
+92
;; enumerated every `dependency()` call carefully and never read the
+93
;; `project()` line, so the estimate said "one new package, LuaJIT" when
+94
;; the truth is one new package AND a C++ toolchain requirement. The
+95
;; libraries were right; the LANGUAGE was not looked at.
+96
;;
+97
;; The failure is loud and names itself, at least:
+98
;;
+99
;; meson.build:3:0: ERROR: Unknown compiler(s):
+100
;; [['c++'], ['g++'], ['clang++'], ['nvc++'], ['pgc++'], ...]
+101
;;
+102
;; meson probes for a C++ compiler BY NAME and the toolchain ships
+103
;; none, so it falls through every candidate. `CXX` is not
+104
;; builder-owned -- the refusal list is derived from what the builder
+105
;; emits and it emits no C++ assignment -- so a package may declare
+106
;; one, and meson honours `CXX` for the cpp language. This is the same
+107
;; mechanism `core/gperf` uses and the second package in the channel to
+108
;; need it. The explicit `-target` is required by the zig guard.
+109
env: (list (cons "CXX" "zig c++ -target x86_64-linux-musl"))
110
build-inputs: (list meson samurai python)
111
phases: (list
112
(external-phase