-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathfreedesktop.wayland-protocols-stable.lua
More file actions
124 lines (122 loc) · 6.66 KB
/
Copy pathfreedesktop.wayland-protocols-stable.lua
File metadata and controls
124 lines (122 loc) · 6.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
-- freedesktop.wayland-protocols-stable — the stable extension protocols,
-- pre-generated.
--
-- ─────────────────────────────────────────────────────────────────────────
-- WHY THIS IS A FORK AND NOT AN INLINE DESCRIPTOR
--
-- wayland-protocols ships **XML and nothing else**: 65 files under `stable/`,
-- `staging/`, `unstable/` and `experimental/`, plus a pkg-config entry
-- naming the directory. A consumer runs `wayland-scanner` over the ones it
-- uses and compiles the result itself — there is no library to link and no
-- header to include until someone generates them.
--
-- So an inline descriptor has nothing to compile. The generator runs once in
-- [mcpplibs/wayland-protocols](https://github.com/mcpplibs/wayland-protocols)
-- and the output is checked in, which is the same shape as
-- `freedesktop.wayland`'s own protocol code and for the same reason:
-- precomputable output belongs in the repo, not in every consumer's build.
-- No scanner runs when you build against this — `mcpp build` is the whole
-- toolchain — and the fork's CI regenerates with the ECOSYSTEM's
-- `freedesktop.wayland-scanner`, so the generated code cannot drift from the
-- library that marshals it.
--
-- ─────────────────────────────────────────────────────────────────────────
-- WHY THREE PACKAGES AND NOT ONE
--
-- Because all 65 in one library DOES NOT LINK, and that was measured rather
-- than feared. `staging/` and `unstable/` carry the same protocol at
-- different maturity levels, and the scanner emits the same symbol names:
--
-- multiple definition of `zwp_linux_dmabuf_v1_interface'
--
-- Counted, per exported `wl_interface`:
--
-- stable n staging = 0 stable 21 exports
-- stable n unstable = 13 staging 76
-- staging n unstable = 0 unstable 69
-- within any one tier = 0
--
-- The tier is exactly the boundary along which the protocols coexist, and it
-- is upstream's own directory structure rather than a split invented here. A
-- consumer names the tiers it needs; needing two spellings of one protocol is
-- a real conflict, which is what upstream means by shipping XML.
--
-- HOW A CONSUMER NAMES THEM, and it is not "list what you want". staging and
-- unstable depend on stable INSIDE the fork, as a path dependency, so naming
-- both a tier and stable is an ERROR rather than a redundancy:
--
-- dependency 'freedesktop.wayland-protocols-stable' is requested as both a
-- version dep (by your project) and a path dep (by
-- 'freedesktop.wayland-protocols-staging.49'). Pick one.
--
-- So: want staging? name staging, and stable comes with it. Want only stable?
-- name stable. Never both. tests/examples/wayland-protocols takes the first
-- form and proves protocols from both tiers link into one program.
--
-- ─────────────────────────────────────────────────────────────────────────
-- THE COST OF A WHOLE TIER, MEASURED
--
-- mcpp links a dependency's objects into the consumer, so naming a tier means
-- carrying it. All 65 protocols compile to 270 KB of `wl_interface` tables —
-- 4 KB each. The bulk of the fork is HEADERS (84,288 lines), and a header
-- costs nothing until it is included. Splitting per protocol would mean 65
-- packages for 270 KB.
--
-- `kind = "lib"`, not `"shared"`, and that matches upstream: there is no
-- `libwayland-protocols.so` anywhere, because the marshalling tables are
-- meant to be compiled INTO the program. A shared library would invent an ABI
-- upstream does not have.
package = {
spec = "1",
namespace = "freedesktop",
name = "wayland-protocols-stable",
description = "wayland-protocols stable — xdg-shell, linux-dmabuf-v1, tablet-v2, viewporter, presentation-time",
licenses = {"MIT"},
repo = "https://github.com/mcpplibs/wayland-protocols",
type = "package",
xpm = {
linux = {
-- wayland-protocols' own release number. Upstream tags without a
-- leading v, and so does the fork.
-- 1.49.1 — the third component is THIS FORK's revision, not
-- upstream's: wayland-protocols releases two-component versions and
-- 1.49 is the newest. 1.49.1 is 1.49's XML plus the
-- `wayland-protocols/<name>-enum.h` headers that upstream's own
-- meson installs (include/wayland-protocols/meson.build runs
-- `wayland-scanner enum-header` over every XML) and that this fork
-- did not previously generate.
--
-- wlroots 0.20 includes them from TEN of its public headers, so a
-- consumer of wlroots writing a plain `#include <wlr/...>` needs
-- them on the include path.
--
-- ⭐ They are checked into the fork rather than produced by a
-- `build.mcpp`, which the fork spec otherwise prescribes, because
-- a package cannot export a generated header. Measured
-- 2026-08-31 with a two-package probe:
--
-- mcpp::include_dir() from a build program → PACKAGE-PRIVATE
-- [build] include_dirs in the manifest → propagates
--
-- Additive, not a re-cut of 1.49: the store is keyed by
-- (name, version) and would not re-extract a version it already
-- holds, so a re-cut tag reaches nobody who already built against
-- it. 1.49 stays exactly as published.
["1.49.1"] = {
url = {
GLOBAL = "https://github.com/mcpplibs/wayland-protocols/archive/refs/tags/1.49.1.tar.gz",
CN = "https://gitcode.com/mcpp-res/wayland-protocols/releases/download/1.49.1/wayland-protocols-1.49.1.tar.gz",
},
sha256 = "52b219f5e307c1d0d49fe9429a877aef8d4b65e69224c97053cbf8434fb79237",
},
["1.49"] = {
url = {
GLOBAL = "https://github.com/mcpplibs/wayland-protocols/archive/refs/tags/1.49.tar.gz",
CN = "https://gitcode.com/mcpp-res/wayland-protocols/releases/download/1.49/wayland-protocols-1.49.tar.gz",
},
sha256 = "0f0f6039b9899699fb3228d5bff25e2a5e5a4792b1fa9964001f73387d7a25e4",
},
},
},
mcpp = "*/mcpp/stable/mcpp.toml",
}