commit 4ba2417
hovercats
·
2026-07-29 09:11:17 +0000 UTC
parent d22268b
neuswc: port this instead. this is much less work than messing with countless patches for swc to make things work instead
6 files changed,
+164,
-0
+3,
-0
1@@ -487,3 +487,6 @@
2 path = pkg/dtach/src
3 url = https://github.com/crigler/dtach
4 shallow = true
5+[submodule "pkg/neuswc/src"]
6+ path = pkg/neuswc/src
7+ url = https://srcdump.net/shrub/neuswc.git
+1,
-0
1@@ -75,6 +75,7 @@ subgen 'nasm'
2 subgen 'ncompress'
3 subgen 'netbsd-curses'
4 subgen 'netsurf'
5+subgen 'neuswc'
6 subgen 'oksh'
7 subgen 'openbsd'
8 subgen 'openntpd'
+1,
-0
1@@ -0,0 +1 @@
2+/tools.ninja
+157,
-0
1@@ -0,0 +1,157 @@
2+cflags{
3+ '-Wall',
4+ '-D _GNU_SOURCE',
5+ '-D screen_new=swc__screen_new',
6+ '-D remove_resource=swc__remove_resource',
7+ '-I $outdir',
8+ '-I $outdir/include',
9+ '-I $srcdir',
10+ '-isystem $builddir/pkg/fontconfig/include',
11+ '-isystem $builddir/pkg/libinput/include',
12+ '-isystem $builddir/pkg/libxkbcommon/include',
13+ '-isystem $builddir/pkg/libdrm/include',
14+ '-isystem $builddir/pkg/linux-headers/include',
15+ '-isystem $builddir/pkg/pixman/include',
16+ '-isystem $builddir/pkg/wayland-protocols/include',
17+ '-isystem $builddir/pkg/wayland/include',
18+ '-isystem $builddir/pkg/wld/include',
19+}
20+
21+cc('launch/protocol.c')
22+
23+waylandproto('protocol/swc.xml', {
24+ client='include/swc-client-protocol.h',
25+ server='include/swc-server-protocol.h',
26+ code='swc-protocol.c',
27+})
28+
29+waylandproto('protocol/server-decoration.xml', {
30+ server='include/server-decoration-server-protocol.h',
31+ code='server-decoration-protocol.c',
32+})
33+
34+waylandproto('protocol/swc_snap.xml', {
35+ server='include/swc_snap-server-protocol.h',
36+ client='include/swc_snap-client-protocol.h',
37+ code='swc_snap-protocol.c',
38+})
39+
40+waylandproto('protocol/swc_select.xml', {
41+ server='include/swc_select-server-protocol.h',
42+ client='include/swc_select-client-protocol.h',
43+ code='swc_select-protocol.c',
44+})
45+
46+waylandproto('protocol/wayland-drm.xml', {
47+ server='include/wayland-drm-server-protocol.h',
48+ code='wayland-drm-protocol.c',
49+})
50+
51+waylandproto('protocol/wlr-layer-shell-unstable-v1.xml', {
52+ client='include/wlr-layer-shell-unstable-v1-protocol.h',
53+ code='wlr-layer-shell-unstable-v1.c'
54+})
55+
56+pkg.hdrs = {
57+ copy('$outdir/include', '$srcdir/libswc', {'swc.h'}),
58+}
59+
60+sub('tools.ninja', function()
61+ toolchain(config.host)
62+ cflags{'-std=c99', '-D _POSIX_C_SOURCE=200809L'}
63+ exe('convert_font', {'cursor/convert_font.c'})
64+end)
65+
66+rule('convert_font', '$outdir/convert_font $in $out 2>/dev/null')
67+build('convert_font', '$outdir/cursor/cursor_data.h', {'$srcdir/cursor/cursor.pcf', '|', '$outdir/convert_font'})
68+
69+pkg.deps = {
70+ '$gendir/headers',
71+ '$outdir/include/swc_snap-server-protocol.h',
72+ '$outdir/include/swc_snap-client-protocol.h',
73+ '$outdir/include/server-decoration-server-protocol.h',
74+ '$outdir/include/swc_select-server-protocol.h',
75+ '$outdir/include/swc_select-client-protocol.h',
76+ '$outdir/include/wlr-layer-shell-unstable-v1-server-protocol.h',
77+ '$outdir/include/wayland-drm-server-protocol.h',
78+ '$outdir/cursor/cursor_data.h',
79+ 'pkg/fontconfig/headers',
80+ 'pkg/libdrm/headers',
81+ 'pkg/libinput/headers',
82+ 'pkg/libxkbcommon/headers',
83+ 'pkg/linux-headers/headers',
84+ 'pkg/pixman/headers',
85+ 'pkg/wayland/headers',
86+ 'pkg/wayland-protocols/headers',
87+ 'pkg/wld/headers',
88+}
89+
90+lib('libswc.a', [[
91+ libswc/(
92+ bindings.c
93+ compositor.c
94+ data.c
95+ data_device.c
96+ data_device_manager.c
97+ decor.c
98+ dmabuf.c
99+ drm.c
100+ input.c
101+ kde_decoration.c
102+ keyboard.c
103+ launch.c
104+ layer_shell.c
105+ mode.c
106+ output.c
107+ panel.c
108+ panel_manager.c
109+ plane.c
110+ pointer.c
111+ primary_plane.c
112+ region.c
113+ screen.c
114+ select.c
115+ shell.c
116+ shell_surface.c
117+ shm.c
118+ snap.c
119+ subcompositor.c
120+ subsurface.c
121+ surface.c
122+ swc.c
123+ util.c
124+ view.c
125+ wayland_buffer.c
126+ window.c
127+ xdg_decoration.c
128+ xdg_output.c
129+ xdg_shell.c
130+
131+ seat.c
132+ )
133+ launch/protocol.c.o
134+ server-decoration-protocol.c.o
135+ swc-protocol.c.o
136+ swc_snap-protocol.c.o
137+ swc_select-protocol.c.o
138+ wayland-drm-protocol.c.o
139+ wlr-layer-shell-unstable-v1.c.o
140+ $builddir/(
141+ pkg/libinput/libinput.a.d
142+ pkg/libxkbcommon/libxkbcommon.a
143+ pkg/wayland-protocols/xdg-decoration-unstable-v1-protocol.c.o
144+ pkg/wayland-protocols/xdg-shell-protocol.c.o
145+ pkg/wayland-protocols/xdg-output-unstable-v1-protocol.c.o
146+ pkg/wayland-protocols/linux-dmabuf-unstable-v1-protocol.c.o
147+ pkg/wayland/libwayland-server.a.d
148+ pkg/wld/libwld.a.d
149+ )
150+]])
151+
152+exe('swcsnap', {'extra/swcsnap.c', 'libswc.a.d'})
153+file('bin/swcsnap', '755', '$outdir/swcsnap')
154+
155+exe('neuswc-launch', {'launch/launch.c', 'launch/devmajor-linux.c', 'launch/protocol.c.o', '$builddir/pkg/libdrm/libdrm.a'})
156+file('bin/neuswc-launch', '4755', '$outdir/neuswc-launch')
157+
158+fetch 'git'
+1,
-0
1@@ -0,0 +1 @@
2+Subproject commit 685599f83287440381a42e0fa3a351ef861605cb
+1,
-0
1@@ -0,0 +1 @@
2+685599f