diff options
Diffstat (limited to 'x11-toolkits/hyprtoolkit')
13 files changed, 203 insertions, 0 deletions
diff --git a/x11-toolkits/hyprtoolkit/Makefile b/x11-toolkits/hyprtoolkit/Makefile new file mode 100644 index 000000000000..42fa5c98e16a --- /dev/null +++ b/x11-toolkits/hyprtoolkit/Makefile @@ -0,0 +1,47 @@ +PORTNAME= hyprtoolkit +DISTVERSIONPREFIX= v +DISTVERSION= 0.3.0 +PORTREVISION= 2 +CATEGORIES= x11-toolkits + +MAINTAINER= tagattie@FreeBSD.org +COMMENT= Modern C++ Wayland-native GUI toolkit +WWW= https://github.com/hyprwm/hyprtoolkit + +LICENSE= BSD3CLAUSE +LICENSE_FILE= ${WRKSRC}/LICENSE + +BUILD_DEPENDS= googletest>0:devel/googletest \ + hyprwayland-scanner>=0.4.0:devel/hyprwayland-scanner \ + wayland-protocols>0:graphics/wayland-protocols +LIB_DEPENDS= libhyprlang.so:devel/hyprlang \ + libhyprutils.so:devel/hyprutils \ + libiniparser.so:devel/iniparser \ + libinotify.so:devel/libinotify \ + libhyprgraphics.so:graphics/hyprgraphics \ + libdrm.so:graphics/libdrm \ + libwayland-client.so:graphics/wayland \ + libxkbcommon.so:x11/libxkbcommon \ + libaquamarine.so:x11-toolkits/aquamarine + +USES= cmake:testing compiler:c++20-lang gl gnome pkgconfig xorg + +USE_GITHUB= yes +GH_ACCOUNT= hyprwm + +USE_GL= egl gbm opengl +USE_GNOME= cairo pango +USE_XORG= pixman + +LDFLAGS+= -pthread + +PLIST_SUB= SOVERSION_MAJOR=3 \ + SOVERSION_FULL=${DISTVERSION} + +# XXX Drop after FreeBSD 13.5 EOL around 2026-04-30 +# https://cgit.freebsd.org/src/commit/?id=af93fea71038 +.if !exists(/usr/include/sys/timerfd.h) +LIB_DEPENDS+= libepoll-shim.so:devel/libepoll-shim +.endif + +.include <bsd.port.mk> diff --git a/x11-toolkits/hyprtoolkit/distinfo b/x11-toolkits/hyprtoolkit/distinfo new file mode 100644 index 000000000000..93159b74f145 --- /dev/null +++ b/x11-toolkits/hyprtoolkit/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1762933997 +SHA256 (hyprwm-hyprtoolkit-v0.3.0_GH0.tar.gz) = 9f7e1a0a7bfe31ef769bfa9dfaef211f193f38b10e0823320336578ecee13d55 +SIZE (hyprwm-hyprtoolkit-v0.3.0_GH0.tar.gz) = 559745 diff --git a/x11-toolkits/hyprtoolkit/files/patch-CMakeLists.txt b/x11-toolkits/hyprtoolkit/files/patch-CMakeLists.txt new file mode 100644 index 000000000000..5a16eafbc215 --- /dev/null +++ b/x11-toolkits/hyprtoolkit/files/patch-CMakeLists.txt @@ -0,0 +1,28 @@ +--- CMakeLists.txt.orig 2025-11-10 12:58:11 UTC ++++ CMakeLists.txt +@@ -82,9 +82,15 @@ if(NOT HAS_TIMERFD AND epoll_FOUND) + check_include_file("sys/timerfd.h" HAS_TIMERFD) + pkg_check_modules(epoll IMPORTED_TARGET epoll-shim) + if(NOT HAS_TIMERFD AND epoll_FOUND) +- target_link_libraries(hyprtoolkit PkgConfig::epoll) ++ target_link_libraries(hyprtoolkit PUBLIC PkgConfig::epoll) + endif() + ++check_include_file("sys/inotify.h" HAS_INOTIFY) ++pkg_check_modules(inotify IMPORTED_TARGET libinotify) ++if(NOT HAS_INOTIFY AND inotify_FOUND) ++ target_link_libraries(hyprtoolkit PUBLIC PkgConfig::inotify) ++endif() ++ + if (NOT DISABLE_TESTS) + enable_testing() + +@@ -111,7 +117,7 @@ if (NOT DISABLE_TESTS) + target_compile_options(hyprtoolkit_inline_tests PRIVATE --coverage) + target_link_options(hyprtoolkit_inline_tests PRIVATE --coverage) + target_include_directories(hyprtoolkit_inline_tests PUBLIC "./include" PRIVATE "./src" "./src/include" "./protocols" "${CMAKE_BINARY_DIR}") +- target_link_libraries(hyprtoolkit_inline_tests PRIVATE GTest::gtest_main OpenGL::EGL OpenGL::OpenGL PkgConfig::deps) ++ target_link_libraries(hyprtoolkit_inline_tests PRIVATE GTest::gtest_main OpenGL::EGL OpenGL::OpenGL PkgConfig::deps PkgConfig::epoll PkgConfig::inotify) + gtest_discover_tests(hyprtoolkit_inline_tests) + endif() + diff --git a/x11-toolkits/hyprtoolkit/files/patch-include_hyprtoolkit_palette_Palette.hpp b/x11-toolkits/hyprtoolkit/files/patch-include_hyprtoolkit_palette_Palette.hpp new file mode 100644 index 000000000000..f69244d0d8aa --- /dev/null +++ b/x11-toolkits/hyprtoolkit/files/patch-include_hyprtoolkit_palette_Palette.hpp @@ -0,0 +1,11 @@ +--- include/hyprtoolkit/palette/Palette.hpp.orig 2025-11-12 08:32:18 UTC ++++ include/hyprtoolkit/palette/Palette.hpp +@@ -4,6 +4,8 @@ + + #include "Color.hpp" + ++#include <string> ++ + namespace Hyprtoolkit { + + class CPalette { diff --git a/x11-toolkits/hyprtoolkit/files/patch-src_core_Backend.cpp b/x11-toolkits/hyprtoolkit/files/patch-src_core_Backend.cpp new file mode 100644 index 000000000000..87108a81019b --- /dev/null +++ b/x11-toolkits/hyprtoolkit/files/patch-src_core_Backend.cpp @@ -0,0 +1,10 @@ +--- src/core/Backend.cpp.orig 2025-11-12 08:07:15 UTC ++++ src/core/Backend.cpp +@@ -19,6 +19,7 @@ + #include <sys/poll.h> + + #include <print> ++#include <unistd.h> + + using namespace Hyprtoolkit; + using namespace Hyprutils::Memory; diff --git a/x11-toolkits/hyprtoolkit/files/patch-src_core_platforms_WaylandPlatform.cpp b/x11-toolkits/hyprtoolkit/files/patch-src_core_platforms_WaylandPlatform.cpp new file mode 100644 index 000000000000..15f595daa055 --- /dev/null +++ b/x11-toolkits/hyprtoolkit/files/patch-src_core_platforms_WaylandPlatform.cpp @@ -0,0 +1,10 @@ +--- src/core/platforms/WaylandPlatform.cpp.orig 2025-11-12 08:07:51 UTC ++++ src/core/platforms/WaylandPlatform.cpp +@@ -15,6 +15,7 @@ + #include <cstring> + #include <sys/mman.h> + #include <fcntl.h> ++#include <unistd.h> + + using namespace Hyprtoolkit; + using namespace Hyprutils::Math; diff --git a/x11-toolkits/hyprtoolkit/files/patch-src_element_Element.cpp b/x11-toolkits/hyprtoolkit/files/patch-src_element_Element.cpp new file mode 100644 index 000000000000..b749e5845853 --- /dev/null +++ b/x11-toolkits/hyprtoolkit/files/patch-src_element_Element.cpp @@ -0,0 +1,11 @@ +--- src/element/Element.cpp.orig 2025-11-12 08:13:02 UTC ++++ src/element/Element.cpp +@@ -7,6 +7,8 @@ + #include "../window/ToolkitWindow.hpp" + #include "../layout/Positioner.hpp" + ++#include <algorithm> ++ + using namespace Hyprtoolkit; + using namespace Hyprutils::Math; + diff --git a/x11-toolkits/hyprtoolkit/files/patch-src_element_scrollArea_ScrollArea.cpp b/x11-toolkits/hyprtoolkit/files/patch-src_element_scrollArea_ScrollArea.cpp new file mode 100644 index 000000000000..f3acbfb3d474 --- /dev/null +++ b/x11-toolkits/hyprtoolkit/files/patch-src_element_scrollArea_ScrollArea.cpp @@ -0,0 +1,11 @@ +--- src/element/scrollArea/ScrollArea.cpp.orig 2025-11-12 08:23:14 UTC ++++ src/element/scrollArea/ScrollArea.cpp +@@ -118,7 +118,7 @@ void SScrollAreaImpl::clampMaxScroll() { + data.scrollX ? 99999999999 : self->impl->position.w, + data.scrollY ? 99999999999 : self->impl->position.h, + }) +- .value_or({99999999, 99999999}) - ++ .value_or(Vector2D{99999999, 99999999}) - + self->impl->position.size()) + .clamp({0, 0}); + diff --git a/x11-toolkits/hyprtoolkit/files/patch-src_palette_ConfigManager.cpp b/x11-toolkits/hyprtoolkit/files/patch-src_palette_ConfigManager.cpp new file mode 100644 index 000000000000..e17c3beeec3f --- /dev/null +++ b/x11-toolkits/hyprtoolkit/files/patch-src_palette_ConfigManager.cpp @@ -0,0 +1,11 @@ +--- src/palette/ConfigManager.cpp.orig 2025-11-12 08:27:37 UTC ++++ src/palette/ConfigManager.cpp +@@ -4,6 +4,8 @@ + + #include "../core/InternalBackend.hpp" + ++#include <unistd.h> ++ + using namespace Hyprtoolkit; + + CConfigManager::CConfigManager() : m_inotifyFd(inotify_init()) { diff --git a/x11-toolkits/hyprtoolkit/files/patch-src_renderer_gl_OpenGL.cpp b/x11-toolkits/hyprtoolkit/files/patch-src_renderer_gl_OpenGL.cpp new file mode 100644 index 000000000000..a42cb29d84a4 --- /dev/null +++ b/x11-toolkits/hyprtoolkit/files/patch-src_renderer_gl_OpenGL.cpp @@ -0,0 +1,11 @@ +--- src/renderer/gl/OpenGL.cpp.orig 2025-11-12 08:29:16 UTC ++++ src/renderer/gl/OpenGL.cpp +@@ -447,7 +447,7 @@ COpenGLRenderer::COpenGLRenderer(int drmFD) : m_drmFD( + + g_logger->log(HT_LOG_DEBUG, "DRM syncobj timeline support: {}", m_syncobjSupported ? "yes" : "no"); + #else +- Debug::log(LOG, "DRM syncobj timeline support: no (not linux)"); ++ g_logger->log(HT_LOG_DEBUG, "DRM syncobj timeline support: no (not linux)"); + #endif + + #ifdef HYPRTOOLKIT_DEBUG diff --git a/x11-toolkits/hyprtoolkit/files/patch-src_window_WaylandPopup.cpp b/x11-toolkits/hyprtoolkit/files/patch-src_window_WaylandPopup.cpp new file mode 100644 index 000000000000..9090cbba3ee3 --- /dev/null +++ b/x11-toolkits/hyprtoolkit/files/patch-src_window_WaylandPopup.cpp @@ -0,0 +1,11 @@ +--- src/window/WaylandPopup.cpp.orig 2025-11-12 08:33:32 UTC ++++ src/window/WaylandPopup.cpp +@@ -59,7 +59,7 @@ void CWaylandPopup::open() { + m_wlPopupState.xdgPositioner->sendSetAnchorRect(m_creationData.pos.x, m_creationData.pos.y, 1, 1); + m_wlPopupState.xdgPositioner->sendSetAnchor(XDG_POSITIONER_ANCHOR_TOP_LEFT); + m_wlPopupState.xdgPositioner->sendSetGravity(XDG_POSITIONER_GRAVITY_BOTTOM_RIGHT); +- m_wlPopupState.xdgPositioner->sendSetSize(m_creationData.preferredSize.value_or({200, 200}).x, m_creationData.preferredSize.value_or({200, 200}).y); ++ m_wlPopupState.xdgPositioner->sendSetSize(m_creationData.preferredSize.value_or(Vector2D{200, 200}).x, m_creationData.preferredSize.value_or(Vector2D{200, 200}).y); + m_wlPopupState.xdgPositioner->sendSetConstraintAdjustment( + (xdgPositionerConstraintAdjustment)(XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_SLIDE_Y | XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_SLIDE_X)); + diff --git a/x11-toolkits/hyprtoolkit/pkg-descr b/x11-toolkits/hyprtoolkit/pkg-descr new file mode 100644 index 000000000000..482be8457447 --- /dev/null +++ b/x11-toolkits/hyprtoolkit/pkg-descr @@ -0,0 +1,7 @@ +Hyprtoolkit is designed to be a small, simple, and modern C++ toolkit +for making wayland GUI apps, with a few goals: + +- Simple C++ API for making a GUI app +- Smooth animations +- Easy usage +- Simple system theming diff --git a/x11-toolkits/hyprtoolkit/pkg-plist b/x11-toolkits/hyprtoolkit/pkg-plist new file mode 100644 index 000000000000..740343e45d29 --- /dev/null +++ b/x11-toolkits/hyprtoolkit/pkg-plist @@ -0,0 +1,32 @@ +include/hyprtoolkit/core/Backend.hpp +include/hyprtoolkit/core/CoreMacros.hpp +include/hyprtoolkit/core/Input.hpp +include/hyprtoolkit/core/LogTypes.hpp +include/hyprtoolkit/core/Timer.hpp +include/hyprtoolkit/element/Button.hpp +include/hyprtoolkit/element/Checkbox.hpp +include/hyprtoolkit/element/ColumnLayout.hpp +include/hyprtoolkit/element/Combobox.hpp +include/hyprtoolkit/element/Element.hpp +include/hyprtoolkit/element/Image.hpp +include/hyprtoolkit/element/Line.hpp +include/hyprtoolkit/element/Null.hpp +include/hyprtoolkit/element/Rectangle.hpp +include/hyprtoolkit/element/RowLayout.hpp +include/hyprtoolkit/element/ScrollArea.hpp +include/hyprtoolkit/element/Slider.hpp +include/hyprtoolkit/element/Spinbox.hpp +include/hyprtoolkit/element/Text.hpp +include/hyprtoolkit/element/Textbox.hpp +include/hyprtoolkit/palette/Color.hpp +include/hyprtoolkit/palette/Palette.hpp +include/hyprtoolkit/palette/Palette.hpp.orig +include/hyprtoolkit/system/Icons.hpp +include/hyprtoolkit/types/FontTypes.hpp +include/hyprtoolkit/types/PointerShape.hpp +include/hyprtoolkit/types/SizeType.hpp +include/hyprtoolkit/window/Window.hpp +lib/libhyprtoolkit.so +lib/libhyprtoolkit.so.%%SOVERSION_MAJOR%% +lib/libhyprtoolkit.so.%%SOVERSION_FULL%% +libdata/pkgconfig/hyprtoolkit.pc |
