From 7fb1e152e85da132c8f36ed7155f9ed1f0521149 Mon Sep 17 00:00:00 2001 From: StratusFearMe21 <57533634+StratusFearMe21@users.noreply.github.com> Date: Sun, 15 Jan 2023 22:19:17 +0000 Subject: [PATCH 01/16] Create meson.build --- meson.build | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 meson.build diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..c98f5b0 --- /dev/null +++ b/meson.build @@ -0,0 +1,38 @@ +project('dwl', ['c', 'cpp'], + version : '0.4' +) + +subdir('protocols') + +cc = meson.get_compiler('c') +libm = cc.find_library('m') +xcb = dependency('xcb', required : get_option('xwayland')) +xlibs = dependency('xcb-icccm', required : get_option('xwayland')) +wayland_server_dep = dependency('wayland-server') +wlroots_dep = dependency('wlroots') +xkbcommon_dep = dependency('xkbcommon') +libinput_dep = dependency('libinput') + +executable('dwl', + 'dwl.c', + 'util.c', + wayland_sources, + dependencies : [ + libm, + xcb, + xlibs, + wayland_server_dep, + wlroots_dep, + xkbcommon_dep, + libinput_dep, + ], + install : true, + c_args : [ + '-DWLR_USE_UNSTABLE', + '-D_POSIX_C_SOURCE=200809L', + '-DXWAYLAND', + '-DVERSION="@0@"'.format(meson.project_version()) + ] +) + +install_man('dwl.1') From 2242a139ed2066c334ed9df1f76bfaa5a9d57f10 Mon Sep 17 00:00:00 2001 From: StratusFearMe21 <57533634+StratusFearMe21@users.noreply.github.com> Date: Sun, 15 Jan 2023 22:19:37 +0000 Subject: [PATCH 02/16] Create meson_options.txt --- meson_options.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 meson_options.txt diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000..b47f03a --- /dev/null +++ b/meson_options.txt @@ -0,0 +1 @@ +option('xwayland', type : 'feature', value : 'auto') From 3333503c10a42fdd038fb9fd060e07f4c84b37d7 Mon Sep 17 00:00:00 2001 From: StratusFearMe21 <57533634+StratusFearMe21@users.noreply.github.com> Date: Sun, 15 Jan 2023 22:20:02 +0000 Subject: [PATCH 03/16] Create meson.build --- protocols/meson.build | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 protocols/meson.build diff --git a/protocols/meson.build b/protocols/meson.build new file mode 100644 index 0000000..56bd261 --- /dev/null +++ b/protocols/meson.build @@ -0,0 +1,21 @@ +wayland_scanner = find_program('wayland-scanner') +wayland_protos_dep = dependency('wayland-protocols') +wl_protocol_dir = wayland_protos_dep.get_pkgconfig_variable('pkgdatadir') +wayland_scanner_code = generator( + wayland_scanner, + output: '@BASENAME@-protocol.c', + arguments: ['private-code', '@INPUT@', '@OUTPUT@']) +wayland_scanner_client = generator( + wayland_scanner, + output: '@BASENAME@-client-protocol.h', + arguments: ['client-header', '@INPUT@', '@OUTPUT@']) + +wayland_xmls = [ + wl_protocol_dir + '/stable/xdg-shell/xdg-shell.xml', + 'wlr-layer-shell-unstable-v1.xml', + 'net-tapesoftware-dwl-wm-unstable-v1.xml', +] +wayland_sources = [ + wayland_scanner_code.process(wayland_xmls), + wayland_scanner_client.process(wayland_xmls), +] From 73a6d28d3c55b9423a0ca55c26ef490aeb665972 Mon Sep 17 00:00:00 2001 From: StratusFearMe21 <57533634+StratusFearMe21@users.noreply.github.com> Date: Sun, 15 Jan 2023 22:20:54 +0000 Subject: [PATCH 04/16] Delete Makefile --- Makefile | 60 -------------------------------------------------------- 1 file changed, 60 deletions(-) delete mode 100644 Makefile diff --git a/Makefile b/Makefile deleted file mode 100644 index ccca079..0000000 --- a/Makefile +++ /dev/null @@ -1,60 +0,0 @@ -.POSIX: -.SUFFIXES: - -include config.mk - -# flags for compiling -DWLCPPFLAGS = -I. -DWLR_USE_UNSTABLE -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION)\" $(XWAYLAND) -DWLDEVCFLAGS = -pedantic -Wall -Wextra -Wdeclaration-after-statement -Wno-unused-parameter -Wno-sign-compare -Wshadow -Wunused-macros\ - -Werror=strict-prototypes -Werror=implicit -Werror=return-type -Werror=incompatible-pointer-types - -# CFLAGS / LDFLAGS -PKGS = wlroots wayland-server xkbcommon libinput $(XLIBS) -DWLCFLAGS = `$(PKG_CONFIG) --cflags $(PKGS)` $(DWLCPPFLAGS) $(DWLDEVCFLAGS) $(CFLAGS) -LDLIBS = `$(PKG_CONFIG) --libs $(PKGS)` $(LIBS) - -all: dwl -dwl: dwl.o util.o - $(CC) dwl.o util.o $(LDLIBS) $(LDFLAGS) $(DWLCFLAGS) -o $@ -dwl.o: dwl.c config.mk config.h client.h xdg-shell-protocol.h wlr-layer-shell-unstable-v1-protocol.h -util.o: util.c util.h - -# wayland-scanner is a tool which generates C headers and rigging for Wayland -# protocols, which are specified in XML. wlroots requires you to rig these up -# to your build system yourself and provide them in the include path. -WAYLAND_SCANNER = `$(PKG_CONFIG) --variable=wayland_scanner wayland-scanner` -WAYLAND_PROTOCOLS = `$(PKG_CONFIG) --variable=pkgdatadir wayland-protocols` - -xdg-shell-protocol.h: - $(WAYLAND_SCANNER) server-header \ - $(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@ -wlr-layer-shell-unstable-v1-protocol.h: - $(WAYLAND_SCANNER) server-header \ - protocols/wlr-layer-shell-unstable-v1.xml $@ - -config.h: - cp config.def.h $@ -clean: - rm -f dwl *.o *-protocol.h - -dist: clean - mkdir -p dwl-$(VERSION) - cp -R LICENSE* Makefile README.md client.h config.def.h\ - config.mk protocols dwl.1 dwl.c util.c util.h\ - dwl-$(VERSION) - tar -caf dwl-$(VERSION).tar.gz dwl-$(VERSION) - rm -rf dwl-$(VERSION) - -install: dwl - mkdir -p $(DESTDIR)$(PREFIX)/bin - cp -f dwl $(DESTDIR)$(PREFIX)/bin - chmod 755 $(DESTDIR)$(PREFIX)/bin/dwl - mkdir -p $(DESTDIR)$(MANDIR)/man1 - cp -f dwl.1 $(DESTDIR)$(MANDIR)/man1 - chmod 644 $(DESTDIR)$(MANDIR)/man1/dwl.1 -uninstall: - rm -f $(DESTDIR)$(PREFIX)/bin/dwl $(DESTDIR)$(MANDIR)/man1/dwl.1 - -.SUFFIXES: .c .o -.c.o: - $(CC) $(CPPFLAGS) $(DWLCFLAGS) -c $< From 0dba1e56d7d9ffb2e25aa44cfbf90db1f2ff6333 Mon Sep 17 00:00:00 2001 From: StratusFearMe21 <57533634+StratusFearMe21@users.noreply.github.com> Date: Sun, 15 Jan 2023 22:21:08 +0000 Subject: [PATCH 05/16] Delete config.mk --- config.mk | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 config.mk diff --git a/config.mk b/config.mk deleted file mode 100644 index f50156f..0000000 --- a/config.mk +++ /dev/null @@ -1,14 +0,0 @@ -_VERSION = 0.4 -VERSION = `git describe --tags --dirty 2>/dev/null || echo $(_VERSION)` - -PKG_CONFIG = pkg-config - -# paths -PREFIX = /usr/local -MANDIR = $(PREFIX)/share/man - -XWAYLAND = -XLIBS = -# Uncomment to build XWayland support -#XWAYLAND = -DXWAYLAND -#XLIBS = xcb xcb-icccm From c8dde3a2adca134e28c310984d8aeb998e9178ae Mon Sep 17 00:00:00 2001 From: StratusFearMe21 <57533634+StratusFearMe21@users.noreply.github.com> Date: Sun, 15 Jan 2023 22:22:22 +0000 Subject: [PATCH 06/16] Update README.md --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 05f149c..85720ba 100644 --- a/README.md +++ b/README.md @@ -52,11 +52,10 @@ Feature *non-goals* for the main codebase include: dwl has only two dependencies: `wlroots` and `wayland-protocols`. Simply install these (and their `-devel` versions if your distro has separate -development packages) and run `make`. If you wish to build against a Git +development packages) and run `meson setup build`. If you wish to build against a Git version of wlroots, check out the [wlroots-next branch]. -To enable XWayland, you should also install xorg-xwayland and uncomment its flag -in `config.mk`. +To enable XWayland, you should also install xorg-xwayland and build with `-Dxwayland=enabled`. ## Configuration From 28f97d2971057f61bf63525df2f69f8a1494f15e Mon Sep 17 00:00:00 2001 From: StratusFearMe21 <57533634+StratusFearMe21@users.noreply.github.com> Date: Sun, 15 Jan 2023 22:23:24 +0000 Subject: [PATCH 07/16] Update README.md --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 85720ba..042f821 100644 --- a/README.md +++ b/README.md @@ -52,8 +52,12 @@ Feature *non-goals* for the main codebase include: dwl has only two dependencies: `wlroots` and `wayland-protocols`. Simply install these (and their `-devel` versions if your distro has separate -development packages) and run `meson setup build`. If you wish to build against a Git -version of wlroots, check out the [wlroots-next branch]. +development packages) and run +``` +meson setup build +meson compile -C build +``` +If you wish to build against a Git version of wlroots, check out the [wlroots-next branch]. To enable XWayland, you should also install xorg-xwayland and build with `-Dxwayland=enabled`. From 46b85378ee03fbda81d71053562c4c29fae17e83 Mon Sep 17 00:00:00 2001 From: StratusFearMe21 <57533634+StratusFearMe21@users.noreply.github.com> Date: Sun, 15 Jan 2023 22:23:46 +0000 Subject: [PATCH 08/16] Update .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 0dde90e..6722f5b 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ dwl *-protocol.h .ccls-cache config.h +build From b7f58773292b0e009f6d054452ee085ea025f7fc Mon Sep 17 00:00:00 2001 From: StratusFearMe21 <57533634+StratusFearMe21@users.noreply.github.com> Date: Sun, 15 Jan 2023 22:24:05 +0000 Subject: [PATCH 09/16] Update meson_options.txt --- meson_options.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson_options.txt b/meson_options.txt index b47f03a..693707f 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1 +1 @@ -option('xwayland', type : 'feature', value : 'auto') +option('xwayland', type : 'feature', value : 'disabled') From 0a32118953d04fc65fc3db7ad2ddce31206802d1 Mon Sep 17 00:00:00 2001 From: StratusFearMe21 <57533634+StratusFearMe21@users.noreply.github.com> Date: Sun, 15 Jan 2023 22:28:32 +0000 Subject: [PATCH 10/16] Update meson.build --- meson.build | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/meson.build b/meson.build index c98f5b0..eb6b46c 100644 --- a/meson.build +++ b/meson.build @@ -13,6 +13,17 @@ wlroots_dep = dependency('wlroots') xkbcommon_dep = dependency('xkbcommon') libinput_dep = dependency('libinput') +c_args = [ + '-DWLR_USE_UNSTABLE', + '-D_POSIX_C_SOURCE=200809L', + '-DXWAYLAND', + '-DVERSION="@0@"'.format(meson.project_version()) +] + +if xcb.found() and xlibs.found() + c_args += '-DXWAYLAND' + endif + executable('dwl', 'dwl.c', 'util.c', @@ -27,12 +38,7 @@ executable('dwl', libinput_dep, ], install : true, - c_args : [ - '-DWLR_USE_UNSTABLE', - '-D_POSIX_C_SOURCE=200809L', - '-DXWAYLAND', - '-DVERSION="@0@"'.format(meson.project_version()) - ] + c_args : c_args ) install_man('dwl.1') From f1daa24a3054536427d81108545f2fb32dc10038 Mon Sep 17 00:00:00 2001 From: StratusFearMe21 <57533634+StratusFearMe21@users.noreply.github.com> Date: Sun, 15 Jan 2023 22:29:06 +0000 Subject: [PATCH 11/16] Update meson.build --- protocols/meson.build | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/protocols/meson.build b/protocols/meson.build index 56bd261..ea11df3 100644 --- a/protocols/meson.build +++ b/protocols/meson.build @@ -12,8 +12,7 @@ wayland_scanner_client = generator( wayland_xmls = [ wl_protocol_dir + '/stable/xdg-shell/xdg-shell.xml', - 'wlr-layer-shell-unstable-v1.xml', - 'net-tapesoftware-dwl-wm-unstable-v1.xml', + 'wlr-layer-shell-unstable-v1.xml' ] wayland_sources = [ wayland_scanner_code.process(wayland_xmls), From d57e8cbd7297622dad9746e718f52a32c92fa32e Mon Sep 17 00:00:00 2001 From: StratusFearMe21 <57533634+StratusFearMe21@users.noreply.github.com> Date: Sun, 15 Jan 2023 22:32:23 +0000 Subject: [PATCH 12/16] Update meson.build --- meson.build | 1 - 1 file changed, 1 deletion(-) diff --git a/meson.build b/meson.build index eb6b46c..aa88079 100644 --- a/meson.build +++ b/meson.build @@ -16,7 +16,6 @@ libinput_dep = dependency('libinput') c_args = [ '-DWLR_USE_UNSTABLE', '-D_POSIX_C_SOURCE=200809L', - '-DXWAYLAND', '-DVERSION="@0@"'.format(meson.project_version()) ] From e0faeece19de1bd6c7672a985f3cb433389a26f8 Mon Sep 17 00:00:00 2001 From: StratusFearMe21 <57533634+StratusFearMe21@users.noreply.github.com> Date: Sun, 15 Jan 2023 22:42:32 +0000 Subject: [PATCH 13/16] Update meson.build --- protocols/meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/protocols/meson.build b/protocols/meson.build index ea11df3..9af06c2 100644 --- a/protocols/meson.build +++ b/protocols/meson.build @@ -7,8 +7,8 @@ wayland_scanner_code = generator( arguments: ['private-code', '@INPUT@', '@OUTPUT@']) wayland_scanner_client = generator( wayland_scanner, - output: '@BASENAME@-client-protocol.h', - arguments: ['client-header', '@INPUT@', '@OUTPUT@']) + output: '@BASENAME@-protocol.h', + arguments: ['server-header', '@INPUT@', '@OUTPUT@']) wayland_xmls = [ wl_protocol_dir + '/stable/xdg-shell/xdg-shell.xml', From c02e222ee9881518c13b2e39c845ad6cc9949717 Mon Sep 17 00:00:00 2001 From: StratusFearMe21 <57533634+StratusFearMe21@users.noreply.github.com> Date: Sun, 15 Jan 2023 22:43:20 +0000 Subject: [PATCH 14/16] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 042f821..6a5de04 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,7 @@ dwl has only two dependencies: `wlroots` and `wayland-protocols`. Simply install these (and their `-devel` versions if your distro has separate development packages) and run ``` +cp config.def.h config.h meson setup build meson compile -C build ``` From a0c7722b672dc9f3e9468d31db48d406f64a8cf7 Mon Sep 17 00:00:00 2001 From: StratusFearMe21 <57533634+StratusFearMe21@users.noreply.github.com> Date: Sun, 15 Jan 2023 22:46:55 +0000 Subject: [PATCH 15/16] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6a5de04..f433ed1 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ meson compile -C build ``` If you wish to build against a Git version of wlroots, check out the [wlroots-next branch]. -To enable XWayland, you should also install xorg-xwayland and build with `-Dxwayland=enabled`. +To enable XWayland, you should also install xorg-xwayland and build with `meson setup build -Dxwayland=enabled`. ## Configuration From fb67ff7ace690cfa065e4091a31cb9108f0ea4a8 Mon Sep 17 00:00:00 2001 From: StratusFearMe21 <57533634+StratusFearMe21@users.noreply.github.com> Date: Sun, 15 Jan 2023 23:01:18 +0000 Subject: [PATCH 16/16] Delete .gitignore --- .gitignore | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 .gitignore diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 6722f5b..0000000 --- a/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -dwl -*.o -*-protocol.c -*-protocol.h -.ccls-cache -config.h -build