From fd0112425f165aff786bcfec8c610114324c37a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20=22sp1rit=22=E2=80=8B?= Date: Sun, 12 Jun 2022 22:57:03 +0200 Subject: [PATCH 01/10] Added meson buildfiles this makes for a far better experience in combination with wlroots, since that whole makefile mess is not required. Additionaly, handling of wayland protocol sources is also slightly better, but could be improved with mesons inbuilt wayland module. To build Hyprland using meson: meson _build -Ddefault_library=static ninja -C _build ninja -C _build install --- .gitmodules | 2 +- CMakeLists.txt | 2 +- Makefile | 10 +-- example/meson.build | 2 + hyprctl/meson.build | 3 + meson.build | 8 ++ meson_options.txt | 1 + protocols/meson.build | 51 +++++++++++ src/helpers/WLClasses.hpp | 4 +- src/includes.hpp | 106 +++++++++++------------ src/meson.build | 77 ++++++++++++++++ src/wlrunstable/wlr_ext_workspace_v1.cpp | 2 +- wlroots => subprojects/wlroots | 0 13 files changed, 205 insertions(+), 63 deletions(-) create mode 100644 example/meson.build create mode 100644 hyprctl/meson.build create mode 100644 meson.build create mode 100644 meson_options.txt create mode 100644 protocols/meson.build create mode 100644 src/meson.build rename wlroots => subprojects/wlroots (100%) diff --git a/.gitmodules b/.gitmodules index 91f54c59..01c7b0d5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "wlroots"] - path = wlroots + path = subprojects/wlroots url = https://github.com/ThatOneCalculator/wlroots-mirror diff --git a/CMakeLists.txt b/CMakeLists.txt index a3b3584e..e78eea0e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,7 +35,7 @@ execute_process( # # -include_directories(.) +include_directories(. PRIVATE "subprojects/wlroots/include/") add_compile_options(-std=c++20 -DWLR_USE_UNSTABLE ) add_compile_options(-Wall -Wextra -Wno-unused-parameter -Wno-unused-value -Wno-missing-field-initializers -Wno-narrowing) find_package(Threads REQUIRED) diff --git a/Makefile b/Makefile index 425618b4..eb306932 100644 --- a/Makefile +++ b/Makefile @@ -129,11 +129,11 @@ protocols: xdg-shell-protocol.o wlr-layer-shell-unstable-v1-protocol.o wlr-scree config: make protocols - sed -i -E 's/(soversion = 11)([^032]|$$)/soversion = 11032/g' ./wlroots/meson.build + sed -i -E 's/(soversion = 11)([^032]|$$)/soversion = 11032/g' subprojects/wlroots/meson.build - rm -rf ./wlroots/build + rm -rf ./subprojects/wlroots/build - cd wlroots && meson ./build --prefix=/usr --buildtype=release - cd wlroots && ninja -C build/ + cd subprojects/wlroots && meson ./build --prefix=/usr --buildtype=release + cd subprojects/wlroots && ninja -C build/ - cd wlroots && sudo ninja -C build/ install + cd subprojects/wlroots && sudo ninja -C build/ install diff --git a/example/meson.build b/example/meson.build new file mode 100644 index 00000000..cf4a2ff0 --- /dev/null +++ b/example/meson.build @@ -0,0 +1,2 @@ +install_data('hyprland.conf', install_dir: join_paths(get_option('datadir'), 'hyprland')) +install_data('hyprland.desktop', install_dir: join_paths(get_option('datadir'), 'wayland-sessions')) diff --git a/hyprctl/meson.build b/hyprctl/meson.build new file mode 100644 index 00000000..2b941d6d --- /dev/null +++ b/hyprctl/meson.build @@ -0,0 +1,3 @@ +executable('hyprctl', 'main.cpp', + install: true +) diff --git a/meson.build b/meson.build new file mode 100644 index 00000000..ea030c23 --- /dev/null +++ b/meson.build @@ -0,0 +1,8 @@ +project('Hyprland', 'cpp', 'c', + version : '0.1', + default_options : ['warning_level=3', 'cpp_std=c++20']) + +subdir('protocols') +subdir('src') +subdir('hyprctl') +subdir('example') diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 00000000..d34c6170 --- /dev/null +++ b/meson_options.txt @@ -0,0 +1 @@ +option('xwayland', type: 'feature', value: 'auto', description: 'Enable support for X11 applications') diff --git a/protocols/meson.build b/protocols/meson.build new file mode 100644 index 00000000..31a799d8 --- /dev/null +++ b/protocols/meson.build @@ -0,0 +1,51 @@ +wayland_protos = dependency('wayland-protocols', + version: '>=1.25', + fallback: 'wayland-protocols', + default_options: ['tests=false'], +) +wl_protocol_dir = wayland_protos.get_variable('pkgdatadir') + +wayland_scanner_dep = dependency('wayland-scanner', native: true) +wayland_scanner = find_program( + wayland_scanner_dep.get_variable('wayland_scanner'), + native: true, +) + +protocols = [ + [wl_protocol_dir, 'stable/xdg-shell/xdg-shell.xml'], + ['wlr-layer-shell-unstable-v1.xml'], + ['ext-workspace-unstable-v1.xml'], + ['pointer-constraints-unstable-v1.xml'], + ['tablet-unstable-v2.xml'], + ['idle.xml'] +] +wl_protos_src = [] +wl_protos_headers = [] +foreach p : protocols + xml = join_paths(p) + wl_protos_src += custom_target( + xml.underscorify() + '_server_c', + input: xml, + output: '@BASENAME@-protocol.c', + command: [wayland_scanner, 'private-code', '@INPUT@', '@OUTPUT@'], + ) + wl_protos_headers += custom_target( + xml.underscorify() + '_server_h', + input: xml, + output: '@BASENAME@-protocol.h', + command: [wayland_scanner, 'server-header', '@INPUT@', '@OUTPUT@'], + ) +endforeach + +wayland_server = dependency('wayland-server', version: '>=1.20.0') + +lib_server_protos = static_library( + 'server_protos', + wl_protos_src + wl_protos_headers, + dependencies: wayland_server.partial_dependency(compile_args: true), +) + +server_protos = declare_dependency( + link_with: lib_server_protos, + sources: wl_protos_headers, +) diff --git a/src/helpers/WLClasses.hpp b/src/helpers/WLClasses.hpp index 534b0de6..2a2d3c93 100644 --- a/src/helpers/WLClasses.hpp +++ b/src/helpers/WLClasses.hpp @@ -2,7 +2,7 @@ #include "../events/Events.hpp" #include "../defines.hpp" -#include "../../wlr-layer-shell-unstable-v1-protocol.h" +#include "wlr-layer-shell-unstable-v1-protocol.h" #include "../Window.hpp" #include "SubsurfaceTree.hpp" #include "AnimatedVariable.hpp" @@ -205,4 +205,4 @@ struct STabletPad { bool operator==(const STabletPad& b) { return wlrTabletPadV2 == b.wlrTabletPadV2; } -}; \ No newline at end of file +}; diff --git a/src/includes.hpp b/src/includes.hpp index 6793604b..3aca4331 100644 --- a/src/includes.hpp +++ b/src/includes.hpp @@ -34,60 +34,60 @@ #define static extern "C" { -#include "../wlroots/include/wlr/backend.h" -#include "../wlroots/include/wlr/backend/libinput.h" -#include "../wlroots/include/wlr/render/allocator.h" -#include "../wlroots/include/wlr/render/wlr_renderer.h" -#include "../wlroots/include/wlr/types/wlr_compositor.h" -#include "../wlroots/include/wlr/types/wlr_cursor.h" -#include "../wlroots/include/wlr/types/wlr_data_control_v1.h" -#include "../wlroots/include/wlr/types/wlr_data_device.h" -#include "../wlroots/include/wlr/types/wlr_export_dmabuf_v1.h" -#include "../wlroots/include/wlr/types/wlr_linux_dmabuf_v1.h" -#include "../wlroots/include/wlr/types/wlr_gamma_control_v1.h" -#include "../wlroots/include/wlr/types/wlr_idle.h" -#include "../wlroots/include/wlr/types/wlr_input_device.h" -#include "../wlroots/include/wlr/types/wlr_keyboard.h" -#include "../wlroots/include/wlr/types/wlr_layer_shell_v1.h" -#include "../wlroots/include/wlr/types/wlr_matrix.h" -#include "../wlroots/include/wlr/types/wlr_output.h" -#include "../wlroots/include/wlr/types/wlr_output_layout.h" -#include "../wlroots/include/wlr/types/wlr_output_management_v1.h" -#include "../wlroots/include/wlr/types/wlr_pointer.h" -#include "../wlroots/include/wlr/types/wlr_presentation_time.h" -#include "../wlroots/include/wlr/types/wlr_primary_selection.h" -#include "../wlroots/include/wlr/types/wlr_primary_selection_v1.h" -#include "../wlroots/include/wlr/types/wlr_screencopy_v1.h" -#include "../wlroots/include/wlr/types/wlr_seat.h" -#include "../wlroots/include/wlr/types/wlr_server_decoration.h" -#include "../wlroots/include/wlr/types/wlr_viewporter.h" -#include "../wlroots/include/wlr/types/wlr_virtual_keyboard_v1.h" -#include "../wlroots/include/wlr/types/wlr_xcursor_manager.h" -#include "../wlroots/include/wlr/types/wlr_xdg_activation_v1.h" -#include "../wlroots/include/wlr/types/wlr_xdg_decoration_v1.h" -#include "../wlroots/include/wlr/types/wlr_xdg_output_v1.h" -#include "../wlroots/include/wlr/types/wlr_xdg_shell.h" -#include "../wlroots/include/wlr/types/wlr_subcompositor.h" -#include "../wlroots/include/wlr/types/wlr_scene.h" -#include "../wlroots/include/wlr/types/wlr_output_damage.h" -#include "../wlroots/include/wlr/types/wlr_input_inhibitor.h" -#include "../wlroots/include/wlr/types/wlr_keyboard_shortcuts_inhibit_v1.h" -#include "../wlroots/include/wlr/types/wlr_virtual_pointer_v1.h" -#include "../wlroots/include/wlr/types/wlr_foreign_toplevel_management_v1.h" -#include "../wlroots/include/wlr/util/log.h" -#include "../wlroots/include/wlr/xwayland.h" -#include "../wlroots/include/wlr/util/region.h" -#include "../wlroots/include/wlr/types/wlr_tablet_pad.h" -#include "../wlroots/include/wlr/types/wlr_tablet_tool.h" -#include "../wlroots/include/wlr/types/wlr_tablet_v2.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include -#include "../wlroots/include/wlr/render/egl.h" -#include "../wlroots/include/wlr/render/gles2.h" -#include "../wlroots/include/wlr/render/wlr_texture.h" -#include "../wlroots/include/wlr/types/wlr_pointer_constraints_v1.h" -#include "../wlroots/include/wlr/types/wlr_relative_pointer_v1.h" -#include "../wlroots/include/wlr/interfaces/wlr_keyboard.h" +#include +#include +#include +#include +#include +#include } #undef class @@ -113,4 +113,4 @@ extern "C" { #include "helpers/Vector2D.hpp" -#include "../ext-workspace-unstable-v1-protocol.h" \ No newline at end of file +#include "ext-workspace-unstable-v1-protocol.h" diff --git a/src/meson.build b/src/meson.build new file mode 100644 index 00000000..6a351b9b --- /dev/null +++ b/src/meson.build @@ -0,0 +1,77 @@ +src = [ + 'config/ConfigManager.cpp', + 'debug/HyprCtl.cpp', + 'debug/HyprDebugOverlay.cpp', + 'debug/Log.cpp', + 'events/Devices.cpp', + 'events/Layers.cpp', + 'events/Misc.cpp', + 'events/Monitors.cpp', + 'events/Popups.cpp', + 'events/Windows.cpp', + 'helpers/Color.cpp', + 'helpers/Vector2D.cpp', + 'helpers/WLListener.cpp', + 'helpers/AnimatedVariable.cpp', + 'helpers/BezierCurve.cpp', + 'helpers/MiscFunctions.cpp', + 'helpers/SubsurfaceTree.cpp', + 'helpers/WLClasses.cpp', + 'helpers/Workspace.cpp', + 'hyprerror/HyprError.cpp', + 'layout/DwindleLayout.cpp', + 'managers/LayoutManager.cpp', + 'managers/ThreadManager.cpp', + 'managers/AnimationManager.cpp', + 'managers/EventManager.cpp', + 'managers/KeybindManager.cpp', + 'managers/XWaylandManager.cpp', + 'managers/input/InputManager.cpp', + 'managers/input/Tablets.cpp', + 'render/Shader.cpp', + 'render/Texture.cpp', + 'render/Framebuffer.cpp', + 'render/OpenGL.cpp', + 'render/Renderer.cpp', + 'render/decorations/CHyprGroupBarDecoration.cpp', + 'render/decorations/IHyprWindowDecoration.cpp', + 'wlrunstable/wlr_ext_workspace_v1.cpp', + 'Compositor.cpp', + 'Window.cpp', + 'init/initHelpers.cpp', + 'main.cpp' +] + +wlroots = subproject('wlroots', default_options: ['examples=false']) +have_xwlr = wlroots.get_variable('features').get('xwayland') +xcb_dep = dependency('xcb', required: get_option('xwayland')) + +if get_option('xwayland').enabled() and not have_xwlr + error('Cannot enable Xwayland in Hyperland: wlroots has been built without Xwayland support') +endif +have_xwayland = xcb_dep.found() and have_xwlr + +if not have_xwayland +add_project_arguments('-DNO_XWAYLAND', language: 'cpp') +endif + +executable('Hyprland', src, + cpp_args: ['-DWLR_USE_UNSTABLE'], + dependencies: [ + server_protos, + wlroots.get_variable('wlroots'), + dependency('cairo'), + dependency('pango'), + dependency('pangocairo'), + dependency('libdrm'), + dependency('egl'), + dependency('xkbcommon'), + dependency('libinput'), + xcb_dep, + + dependency('pixman-1'), + dependency('GL'), + dependency('threads') + ], + install : true +) diff --git a/src/wlrunstable/wlr_ext_workspace_v1.cpp b/src/wlrunstable/wlr_ext_workspace_v1.cpp index 4d6de7ae..50a43c7b 100644 --- a/src/wlrunstable/wlr_ext_workspace_v1.cpp +++ b/src/wlrunstable/wlr_ext_workspace_v1.cpp @@ -2,7 +2,7 @@ #include "../includes.hpp" #include "../helpers/MiscFunctions.hpp" -#include "../../ext-workspace-unstable-v1-protocol.h" +#include "ext-workspace-unstable-v1-protocol.h" #include #include diff --git a/wlroots b/subprojects/wlroots similarity index 100% rename from wlroots rename to subprojects/wlroots From b3ef1fcc545250b66ae356c4d26e47cbab230b11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20=22sp1rit=22=E2=80=8B?= Date: Mon, 13 Jun 2022 19:09:52 +0200 Subject: [PATCH 02/10] replaced source list with globber script See: - https://mesonbuild.com/FAQ.html#why-cant-i-specify-target-files-with-a-wildcard - https://github.com/vaxerski/Hyprland/pull/205#issuecomment-1154158918 --- src/meson.build | 45 ++------------------------------------------- 1 file changed, 2 insertions(+), 43 deletions(-) diff --git a/src/meson.build b/src/meson.build index 6a351b9b..87aadbd7 100644 --- a/src/meson.build +++ b/src/meson.build @@ -1,46 +1,5 @@ -src = [ - 'config/ConfigManager.cpp', - 'debug/HyprCtl.cpp', - 'debug/HyprDebugOverlay.cpp', - 'debug/Log.cpp', - 'events/Devices.cpp', - 'events/Layers.cpp', - 'events/Misc.cpp', - 'events/Monitors.cpp', - 'events/Popups.cpp', - 'events/Windows.cpp', - 'helpers/Color.cpp', - 'helpers/Vector2D.cpp', - 'helpers/WLListener.cpp', - 'helpers/AnimatedVariable.cpp', - 'helpers/BezierCurve.cpp', - 'helpers/MiscFunctions.cpp', - 'helpers/SubsurfaceTree.cpp', - 'helpers/WLClasses.cpp', - 'helpers/Workspace.cpp', - 'hyprerror/HyprError.cpp', - 'layout/DwindleLayout.cpp', - 'managers/LayoutManager.cpp', - 'managers/ThreadManager.cpp', - 'managers/AnimationManager.cpp', - 'managers/EventManager.cpp', - 'managers/KeybindManager.cpp', - 'managers/XWaylandManager.cpp', - 'managers/input/InputManager.cpp', - 'managers/input/Tablets.cpp', - 'render/Shader.cpp', - 'render/Texture.cpp', - 'render/Framebuffer.cpp', - 'render/OpenGL.cpp', - 'render/Renderer.cpp', - 'render/decorations/CHyprGroupBarDecoration.cpp', - 'render/decorations/IHyprWindowDecoration.cpp', - 'wlrunstable/wlr_ext_workspace_v1.cpp', - 'Compositor.cpp', - 'Window.cpp', - 'init/initHelpers.cpp', - 'main.cpp' -] +globber = run_command('find', '-name', '*.cpp', check: true) +src = globber.stdout().strip().split('\n') wlroots = subproject('wlroots', default_options: ['examples=false']) have_xwlr = wlroots.get_variable('features').get('xwayland') From c169f948951c63b56a4e39dd2ab921676f65f746 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20=22sp1rit=22=E2=80=8B?= Date: Tue, 14 Jun 2022 11:19:03 +0200 Subject: [PATCH 03/10] moved wlroots/xwayland definitions to the main meson file prevents build-failure when xwayland is disabled to to add_project_arguments('-DNO_XWAYLAND', language: 'cpp') beeing called after the required wayland protocols have been built. --- meson.build | 13 +++++++++++++ src/meson.build | 13 ------------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/meson.build b/meson.build index ea030c23..e09b78ae 100644 --- a/meson.build +++ b/meson.build @@ -2,6 +2,19 @@ project('Hyprland', 'cpp', 'c', version : '0.1', default_options : ['warning_level=3', 'cpp_std=c++20']) +wlroots = subproject('wlroots', default_options: ['examples=false']) +have_xwlr = wlroots.get_variable('features').get('xwayland') +xcb_dep = dependency('xcb', required: get_option('xwayland')) + +if get_option('xwayland').enabled() and not have_xwlr + error('Cannot enable Xwayland in Hyprland: wlroots has been built without Xwayland support') +endif +have_xwayland = xcb_dep.found() and have_xwlr + +if not have_xwayland +add_project_arguments('-DNO_XWAYLAND', language: 'cpp') +endif + subdir('protocols') subdir('src') subdir('hyprctl') diff --git a/src/meson.build b/src/meson.build index 87aadbd7..4e52d65e 100644 --- a/src/meson.build +++ b/src/meson.build @@ -1,19 +1,6 @@ globber = run_command('find', '-name', '*.cpp', check: true) src = globber.stdout().strip().split('\n') -wlroots = subproject('wlroots', default_options: ['examples=false']) -have_xwlr = wlroots.get_variable('features').get('xwayland') -xcb_dep = dependency('xcb', required: get_option('xwayland')) - -if get_option('xwayland').enabled() and not have_xwlr - error('Cannot enable Xwayland in Hyperland: wlroots has been built without Xwayland support') -endif -have_xwayland = xcb_dep.found() and have_xwlr - -if not have_xwayland -add_project_arguments('-DNO_XWAYLAND', language: 'cpp') -endif - executable('Hyprland', src, cpp_args: ['-DWLR_USE_UNSTABLE'], dependencies: [ From 89454ada6cb49c95bf3372e8291e88dc772e9a61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20=22sp1rit=22=E2=80=8B?= Date: Tue, 14 Jun 2022 12:20:48 +0200 Subject: [PATCH 04/10] added runtime tag to the wayland-session launchable and sample config this allows for a small-install footprint by running meson install -C _build --tags runtime --- example/meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/example/meson.build b/example/meson.build index cf4a2ff0..ccfc4e00 100644 --- a/example/meson.build +++ b/example/meson.build @@ -1,2 +1,2 @@ -install_data('hyprland.conf', install_dir: join_paths(get_option('datadir'), 'hyprland')) -install_data('hyprland.desktop', install_dir: join_paths(get_option('datadir'), 'wayland-sessions')) +install_data('hyprland.conf', install_dir: join_paths(get_option('datadir'), 'hyprland'), install_tag: 'runtime') +install_data('hyprland.desktop', install_dir: join_paths(get_option('datadir'), 'wayland-sessions'), install_tag: 'runtime') From 43065657c9de8da8c631a77453408d947a2f8d7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20=22sp1rit=22=E2=80=8B?= Date: Tue, 14 Jun 2022 11:48:42 +0200 Subject: [PATCH 05/10] actions: added meson workflow --- .github/workflows/ci.yaml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 084ac667..48b4da43 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -41,3 +41,35 @@ jobs: - name: Build Hyprland with LEGACY_RENDERER run: | make legacyrenderer + + meson: + name: "Build Hyprland with Meson (Arch)" + runs-on: ubuntu-latest + container: + image: archlinux + steps: + - name: Download dependencies 📥 + run: | + sed -i 's/SigLevel = Required DatabaseOptional/SigLevel = Optional TrustAll/' /etc/pacman.conf + pacman --noconfirm --noprogressbar -Syyu + pacman --noconfirm --noprogressbar -Sy glslang libepoxy libfontenc libxcvt libxfont2 libxkbfile vulkan-headers vulkan-validation-layers xcb-util-errors xcb-util-renderutil xcb-util-wm xorg-fonts-encodings xorg-server-common xorg-setxkbmap xorg-xkbcomp xorg-xwayland git go clang lld libc++ pkgconf meson ninja wayland wayland-protocols libinput libxkbcommon pixman glm libdrm libglvnd cairo pango systemd scdoc base-devel seatd + - name: Checkout Hyprland 📡 + uses: actions/checkout@v3 + with: + submodules: true + - name: Configure 🔧 + run: | + meson obj-x86_64-pc-linux-gnu \ + -Ddefault_library=static + - name: Compile 🎲 + run: ninja -C obj-x86_64-pc-linux-gnu + - name: Compress artifacts 📦 + run: | + mkdir x86_64-pc-linux-gnu + DESTDIR=$PWD/x86_64-pc-linux-gnu meson install -C obj-x86_64-pc-linux-gnu --tags runtime + tar -cvf x86_64-pc-linux-gnu.tar.xz x86_64-pc-linux-gnu + - name: Upload artifacts 📤 + uses: actions/upload-artifact@v3 + with: + name: Build artifacts (x86_64-pc-linux-gnu) + path: x86_64-pc-linux-gnu.tar.xz From 09cd8c45a690c611ed6da9802245fee3c968413d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20=22sp1rit=22=E2=80=8B?= Date: Tue, 14 Jun 2022 13:46:10 +0200 Subject: [PATCH 06/10] dropped emoticons from meson workflow --- .github/workflows/ci.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 48b4da43..8adef5c4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -48,27 +48,27 @@ jobs: container: image: archlinux steps: - - name: Download dependencies 📥 + - name: Download dependencies run: | sed -i 's/SigLevel = Required DatabaseOptional/SigLevel = Optional TrustAll/' /etc/pacman.conf pacman --noconfirm --noprogressbar -Syyu pacman --noconfirm --noprogressbar -Sy glslang libepoxy libfontenc libxcvt libxfont2 libxkbfile vulkan-headers vulkan-validation-layers xcb-util-errors xcb-util-renderutil xcb-util-wm xorg-fonts-encodings xorg-server-common xorg-setxkbmap xorg-xkbcomp xorg-xwayland git go clang lld libc++ pkgconf meson ninja wayland wayland-protocols libinput libxkbcommon pixman glm libdrm libglvnd cairo pango systemd scdoc base-devel seatd - - name: Checkout Hyprland 📡 + - name: Checkout Hyprland uses: actions/checkout@v3 with: submodules: true - - name: Configure 🔧 + - name: Configure run: | meson obj-x86_64-pc-linux-gnu \ -Ddefault_library=static - - name: Compile 🎲 + - name: Compile run: ninja -C obj-x86_64-pc-linux-gnu - - name: Compress artifacts 📦 + - name: Compress artifacts run: | mkdir x86_64-pc-linux-gnu DESTDIR=$PWD/x86_64-pc-linux-gnu meson install -C obj-x86_64-pc-linux-gnu --tags runtime tar -cvf x86_64-pc-linux-gnu.tar.xz x86_64-pc-linux-gnu - - name: Upload artifacts 📤 + - name: Upload artifacts uses: actions/upload-artifact@v3 with: name: Build artifacts (x86_64-pc-linux-gnu) From 8e203b0da3fe52d0b8bf22ff9c99d270b7bad160 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20=22sp1rit=22=E2=80=8B?= Date: Tue, 14 Jun 2022 14:32:27 +0200 Subject: [PATCH 07/10] added assets/wallpapers to install --- assets/meson.build | 5 +++++ meson.build | 1 + 2 files changed, 6 insertions(+) create mode 100644 assets/meson.build diff --git a/assets/meson.build b/assets/meson.build new file mode 100644 index 00000000..cc0577d3 --- /dev/null +++ b/assets/meson.build @@ -0,0 +1,5 @@ +wallpapers = ['wall_2K.png', 'wall_4K.png', 'wall_8K.png'] + +foreach wallpaper : wallpapers + install_data(wallpapers, install_dir: join_paths(get_option('datadir'), 'hyprland'), install_tag: 'runtime') +endforeach diff --git a/meson.build b/meson.build index e09b78ae..2998580c 100644 --- a/meson.build +++ b/meson.build @@ -18,4 +18,5 @@ endif subdir('protocols') subdir('src') subdir('hyprctl') +subdir('assets') subdir('example') From d179501c4f4a6b495fc4ded5aec9a1bf04563e95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20=22sp1rit=22=E2=80=8B?= Date: Tue, 14 Jun 2022 16:15:54 +0200 Subject: [PATCH 08/10] meson: added default_library=static as default option --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 2998580c..22ee4bf0 100644 --- a/meson.build +++ b/meson.build @@ -1,6 +1,6 @@ project('Hyprland', 'cpp', 'c', version : '0.1', - default_options : ['warning_level=3', 'cpp_std=c++20']) + default_options : ['warning_level=3', 'cpp_std=c++20', 'default_library=static']) wlroots = subproject('wlroots', default_options: ['examples=false']) have_xwlr = wlroots.get_variable('features').get('xwayland') From 75918c14d767af3a70010c9d57a0e97bd01a3334 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20=22sp1rit=22=E2=80=8B?= Date: Wed, 15 Jun 2022 12:04:42 +0200 Subject: [PATCH 09/10] meson: added wayland dependencies to main executable --- src/meson.build | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/meson.build b/src/meson.build index 4e52d65e..5d64188f 100644 --- a/src/meson.build +++ b/src/meson.build @@ -5,6 +5,8 @@ executable('Hyprland', src, cpp_args: ['-DWLR_USE_UNSTABLE'], dependencies: [ server_protos, + dependency('wayland-server'), + dependency('wayland-client'), wlroots.get_variable('wlroots'), dependency('cairo'), dependency('pango'), From 7c3626f15ed25b1d9eb4c14f7e4f887fab2ab62a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20=22sp1rit=22=E2=80=8B?= Date: Sat, 18 Jun 2022 13:09:38 +0200 Subject: [PATCH 10/10] meson: ensure non-debug builds will use proper configuration meson will set add -DHYPRLAND_DEBUG to CXXFLAGS during compilation of debug builds. this avoids NDEBUG issues with wlroots and ensures asserts will also work on release builds. --- meson.build | 4 ++++ src/debug/HyprCtl.cpp | 3 +++ src/defines.hpp | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/meson.build b/meson.build index 22ee4bf0..b902c80a 100644 --- a/meson.build +++ b/meson.build @@ -15,6 +15,10 @@ if not have_xwayland add_project_arguments('-DNO_XWAYLAND', language: 'cpp') endif +if get_option('buildtype') == 'debug' + add_project_arguments('-DHYPRLAND_DEBUG', language: 'cpp') +endif + subdir('protocols') subdir('src') subdir('hyprctl') diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp index 83656e13..66a8128d 100644 --- a/src/debug/HyprCtl.cpp +++ b/src/debug/HyprCtl.cpp @@ -114,6 +114,9 @@ std::string versionRequest() { #ifndef NDEBUG result += "debug\n"; #endif +#ifdef HYPRLAND_DEBUG + result += "debug\n"; +#endif #ifdef NO_XWAYLAND result += "no xwayland\n"; #endif diff --git a/src/defines.hpp b/src/defines.hpp index 18db3955..80750c23 100644 --- a/src/defines.hpp +++ b/src/defines.hpp @@ -7,10 +7,14 @@ #include "wlrunstable/wlr_ext_workspace_v1.hpp" #ifndef NDEBUG +#ifdef HYPRLAND_DEBUG #define ISDEBUG true #else #define ISDEBUG false #endif +#else +#define ISDEBUG false +#endif #define RIP(format, ... ) { fprintf(stderr, format "\n", ##__VA_ARGS__); exit(EXIT_FAILURE); }