Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Mar 2024 05:52:27 GMT
From:      Jan Beich <jbeich@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 5b4195285473 - main - x11-wm/hyprland: switch to wlroots-devel to simplify updates
Message-ID:  <202403010552.4215qROM095102@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by jbeich:

URL: https://cgit.FreeBSD.org/ports/commit/?id=5b4195285473aa598bd5c6dbd57b6ac9a27327fc

commit 5b4195285473aa598bd5c6dbd57b6ac9a27327fc
Author:     Jan Beich <jbeich@FreeBSD.org>
AuthorDate: 2024-02-29 17:28:27 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2024-03-01 05:51:04 +0000

    x11-wm/hyprland: switch to wlroots-devel to simplify updates
    
    Giving up adding more workarounds after 0.36.0 introduced
    
    https://github.com/hyprwm/Hyprland/commit/301b48b74087
    https://gitlab.freedesktop.org/wlroots/wlroots/-/commit/20935646168f
    
    ../src/render/Renderer.cpp:2501:9: error: use of undeclared identifier 'wlr_damage_ring_rotate_buffer'
     2501 |         wlr_damage_ring_rotate_buffer(&pMonitor->damage, m_pCurrentWlrBuffer, damage.pixman());
          |         ^
    
    This reverts commit 46de20d9e039ad2aacc3ee6d1434b9c2d604fb83.
    This reverts commit 474e59a13f289a0cade43c95ea01ef042f22665b.
---
 x11-wm/hyprland/Makefile                   |   8 ++
 x11-wm/hyprland/files/patch-system-wlroots |   2 +-
 x11-wm/hyprland/files/patch-wlroots-0.17   | 131 -----------------------------
 3 files changed, 9 insertions(+), 132 deletions(-)

diff --git a/x11-wm/hyprland/Makefile b/x11-wm/hyprland/Makefile
index ccf095e227d9..79a46656a14c 100644
--- a/x11-wm/hyprland/Makefile
+++ b/x11-wm/hyprland/Makefile
@@ -1,6 +1,7 @@
 PORTNAME=	hyprland
 DISTVERSIONPREFIX=	v
 DISTVERSION=	0.35.0
+PORTREVISION=	1
 CATEGORIES=	x11-wm wayland
 
 MAINTAINER=	jbeich@FreeBSD.org
@@ -107,6 +108,13 @@ bundled-libcxx:
 	@${DO_MAKE_BUILD:NDESTDIR*} install -C ${WRKDIR}/libcxx_build
 .endif
 .endif # exists(/usr/lib/libc++.so)
+
+.include "${.CURDIR:H:H}/x11-toolkits/wlroots-devel/override.mk"
+post-patch:	wlroots-devel-patch
+wlroots-devel-patch:
+# Prefer <wlr/*> headers (used by <hyprland/*>) from wlroots-devel
+	@${REINPLACE_CMD} -i .devel "/subdirs/s|''|'../wlroots-devel/include', &|" \
+		${WRKSRC}/meson.build
 .include <bsd.port.mk>
 
 # XXX Work around !target(makesum)
diff --git a/x11-wm/hyprland/files/patch-system-wlroots b/x11-wm/hyprland/files/patch-system-wlroots
index 1373e3aff497..d466167166bd 100644
--- a/x11-wm/hyprland/files/patch-system-wlroots
+++ b/x11-wm/hyprland/files/patch-system-wlroots
@@ -8,7 +8,7 @@ Allow system wlroots to reduce maintenance (wlroots has tons of options)
  
 -wlroots = subproject('wlroots', default_options: ['examples=false', 'renderers=gles2'])
 -have_xwlr = wlroots.get_variable('features').get('xwayland')
-+wlroots = dependency('wlroots', version: ['>=0.17.0', '<0.18.0'], default_options: ['examples=false', 'renderers=gles2'])
++wlroots = dependency('wlroots', version: ['>=0.18.0', '<0.19.0'], default_options: ['examples=false', 'renderers=gles2'])
 +have_xwlr = wlroots.get_variable(pkgconfig: 'have_xwayland', internal: 'have_xwayland') == 'true'
  xcb_dep = dependency('xcb', required: get_option('xwayland'))
  
