##// END OF EJS Templates
swapped to meson
Tsuki -
r1:60e13e940ee8 default
parent child Browse files
Show More
@@ -0,0 +1,143
1 project(
2 'swindle',
3 'c',
4 version: '0.1',
5 default_options: [
6 'c_std=c11',
7 'buildtype=debugoptimized',
8 ],
9 )
10
11 cc = meson.get_compiler('c')
12
13 add_project_arguments(
14 '-DWLR_USE_UNSTABLE',
15 '-D_POSIX_C_SOURCE=200809L',
16 '-DVERSION="0.1"',
17 '-Wall',
18 '-Wextra',
19 '-Wno-unused-parameter',
20 '-Wno-stringop-truncation',
21 language: 'c',
22 )
23
24 xwayland_opt = get_option('xwayland')
25
26 wayland_server = dependency('wayland-server')
27 wayland_client = dependency('wayland-client')
28 wayland_protocols = dependency('wayland-protocols')
29 wayland_scanner_dep = dependency('wayland-scanner', native: true)
30 wlroots = dependency('wlroots-0.20')
31 xkbcommon = dependency('xkbcommon')
32 libinput = dependency('libinput')
33 lua = dependency('lua5.4')
34 m_dep = cc.find_library('m', required: false)
35
36 swindle_deps = [
37 wayland_server,
38 wlroots,
39 xkbcommon,
40 libinput,
41 lua,
42 m_dep,
43 ]
44
45 if xwayland_opt
46 swindle_deps += dependency('xcb')
47 swindle_deps += dependency('xcb-icccm')
48 add_project_arguments('-DXWAYLAND', language: 'c')
49 endif
50
51 wayland_scanner = find_program(
52 wayland_scanner_dep.get_variable('wayland_scanner'),
53 native: true,
54 )
55 wl_protocol_dir = wayland_protocols.get_variable('pkgdatadir')
56
57 wayland_scanner_server = generator(
58 wayland_scanner,
59 output: '@[email protected]',
60 arguments: ['server-header', '@INPUT@', '@OUTPUT@'],
61 )
62
63 wayland_scanner_private = generator(
64 wayland_scanner,
65 output: '@[email protected]',
66 arguments: ['private-code', '@INPUT@', '@OUTPUT@'],
67 )
68
69 wayland_scanner_enum = generator(
70 wayland_scanner,
71 output: '@[email protected]',
72 arguments: ['enum-header', '@INPUT@', '@OUTPUT@'],
73 )
74
75 cursor_shape_xml = wl_protocol_dir / 'staging/cursor-shape/cursor-shape-v1.xml'
76 pointer_constraints_xml = wl_protocol_dir / 'unstable/pointer-constraints/pointer-constraints-unstable-v1.xml'
77 xdg_shell_xml = wl_protocol_dir / 'stable/xdg-shell/xdg-shell.xml'
78
79 layer_shell_xml = 'protocols/wlr-layer-shell-unstable-v1.xml'
80 output_power_xml = 'protocols/wlr-output-power-management-unstable-v1.xml'
81 dwl_ipc_xml = 'protocols/dwl-ipc-unstable-v2.xml'
82 ext_workspace_xml = 'protocols/ext-workspace-v1.xml'
83
84 cursor_shape_h = wayland_scanner_enum.process(cursor_shape_xml)
85 pointer_constraints_h = wayland_scanner_enum.process(pointer_constraints_xml)
86 layer_shell_h = wayland_scanner_enum.process(layer_shell_xml)
87 output_power_h = wayland_scanner_server.process(output_power_xml)
88 xdg_shell_h = wayland_scanner_server.process(xdg_shell_xml)
89
90 dwl_ipc_h = wayland_scanner_server.process(dwl_ipc_xml)
91 dwl_ipc_c = wayland_scanner_private.process(dwl_ipc_xml)
92 ext_workspace_h = wayland_scanner_server.process(ext_workspace_xml)
93 ext_workspace_c = wayland_scanner_private.process(ext_workspace_xml)
94
95 protocol_headers = [
96 cursor_shape_h,
97 pointer_constraints_h,
98 layer_shell_h,
99 output_power_h,
100 xdg_shell_h,
101 ]
102
103 swindle_sources = [
104 'src/swindle.c',
105 'src/util.c',
106 'src/wlr_ext_workspace_v1.c',
107 'parser/parser.c',
108 dwl_ipc_c,
109 dwl_ipc_h,
110 ext_workspace_c,
111 ext_workspace_h,
112 ]
113
114 executable(
115 'swindle',
116 swindle_sources + protocol_headers,
117 include_directories: include_directories('.', 'include', 'src', 'parser'),
118 dependencies: swindle_deps,
119 install: true,
120 )
121
122 smsg_dwl_ipc_h = custom_target(
123 'smsg-dwl-ipc-unstable-v2-protocol-h',
124 input: dwl_ipc_xml,
125 output: 'dwl-ipc-unstable-v2-protocol.h',
126 command: [wayland_scanner, 'client-header', '@INPUT@', '@OUTPUT@'],
127 )
128
129 smsg_dwl_ipc_c = custom_target(
130 'smsg-dwl-ipc-unstable-v2-protocol-c',
131 input: dwl_ipc_xml,
132 output: 'dwl-ipc-unstable-v2-protocol.c',
133 command: [wayland_scanner, 'private-code', '@INPUT@', '@OUTPUT@'],
134 )
135
136 executable(
137 'smsg',
138 ['smsg/smsg.c', smsg_dwl_ipc_c, smsg_dwl_ipc_h],
139 dependencies: [wayland_client],
140 install: true,
141 )
142
143 install_subdir('example', install_dir: get_option('sysconfdir') / 'swindle', strip_directory: true)
@@ -0,0 +1,6
1 option(
2 'xwayland',
3 type: 'boolean',
4 value: true,
5 description: 'Enable XWayland support',
6 )
@@ -18,3 +18,4 tags
18 *.swo
18 *.swo
19 *~
19 *~
20 include/lua5.4/*
20 include/lua5.4/*
21 build/
@@ -22,6 +22,8 Swindle is a fork of [dwl](https://codeb
22 * xkbcommon
22 * xkbcommon
23 * wayland-protocols (compile-time only)
23 * wayland-protocols (compile-time only)
24 * pkg-config (compile-time only)
24 * pkg-config (compile-time only)
25 * meson (compile-time only)
26 * ninja (compile-time only)
25
27
26 Install these (and their `-devel` versions if your distro has separate
28 Install these (and their `-devel` versions if your distro has separate
27 development packages) and run `make` followed by `doas/sudo make install`, if you wish to install it (installs to /usr/local/bin/ by default).
29 development packages) and run `make` followed by `doas/sudo make install`, if you wish to install it (installs to /usr/local/bin/ by default).
@@ -20,11 +20,11
20 },
20 },
21 "nixpkgs": {
21 "nixpkgs": {
22 "locked": {
22 "locked": {
23 "lastModified": 1786106723,
23 "lastModified": 1786599213,
24 "narHash": "sha256-zDSUbpoeo/9ZmD2+wXnzxoo1+uhL8vxc0b8yuYMKYq0=",
24 "narHash": "sha256-yNJd40f11EzXBjSByCB7IPpeFFAdeoSKKM67dGkfFoU=",
25 "owner": "NixOS",
25 "owner": "NixOS",
26 "repo": "nixpkgs",
26 "repo": "nixpkgs",
27 "rev": "f13ff45afd1bb73e640eaa08a7066dbed07e3238",
27 "rev": "0e251e24a4f24e036a084b6b4b2d2491af4167f4",
28 "type": "github"
28 "type": "github"
29 },
29 },
30 "original": {
30 "original": {
@@ -1,11 +1,9
1 {
1 {
2 description = "swindle: a dwl fork with Lua config, IPC, and ext-workspace support, plus its smsg client";
2 description = "swindle: a dwl fork with Lua config, IPC, and ext-workspace support, plus its smsg client";
3
4 inputs = {
3 inputs = {
5 nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
4 nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
6 flake-utils.url = "github:numtide/flake-utils";
5 flake-utils.url = "github:numtide/flake-utils";
7 };
6 };
8
9 outputs = { self, nixpkgs, flake-utils }:
7 outputs = { self, nixpkgs, flake-utils }:
10 flake-utils.lib.eachDefaultSystem (system:
8 flake-utils.lib.eachDefaultSystem (system:
11 let
9 let
@@ -15,15 +13,14
15 packages.default = pkgs.stdenv.mkDerivation rec {
13 packages.default = pkgs.stdenv.mkDerivation rec {
16 pname = "swindle";
14 pname = "swindle";
17 version = "0.1";
15 version = "0.1";
18
19 src = self;
16 src = self;
20
21 nativeBuildInputs = with pkgs; [
17 nativeBuildInputs = with pkgs; [
22 pkg-config
18 pkg-config
23 wayland-scanner
19 wayland-scanner
24 wayland-protocols
20 wayland-protocols
21 meson
22 ninja
25 ];
23 ];
26
27 buildInputs = with pkgs; [
24 buildInputs = with pkgs; [
28 wayland
25 wayland
29 wlroots_0_20
26 wlroots_0_20
@@ -34,16 +31,8
34 libxcb
31 libxcb
35 libxcb-wm
32 libxcb-wm
36 ];
33 ];
37
38 enableParallelBuilding = true;
34 enableParallelBuilding = true;
39
35 mesonFlags = [ "-Dxwayland=true" ];
40 postPatch = ''
41 substituteInPlace Makefile \
42 --replace '$(DESTDIR)/etc/swindle' '$(DESTDIR)$(PREFIX)/etc/swindle'
43 '';
44
45 makeFlags = [ "PREFIX=${placeholder "out"}" ];
46
47 meta = with pkgs.lib; {
36 meta = with pkgs.lib; {
48 description = "A dwl fork with Lua configuration, IPC support, and ext-workspace-v1";
37 description = "A dwl fork with Lua configuration, IPC support, and ext-workspace-v1";
49 license = with licenses; [ gpl3Only mit isc ];
38 license = with licenses; [ gpl3Only mit isc ];
@@ -51,15 +40,12
51 mainProgram = "swindle";
40 mainProgram = "swindle";
52 };
41 };
53 };
42 };
54
55 devShells.default = pkgs.mkShell {
43 devShells.default = pkgs.mkShell {
56 inputsFrom = [ self.packages.${system}.default ];
44 inputsFrom = [ self.packages.${system}.default ];
57 packages = with pkgs; [ pkg-config gdb ];
45 packages = with pkgs; [ pkg-config gdb ];
58 };
46 };
59
60 apps.default = flake-utils.lib.mkApp {
47 apps.default = flake-utils.lib.mkApp {
61 drv = self.packages.${system}.default;
48 drv = self.packages.${system}.default;
62 };
49 };
63 });
50 });
64 }
51 }
65
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now