diff --git a/x11-wm/hyprland/Makefile b/x11-wm/hyprland/Makefile index cdf253e88808..80b64433494e 100644 --- a/x11-wm/hyprland/Makefile +++ b/x11-wm/hyprland/Makefile @@ -1,98 +1,113 @@ PORTNAME= hyprland DISTVERSIONPREFIX= v -DISTVERSION= 0.34.0 -PORTREVISION= 2 +DISTVERSION= 0.35.0 CATEGORIES= x11-wm wayland MAINTAINER= jbeich@FreeBSD.org COMMENT= Dynamic tiling Wayland compositor that doesn't sacrifice on its looks #' WWW= https://hyprland.org/ LICENSE= BSD3CLAUSE LICENSE_FILE= ${WRKSRC}/LICENSE BUILD_DEPENDS= cmake:devel/cmake-core \ evdev-proto>0:devel/evdev-proto \ wayland-protocols>=1.25:graphics/wayland-protocols LIB_DEPENDS= libtomlplusplus.so:devel/tomlplusplus \ libdrm.so:graphics/libdrm \ libwayland-server.so:graphics/wayland \ libwlroots.so:x11-toolkits/wlroots \ libinput.so:x11/libinput \ libxkbcommon.so:x11/libxkbcommon USES= compiler:c++11-lib gl gnome meson pkgconfig xorg USE_GITHUB= yes USE_GL= egl opengl USE_GNOME= cairo pango USE_XORG= pixman GH_ACCOUNT= hyprwm GH_PROJECT= Hyprland GH_TUPLE= hyprwm:hyprland-protocols:v0.2-4-g0c2ce70:hyprland_protocols/subprojects/hyprland-protocols \ canihavesomecoffee:udis86:1.7.2-186-g5336633:udis86/subprojects/udis86 MESON_ARGS= -Dsystemd=disabled +# Generated by "make update-hash" for "hyprpm update" (headersValid) +GH_HASH= 84ab8d11e8951a6551d1e1bf87796a8589da6d47 + # XXX Drop after FreeBSD 14.0 EOL around 2025-03-01 .if exists(/usr/lib/libc++.so) && !exists(/usr/include/c++/v1/__format/write_escaped.h) CXXFLAGS+= -fexperimental-library .endif OPTIONS_DEFINE= X11 OPTIONS_DEFAULT=X11 X11_USE= XORG=xcb X11_MESON_ENABLED= xwayland post-patch: # Extract (snapshot) version from the port instead of meson.build @${REINPLACE_CMD} -i .nogit \ -e "/version.*jq/s/run_command.*/'${DISTVERSIONFULL}',/" \ ${WRKSRC}/meson.build @${REINPLACE_CMD} -i .nogit \ - -e '/^HASH/s/=.*/=${DISTVERSIONFULL:C/.*-g//}/' \ + -e '/^HASH/s/=.*/=${GH_HASH}/' \ -e '/^BRANCH/s/=.*/=main/' \ -e '/^MESSAGE/s/=.*/="?"/' \ -e "/^DATE/s/=.*/=\"$$(date -ur $$(${AWK} \ '/TIMESTAMP/ { print $$3 }' ${DISTINFO_FILE}))\"/" \ -e '/^DIRTY/s/=.*/=portbld/' \ -e '/^TAG/s/=.*/=${DISTVERSIONFULL}/' \ ${WRKSRC}/scripts/generateVersion.sh # Respect PREFIX for wallpapers @${REINPLACE_CMD} 's,/usr/share,${DATADIR:H},' \ ${WRKSRC}/src/render/OpenGL.cpp .ifdef GH_TUPLE post-configure: @${REINPLACE_CMD} 's/meson install/& \ --skip-subprojects/' ${BUILD_WRKSRC}/build.ninja .endif post-install: # Plugin API installs all headers (no private vs. public) @(cd ${STAGEDIR}${PREFIX} && ${FIND} include/${PORTNAME} ! -type d) >>${TMPPLIST} +update-hash: +# https://docs.github.com/en/rest/commits/commits#get-a-commit +# Pretend to be curl(1) for pretty-printed JSON to help parse with sed(1) + @${REINPLACE_CMD} -i '' -e "/^GH_HASH=/s/=.*/= $$(\ + ${SETENV} HTTP_USER_AGENT=curl ${FETCH_CMD} -qo- \ + https://api.github.com/repos/${GH_ACCOUNT}/${GH_PROJECT}/commits/${GH_TAGNAME} | \ + ${SED} -n '/sha/ { s/.*\"\([0-9a-f]\{40\}\).*/\1/p; q; }' \ + )/" \ + ${.CURDIR}/Makefile + # XXX Drop after FreeBSD 13.2 EOL around 2024-05-01 (don't forget distinfo) .if ${CXX} == c++ && exists(/usr/lib/libc++.so) .if !exists(/usr/include/c++/v1/__ranges/as_rvalue_view.h) || make(makesum) || make(fetch) USES+= llvm:min=16,build,export PATH:= ${LLVM_PREFIX}/bin:${PATH} # XXX _CMAKE_TOOLCHAIN_SUFFIX vs. devel/llvm* CONFIGURE_ENV+= CC="${CC}" CXX="${CXX}" CPP="${CPP}" CMAKE_BIN= ${LOCALBASE}/bin/cmake # XXX Move into separate port and standardize via USES GH_TUPLE+= llvm:llvm-project:llvmorg-16.0.1:libcxx CXXFLAGS+= -nostdinc++ -isystem${WRKDIR}/libcxx_prefix/include/c++/v1 # Don't link against new libc++ as it's not necessary #LDFLAGS+= -nostdlib++ -L${WRKDIR}/libcxx_prefix/lib -l:libc++.a -lcxxrt pre-configure: bundled-libcxx bundled-libcxx: @${SETENV} ${CONFIGURE_ENV} ${CMAKE_BIN} ${CMAKE_ARGS} \ -DLIBCXX_INCLUDE_BENCHMARKS:BOOL=OFF \ -DCMAKE_INSTALL_PREFIX:PATH=${WRKDIR}/libcxx_prefix \ -B ${WRKDIR}/libcxx_build -S ${WRKSRC_libcxx}/libcxx @${DO_MAKE_BUILD:NDESTDIR*} install -C ${WRKDIR}/libcxx_build .endif .endif # exists(/usr/lib/libc++.so) .include + +# XXX Work around !target(makesum) +makesum: update-hash diff --git a/x11-wm/hyprland/distinfo b/x11-wm/hyprland/distinfo index c5e3b03db8cd..01c9f07596c6 100644 --- a/x11-wm/hyprland/distinfo +++ b/x11-wm/hyprland/distinfo @@ -1,9 +1,9 @@ -TIMESTAMP = 1704110595 -SHA256 (hyprwm-Hyprland-v0.34.0_GH0.tar.gz) = a556a52fdf8ad759f4a1017309f021c16b280b012e10e37ddfbf53456e3d6183 -SIZE (hyprwm-Hyprland-v0.34.0_GH0.tar.gz) = 7363751 +TIMESTAMP = 1707098342 +SHA256 (hyprwm-Hyprland-v0.35.0_GH0.tar.gz) = 2dbb8b5b6ea9179a6ba26757e274b04330eb26e7e3368e7e1fc68f58c42a3be5 +SIZE (hyprwm-Hyprland-v0.35.0_GH0.tar.gz) = 47430241 SHA256 (hyprwm-hyprland-protocols-v0.2-4-g0c2ce70_GH0.tar.gz) = d8eb9712d66a167a22a0dae829b6dba2b85814b566d0a87918c944e7c0388d1b SIZE (hyprwm-hyprland-protocols-v0.2-4-g0c2ce70_GH0.tar.gz) = 6478 SHA256 (canihavesomecoffee-udis86-1.7.2-186-g5336633_GH0.tar.gz) = 69aff959179ff6247b375b92e797221dbd8e078eabbf1366280b0532617e7fb8 SIZE (canihavesomecoffee-udis86-1.7.2-186-g5336633_GH0.tar.gz) = 116938 SHA256 (llvm-llvm-project-llvmorg-16.0.1_GH0.tar.gz) = b5a9ff1793b1e2d388a3819bf35797002b1d2e40bb35a10c65605e0ea1435271 SIZE (llvm-llvm-project-llvmorg-16.0.1_GH0.tar.gz) = 179289803 diff --git a/x11-wm/hyprland/files/patch-wlroots-0.17 b/x11-wm/hyprland/files/patch-wlroots-0.17 index f489a10606b1..f6297c42fc77 100644 --- a/x11-wm/hyprland/files/patch-wlroots-0.17 +++ b/x11-wm/hyprland/files/patch-wlroots-0.17 @@ -1,54 +1,131 @@ 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 2023-11-30 15:20:08 UTC +--- src/Compositor.cpp.orig 2024-02-05 01:59:02 UTC +++ src/Compositor.cpp -@@ -190,7 +190,7 @@ void CCompositor::initServer() { +@@ -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); -@@ -282,7 +282,7 @@ void CCompositor::initAllSignals() { +@@ -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()).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 #include #include -#include #include #include +--- 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) { diff --git a/x11-wm/hyprland/pkg-plist b/x11-wm/hyprland/pkg-plist index 56447c768bf0..9587e6b1a9e8 100644 --- a/x11-wm/hyprland/pkg-plist +++ b/x11-wm/hyprland/pkg-plist @@ -1,18 +1,12 @@ bin/Hyprland bin/hyprctl bin/hyprpm +%%DATADIR%%/hyprland.conf +%%DATADIR%%/wall0.png +%%DATADIR%%/wall1.png +%%DATADIR%%/wall2.png share/man/man1/Hyprland.1.gz share/man/man1/hyprctl.1.gz -%%DATADIR%%/hyprland.conf -%%DATADIR%%/wall_2K.png -%%DATADIR%%/wall_4K.png -%%DATADIR%%/wall_8K.png -%%DATADIR%%/wall_anime2_2K.png -%%DATADIR%%/wall_anime2_4K.png -%%DATADIR%%/wall_anime2_8K.png -%%DATADIR%%/wall_anime_2K.png -%%DATADIR%%/wall_anime_4K.png -%%DATADIR%%/wall_anime_8K.png share/pkgconfig/hyprland.pc share/wayland-sessions/hyprland.desktop share/xdg-desktop-portal/hyprland-portals.conf