diff --git a/x11-wm/hyprland/files/patch-wlroots-0.17 b/x11-wm/hyprland/files/patch-wlroots-0.17
deleted file mode 100644
index f6297c42fc77..000000000000
--- a/x11-wm/hyprland/files/patch-wlroots-0.17
+++ /dev/null
@@ -1,131 +0,0 @@
-Revert to wlroots 0.17 API as 0.18 is a moving target, so hard to
-use as system package with more than one consumer.
-
-https://github.com/hyprwm/hyprland/commit/2ebfd0c7456e
-https://github.com/hyprwm/hyprland/commit/d2c3b23ace74
-https://github.com/hyprwm/hyprland/commit/33444e1e5ef8
-https://github.com/hyprwm/hyprland/commit/7b3d03938888
-
---- src/Compositor.cpp.orig	2024-02-05 01:59:02 UTC
-+++ src/Compositor.cpp
-@@ -115,7 +115,7 @@ void CCompositor::initServer() {
-     else
-         wlr_log_init(WLR_ERROR, Debug::wlrLog);
- 
--    m_sWLRBackend = wlr_backend_autocreate(m_sWLEventLoop, &m_sWLRSession);
-+    m_sWLRBackend = wlr_backend_autocreate(m_sWLDisplay, &m_sWLRSession);
- 
-     if (!m_sWLRBackend) {
-         Debug::log(CRIT, "m_sWLRBackend was NULL! This usually means wlroots could not find a GPU or enountered some issues.");
-@@ -169,7 +169,7 @@ void CCompositor::initServer() {
- 
-     m_sWLRGammaCtrlMgr = wlr_gamma_control_manager_v1_create(m_sWLDisplay);
- 
--    m_sWLROutputLayout = wlr_output_layout_create(m_sWLDisplay);
-+    m_sWLROutputLayout = wlr_output_layout_create();
- 
-     m_sWLROutputPowerMgr = wlr_output_power_manager_v1_create(m_sWLDisplay);
- 
-@@ -239,7 +239,7 @@ void CCompositor::initServer() {
- 
-     m_sWLRActivation = wlr_xdg_activation_v1_create(m_sWLDisplay);
- 
--    m_sWLRHeadlessBackend = wlr_headless_backend_create(m_sWLEventLoop);
-+    m_sWLRHeadlessBackend = wlr_headless_backend_create(m_sWLDisplay);
- 
-     m_sWLRSessionLockMgr = wlr_session_lock_manager_v1_create(m_sWLDisplay);
- 
-@@ -261,7 +261,7 @@ void CCompositor::initAllSignals() {
- 
- void CCompositor::initAllSignals() {
-     addWLSignal(&m_sWLRBackend->events.new_output, &Events::listen_newOutput, m_sWLRBackend, "Backend");
--    addWLSignal(&m_sWLRXDGShell->events.new_toplevel, &Events::listen_newXDGToplevel, m_sWLRXDGShell, "XDG Shell");
-+    addWLSignal(&m_sWLRXDGShell->events.new_surface, &Events::listen_newXDGToplevel, m_sWLRXDGShell, "XDG Shell");
-     addWLSignal(&m_sWLRCursor->events.motion, &Events::listen_mouseMove, m_sWLRCursor, "WLRCursor");
-     addWLSignal(&m_sWLRCursor->events.motion_absolute, &Events::listen_mouseMoveAbsolute, m_sWLRCursor, "WLRCursor");
-     addWLSignal(&m_sWLRCursor->events.button, &Events::listen_mouseButton, m_sWLRCursor, "WLRCursor");
---- src/Window.cpp.orig	2024-02-05 01:59:02 UTC
-+++ src/Window.cpp
-@@ -513,7 +513,7 @@ void CWindow::onMap() {
-         if (ctrl->pWlrHint->surface != m_pWLSurface.wlr())
-             continue;
- 
--        m_bTearingHint = ctrl->pWlrHint->current;
-+        m_bTearingHint = ctrl->pWlrHint->hint;
-         break;
-     }
- }
---- src/events/Misc.cpp.orig	2024-02-05 01:59:02 UTC
-+++ src/events/Misc.cpp
-@@ -255,9 +255,9 @@ void Events::listener_newTearingHint(wl_listener* list
-             const auto PWINDOW = g_pCompositor->getWindowFromSurface(TEARINGHINT->pWlrHint->surface);
- 
-             if (PWINDOW) {
--                PWINDOW->m_bTearingHint = (bool)TEARINGHINT->pWlrHint->current;
-+                PWINDOW->m_bTearingHint = TEARINGHINT->pWlrHint->hint;
- 
--                Debug::log(LOG, "Hint {:x} (window {}) set tearing hint to {}", (uintptr_t)TEARINGHINT->pWlrHint, PWINDOW, (uint32_t)TEARINGHINT->pWlrHint->current);
-+                Debug::log(LOG, "Hint {:x} (window {}) set tearing hint to {}", (uintptr_t)TEARINGHINT->pWlrHint, PWINDOW, (uint32_t)TEARINGHINT->pWlrHint->hint);
-             }
-         },
-         NEWCTRL, "TearingController");
---- src/events/Windows.cpp.orig	2023-11-30 15:20:08 UTC
-+++ src/events/Windows.cpp
-@@ -1171,10 +1171,12 @@ void Events::listener_newXDGToplevel(wl_listener* list
- 
- void Events::listener_newXDGToplevel(wl_listener* listener, void* data) {
-     // A window got opened
--    const auto XDGTOPLEVEL = (wlr_xdg_toplevel*)data;
--    const auto XDGSURFACE  = XDGTOPLEVEL->base;
-+    const auto XDGSURFACE = (wlr_xdg_surface*)data;
- 
--    Debug::log(LOG, "New XDG Toplevel created. (class: {})", XDGSURFACE->toplevel->app_id ? XDGSURFACE->toplevel->app_id : "null");
-+    if (XDGSURFACE->role != WLR_XDG_SURFACE_ROLE_TOPLEVEL)
-+        return;
-+
-+    Debug::log(LOG, "New XDG Surface created. (class: {})", XDGSURFACE->toplevel->app_id ? XDGSURFACE->toplevel->app_id : "null");
- 
-     const auto PNEWWINDOW      = g_pCompositor->m_vWindows.emplace_back(std::make_unique<CWindow>()).get();
-     PNEWWINDOW->m_uSurface.xdg = XDGSURFACE;
---- src/includes.hpp.orig	2023-11-30 15:20:08 UTC
-+++ src/includes.hpp
-@@ -105,7 +105,6 @@ extern "C" {
- #include <wlr/types/wlr_cursor_shape_v1.h>
- #include <wlr/types/wlr_tearing_control_v1.h>
- #include <wlr/util/box.h>
--#include <wlr/util/transform.h>
- #include <wlr/render/swapchain.h>
- #include <wlr/render/egl.h>
- 
---- src/managers/input/InputManager.cpp.orig	2024-02-05 01:59:02 UTC
-+++ src/managers/input/InputManager.cpp
-@@ -699,8 +699,7 @@ void CInputManager::onMouseWheel(wlr_pointer_axis_even
-             return;
-     }
- 
--    wlr_seat_pointer_notify_axis(g_pCompositor->m_sSeat.seat, e->time_msec, e->orientation, factor * e->delta, std::round(factor * e->delta_discrete), e->source,
--                                 WLR_AXIS_RELATIVE_DIRECTION_IDENTICAL);
-+    wlr_seat_pointer_notify_axis(g_pCompositor->m_sSeat.seat, e->time_msec, e->orientation, factor * e->delta, std::round(factor * e->delta_discrete), e->source);
- }
- 
- Vector2D CInputManager::getMouseCoordsInternal() {
---- src/render/Renderer.cpp.orig	2024-02-05 01:59:02 UTC
-+++ src/render/Renderer.cpp
-@@ -163,7 +163,7 @@ static void renderSurface(struct wlr_surface* surface,
- 
-     if (!g_pHyprRenderer->m_bBlockSurfaceFeedback) {
-         wlr_surface_send_frame_done(surface, RDATA->when);
--        wlr_presentation_surface_textured_on_output(surface, RDATA->pMonitor->output);
-+        wlr_presentation_surface_textured_on_output(g_pCompositor->m_sWLRPresentation, surface, RDATA->pMonitor->output);
-     }
- 
-     g_pHyprOpenGL->blend(true);
-@@ -923,7 +923,7 @@ bool CHyprRenderer::attemptDirectScanout(CMonitor* pMo
-     timespec now;
-     clock_gettime(CLOCK_MONOTONIC, &now);
-     wlr_surface_send_frame_done(PSURFACE, &now);
--    wlr_presentation_surface_scanned_out_on_output(PSURFACE, pMonitor->output);
-+    wlr_presentation_surface_scanned_out_on_output(g_pCompositor->m_sWLRPresentation, PSURFACE, pMonitor->output);
- 
-     if (pMonitor->state.commit()) {
-         if (!m_pLastScanout) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202403010552.4215qROM095102>