From 0294b25f274befa431cd51a099e1a7b3d255e467 Mon Sep 17 00:00:00 2001 From: Keith Bowes Date: Tue, 2 Jan 2024 16:13:31 -0500 Subject: [PATCH] Allow building with muon --- README.md | 14 ++++++++------ meson.build | 6 ++++-- po/meson.build | 19 +++++++++---------- protocol/meson.build | 3 ++- 4 files changed, 23 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 4359bb7..3a6f765 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ contributing.](https://github.com/wizbright/waybox/blob/master/CONTRIBUTING.md) ### Dependencies -* [Meson](https://mesonbuild.com/) +* [Meson](https://mesonbuild.com/) or [muon](http://muon.build) * [Wayland](https://wayland.freedesktop.org/) * [libevdev](https://www.freedesktop.org/wiki/Software/libevdev/) * [libinput](http://www.freedesktop.org/wiki/Software/libinput) @@ -22,7 +22,6 @@ contributing.](https://github.com/wizbright/waybox/blob/master/CONTRIBUTING.md) * [xkbcommon](https://xkbcommon.org/) ### Build instructions - ``` meson setup build cd build @@ -31,20 +30,23 @@ ninja After that, you should have an executable as waybox/waybox +For those who don't want to use a Python-based build system, it's also possible +to use muon instead of Meson. + ### Screenshots -![Plain desktop with wallpaper, panel, and dock](raw/master/screenshots/emptydesktop.png) +![Plain desktop with wallpaper, panel, and dock](../../raw/master/screenshots/emptydesktop.png) -![Showing Firefox and some of the Waybox source code](raw/master/screenshots/work.png) +![Showing Firefox and some of the Waybox source code](../../raw/master/screenshots/work.png) -![All work and no play](raw/master/screenshots/play.png) +![All work and no play](../../raw/master/screenshots/play.png) ### Useful Programs Because \*box-style compositors are minimalist, most functionality is left to external programs. As such, Waybox only functions as a box in which you can put whatever you need. Here are some useful programs to complement Waybox if you desire: * Panel: You can use [Waybar](https://github.com/Alexays/Waybar) or [yambar](https://codeberg.org/dnkl/yambar), similar to tint2 or fbpanel in Openbox or Fluxbox. -* Dock: You can use [Cairo Dock](https://www.glx-dock.org/) just like you did on Openbox. There's also a [port with Wayland-specific enhancements](https://github.com/dkondor/cairo-dock-core/) that you may want to try. +* Dock: You can use [Cairo Dock](https://www.glx-dock.org/) just like you did on Openbox. There's also a [port with Wayland-specific enhancements](https://github.com/dkondor/cairo-dock-core/) that you may want to try. A much more compact option is [LavaLauncher](https://sr.ht/~leon_plickat/LavaLauncher/), but it's much harder to configure. * Wallpaper utility: There are various utilities to set your wallpaper, each with their own advantages, including [wpaperd](https://github.com/danyspin97/wpaperd) (can select a random wallpaper from a directory), [swaybg](https://github.com/swaywm/swaybg) (can set the background color as well well as a wallpaper), and [hyprpaper](https://github.com/hyprwm/hyprpaper) (can change the wallpaper dynamically during runtime through IPC). * Notification client: [mako](https://wayland.emersion.fr/mako/) * [wl-clipboard](https://wayland.emersion.fr/mako/): Access the clipboard in scripts (also used by [neovim](https://neovim.io/)) diff --git a/meson.build b/meson.build index 04efe56..b49526b 100644 --- a/meson.build +++ b/meson.build @@ -3,7 +3,7 @@ project( 'c', version: '0.2.3', license: 'MIT', - meson_version: '>=0.52.0', + meson_version: '>=0.59.0', default_options: [ 'c_std=c11', 'warning_level=2', @@ -36,7 +36,9 @@ xkbcommon = dependency('xkbcommon') msgfmt = find_program('msgfmt', required: false) if msgfmt.found() source_root = meson.current_source_dir() - add_project_arguments('-DUSE_NLS=1', language: 'c') + add_project_arguments('-DGETTEXT_PACKAGE="' + meson.project_name().to_lower() + '"', + '-DLOCALEDIR="' + get_option('prefix') / get_option('localedir') + '"', + '-DUSE_NLS=1', language: 'c') subdir('po') endif diff --git a/po/meson.build b/po/meson.build index 5466a32..4697a95 100644 --- a/po/meson.build +++ b/po/meson.build @@ -1,11 +1,10 @@ -i18n = import('i18n') -add_project_arguments('-DGETTEXT_PACKAGE="' + meson.project_name().to_lower() + '"', - '-DLOCALEDIR="' + get_option('prefix') / get_option('localedir') + '"', - language:'c') -i18n.gettext(meson.project_name().to_lower(), - args: ['--directory=' + source_root, - '--add-comments=TRANSLATORS', - '--no-location', - '--keyword=_', - '--msgid-bugs=https://github.com/wizbright/waybox/issues'] +i18n = import('i18n', required: false) +if i18n.found() + i18n.gettext(meson.project_name().to_lower(), + args: ['--directory=' + source_root, + '--add-comments=TRANSLATORS', + '--no-location', + '--keyword=_', + '--msgid-bugs=https://github.com/wizbright/waybox/issues'] ) +endif diff --git a/protocol/meson.build b/protocol/meson.build index b1d56b5..46409bf 100644 --- a/protocol/meson.build +++ b/protocol/meson.build @@ -1,6 +1,7 @@ wl_protocol_dir = wayland_protos.get_variable(pkgconfig: 'pkgdatadir') -wayland_scanner = find_program('wayland-scanner', version: '>= 1.15') +wayland_scanner_dep = dependency('wayland-scanner', version: '>=1.15') +wayland_scanner = find_program(wayland_scanner_dep.get_variable(pkgconfig: 'wayland_scanner')) wayland_scanner_server = generator( wayland_scanner,