Commit 3f01782
authored
bsd: remove the Cgo / C-toolchain dependency (share the pure-Go X11 backend) (#121)
FreeBSD, OpenBSD and NetBSD now use the same pure-Go X11 backend as Linux, so
they build and run with CGO_ENABLED=0 and need neither a C toolchain nor libX11.
- Generalize the X11 backend to all four platforms: rename clipboard_x11_linux.go
to clipboard_x11.go with build tag (linux||freebsd||openbsd||netbsd)&&!android,
and guard the Linux-only abstract-socket fallback behind runtime.GOOS.
- Rewrite clipboard_bsd.go as a pure-Go X11-only dispatcher and delete the cgo
binding clipboard_bsd.c. Delete clipboard_x11.c, the shared cgo C
implementation that only the BSD backend still used.
- Extend clipboard_nocgo.go's build tag to exclude the BSDs, so they no longer
degrade to the no-op stubs.
- CI: build the FreeBSD/OpenBSD VM jobs with CGO_ENABLED=0 and drop the libX11
package; they are still build-only (no X server at runtime).
- Tests: replace the per-platform CGO_ENABLED=0 skip guards with a
degradesWithoutCgo() helper that knows the BSDs now have a cgo-free backend.
- README: the BSDs need no Cgo and no X11 dev package.
The X11 logic is unchanged and shared, so the Linux runtime tests cover it; the
BSD code is verified to build for all three (cross-compiled) and on the CI VMs.
Advances #55.1 parent a1e7f1f commit 3f01782
8 files changed
Lines changed: 64 additions & 488 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
| 105 | + | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
109 | | - | |
| 108 | + | |
| 109 | + | |
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
124 | | - | |
| 123 | + | |
| 124 | + | |
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
143 | | - | |
144 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
145 | 146 | | |
146 | 147 | | |
147 | 148 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
37 | 18 | | |
38 | 19 | | |
39 | 20 | | |
40 | 21 | | |
41 | 22 | | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | 23 | | |
46 | | - | |
47 | 24 | | |
48 | 25 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
63 | 29 | | |
64 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
65 | 33 | | |
66 | 34 | | |
67 | 35 | | |
68 | | - | |
69 | | - | |
| 36 | + | |
70 | 37 | | |
71 | 38 | | |
72 | 39 | | |
| |||
75 | 42 | | |
76 | 43 | | |
77 | 44 | | |
78 | | - | |
| 45 | + | |
79 | 46 | | |
80 | | - | |
| 47 | + | |
81 | 48 | | |
82 | 49 | | |
83 | 50 | | |
84 | 51 | | |
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 | 52 | | |
112 | | - | |
113 | 53 | | |
114 | 54 | | |
115 | | - | |
| 55 | + | |
116 | 56 | | |
117 | | - | |
| 57 | + | |
118 | 58 | | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
| 59 | + | |
150 | 60 | | |
151 | 61 | | |
152 | 62 | | |
| |||
173 | 83 | | |
174 | 84 | | |
175 | 85 | | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
28 | 40 | | |
29 | 41 | | |
30 | 42 | | |
31 | 43 | | |
32 | 44 | | |
33 | | - | |
34 | | - | |
| 45 | + | |
| 46 | + | |
35 | 47 | | |
36 | 48 | | |
37 | 49 | | |
| |||
53 | 65 | | |
54 | 66 | | |
55 | 67 | | |
56 | | - | |
| 68 | + | |
57 | 69 | | |
58 | 70 | | |
59 | 71 | | |
| |||
138 | 150 | | |
139 | 151 | | |
140 | 152 | | |
141 | | - | |
| 153 | + | |
142 | 154 | | |
143 | 155 | | |
144 | 156 | | |
| |||
185 | 197 | | |
186 | 198 | | |
187 | 199 | | |
188 | | - | |
| 200 | + | |
189 | 201 | | |
190 | 202 | | |
191 | 203 | | |
| |||
211 | 223 | | |
212 | 224 | | |
213 | 225 | | |
214 | | - | |
| 226 | + | |
215 | 227 | | |
216 | 228 | | |
217 | 229 | | |
| |||
230 | 242 | | |
231 | 243 | | |
232 | 244 | | |
233 | | - | |
| 245 | + | |
234 | 246 | | |
235 | 247 | | |
236 | 248 | | |
| |||
313 | 325 | | |
314 | 326 | | |
315 | 327 | | |
316 | | - | |
317 | | - | |
| 328 | + | |
| 329 | + | |
318 | 330 | | |
319 | 331 | | |
320 | 332 | | |
| |||
0 commit comments