git: a6ff9a773e09 - main - deskutils/normcap: update 0.5.4 → 0.5.8
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 25 Jun 2024 09:26:11 UTC
The branch main has been updated by yuri: URL: https://cgit.FreeBSD.org/ports/commit/?id=a6ff9a773e0926b5fbb36c5fc94b855c6e3c59fa commit a6ff9a773e0926b5fbb36c5fc94b855c6e3c59fa Author: Yuri Victorovich <yuri@FreeBSD.org> AuthorDate: 2024-06-25 07:58:10 +0000 Commit: Yuri Victorovich <yuri@FreeBSD.org> CommitDate: 2024-06-25 09:26:07 +0000 deskutils/normcap: update 0.5.4 → 0.5.8 Reported by: portscout --- deskutils/normcap/Makefile | 6 +-- deskutils/normcap/distinfo | 6 +-- .../patch-normcap_clipboard_handlers_xclip.py | 11 ++++++ .../files/patch-normcap_clipboard_handlers_xsel.py | 11 ++++++ .../files/patch-normcap_clipboard_system__info.py | 29 ++++++++++++++ .../files/patch-normcap_gui_notification.py | 11 ++++++ .../files/patch-normcap_gui_system__info.py | 11 ++++++ ...tch-normcap_screengrab_handlers_dbus__portal.py | 11 ++++++ .../patch-normcap_screengrab_handlers_grim.py | 11 ++++++ .../files/patch-normcap_screengrab_handlers_qt.py | 11 ++++++ .../files/patch-normcap_screengrab_permissions.py | 22 +++++------ .../files/patch-normcap_screengrab_system__info.py | 29 ++++++++++++++ ...tests__clipboard_test__handlers_test__pbcopy.py | 10 +++++ ...__clipboard_test__handlers_test__qtclipboard.py | 11 ++++++ ...tests__clipboard_test__handlers_test__windll.py | 11 ++++++ ...__clipboard_test__handlers_test__wlclipboard.py | 42 ++++++++++++++++++++ ..._tests__clipboard_test__handlers_test__xclip.py | 33 ++++++++++++++++ ...ch-tests_tests__clipboard_test__system__info.py | 31 +++++++++++++++ .../patch-tests_tests__gui_test__system__info.py | 10 +++++ ...screengrab_test__handlers_test__dbus__portal.py | 38 ++++++++++++++++++ .../patch-tests_tests__screengrab_test__main.py | 17 ++++++++ ...ch-tests_tests__screengrab_test__permissions.py | 46 ++++++++++++++++++++++ ...h-tests_tests__screengrab_test__system__info.py | 34 ++++++++++++++++ 23 files changed, 435 insertions(+), 17 deletions(-) diff --git a/deskutils/normcap/Makefile b/deskutils/normcap/Makefile index 85e07682b781..24e2de48b0b9 100644 --- a/deskutils/normcap/Makefile +++ b/deskutils/normcap/Makefile @@ -1,6 +1,6 @@ PORTNAME= normcap DISTVERSIONPREFIX= v -DISTVERSION= 0.5.4 +DISTVERSION= 0.5.8 CATEGORIES= deskutils MAINTAINER= yuri@FreeBSD.org @@ -13,13 +13,13 @@ BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}Babel>=2.12.1:devel/py-babel@${PY_FLAVOR} ${PYTHON_PKGNAMEPREFIX}hatchling>0:devel/py-hatchling@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}retry2>=0.9.5:devel/py-retry2@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}rope>=1.7.0:devel/py-rope@${PY_FLAVOR} \ - ${PYTHON_PKGNAMEPREFIX}shiboken6>=6.6.1:devel/shiboken6@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}toml>=0.10.2:textproc/py-toml@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}types-retry>=0.9.9.4:devel/py-types-retry@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}types-toml>=0.10.8.1:devel/py-types-toml@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}typing-extensions>=4.4.0:devel/py-typing-extensions@${PY_FLAVOR} RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}jeepney>=0.8.0:devel/py-jeepney@${PY_FLAVOR} \ - ${PYTHON_PKGNAMEPREFIX}pyside6>0:devel/pyside6@${PY_FLAVOR} + ${PYTHON_PKGNAMEPREFIX}pyside6>0:devel/pyside6@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}shiboken6>=6.6.1:devel/shiboken6@${PY_FLAVOR} USES= python USE_PYTHON= pep517 noflavors autoplist diff --git a/deskutils/normcap/distinfo b/deskutils/normcap/distinfo index 06eca95e63b6..d7567b21561e 100644 --- a/deskutils/normcap/distinfo +++ b/deskutils/normcap/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1705913895 -SHA256 (dynobo-normcap-v0.5.4_GH0.tar.gz) = e483d1fa1c2612b48d812811400b4b64c1d7ed9d7edd3971a0fb121ce8fcae74 -SIZE (dynobo-normcap-v0.5.4_GH0.tar.gz) = 92856129 +TIMESTAMP = 1719246369 +SHA256 (dynobo-normcap-v0.5.8_GH0.tar.gz) = 0d7a67954c45c8339c461eb612aadddb88328b0dfb847217641e1aeb52ae0e8a +SIZE (dynobo-normcap-v0.5.8_GH0.tar.gz) = 77328657 diff --git a/deskutils/normcap/files/patch-normcap_clipboard_handlers_xclip.py b/deskutils/normcap/files/patch-normcap_clipboard_handlers_xclip.py new file mode 100644 index 000000000000..dde1faccbd3f --- /dev/null +++ b/deskutils/normcap/files/patch-normcap_clipboard_handlers_xclip.py @@ -0,0 +1,11 @@ +--- normcap/clipboard/handlers/xclip.py.orig 2024-05-08 15:08:46 UTC ++++ normcap/clipboard/handlers/xclip.py +@@ -31,7 +31,7 @@ def is_compatible() -> bool: + + + def is_compatible() -> bool: +- if sys.platform != "linux": ++ if sys.platform != "linux" and sys.platform != "freebsd": + logger.debug("%s is not compatible on non-Linux systems", __name__) + return False + diff --git a/deskutils/normcap/files/patch-normcap_clipboard_handlers_xsel.py b/deskutils/normcap/files/patch-normcap_clipboard_handlers_xsel.py new file mode 100644 index 000000000000..c23afb068834 --- /dev/null +++ b/deskutils/normcap/files/patch-normcap_clipboard_handlers_xsel.py @@ -0,0 +1,11 @@ +--- normcap/clipboard/handlers/xsel.py.orig 2024-05-08 15:36:37 UTC ++++ normcap/clipboard/handlers/xsel.py +@@ -29,7 +29,7 @@ def is_compatible() -> bool: + + + def is_compatible() -> bool: +- if sys.platform != "linux": ++ if sys.platform != "linux" and sys.platform != "freebsd": + logger.debug("%s is not compatible on non-Linux systems", __name__) + return False + diff --git a/deskutils/normcap/files/patch-normcap_clipboard_system__info.py b/deskutils/normcap/files/patch-normcap_clipboard_system__info.py new file mode 100644 index 000000000000..0a73c85e82f2 --- /dev/null +++ b/deskutils/normcap/files/patch-normcap_clipboard_system__info.py @@ -0,0 +1,29 @@ +--- normcap/clipboard/system_info.py.orig 2024-05-07 18:10:18 UTC ++++ normcap/clipboard/system_info.py +@@ -10,7 +10,7 @@ def os_has_wayland_display_manager() -> bool: + + + def os_has_wayland_display_manager() -> bool: +- if sys.platform != "linux": ++ if sys.platform != "linux" and sys.platform != "freebsd": + return False + + xdg_session_type = os.environ.get("XDG_SESSION_TYPE", "").lower() +@@ -19,7 +19,7 @@ def os_has_awesome_wm() -> bool: + + + def os_has_awesome_wm() -> bool: +- if sys.platform != "linux": ++ if sys.platform != "linux" and sys.platform != "freebsd": + return False + + return "awesome" in os.environ.get("XDG_CURRENT_DESKTOP", "").lower() +@@ -36,7 +36,7 @@ def get_gnome_version() -> str: + Returns: + Version string or empty string if not detected. + """ +- if sys.platform != "linux": ++ if sys.platform != "linux" and sys.platform != "freebsd": + return "" + + if ( diff --git a/deskutils/normcap/files/patch-normcap_gui_notification.py b/deskutils/normcap/files/patch-normcap_gui_notification.py new file mode 100644 index 000000000000..7fd10e540dd5 --- /dev/null +++ b/deskutils/normcap/files/patch-normcap_gui_notification.py @@ -0,0 +1,11 @@ +--- normcap/gui/notification.py.orig 2024-05-08 15:11:11 UTC ++++ normcap/gui/notification.py +@@ -103,7 +103,7 @@ class Notifier(QtCore.QObject): + def _send_notification(self, capture: Capture) -> None: + """Show tray icon then send notification.""" + title, message = self._compose_notification(capture) +- if sys.platform == "linux" and shutil.which("notify-send"): ++ if (sys.platform == "linux" or sys.platform == "freebsd") and shutil.which("notify-send"): + self._send_via_libnotify(title=title, message=message) + else: + self._send_via_qt_tray( diff --git a/deskutils/normcap/files/patch-normcap_gui_system__info.py b/deskutils/normcap/files/patch-normcap_gui_system__info.py new file mode 100644 index 000000000000..7bf58e334260 --- /dev/null +++ b/deskutils/normcap/files/patch-normcap_gui_system__info.py @@ -0,0 +1,11 @@ +--- normcap/gui/system_info.py.orig 2024-05-08 15:35:35 UTC ++++ normcap/gui/system_info.py +@@ -73,7 +73,7 @@ def get_tesseract_path() -> Path: + RuntimeError: If the Tesseract binary cannot be located. + """ + if is_briefcase_package(): +- if sys.platform == "linux": ++ if sys.platform == "linux" or sys.platform == "freebsd": + binary_path = Path(__file__).parent.parent.parent.parent / "bin" + elif sys.platform == "win32": + binary_path = Path(__file__).parent.parent / "resources" / "tesseract" diff --git a/deskutils/normcap/files/patch-normcap_screengrab_handlers_dbus__portal.py b/deskutils/normcap/files/patch-normcap_screengrab_handlers_dbus__portal.py new file mode 100644 index 000000000000..457905305046 --- /dev/null +++ b/deskutils/normcap/files/patch-normcap_screengrab_handlers_dbus__portal.py @@ -0,0 +1,11 @@ +--- normcap/screengrab/handlers/dbus_portal.py.orig 2024-05-19 21:44:57 UTC ++++ normcap/screengrab/handlers/dbus_portal.py +@@ -216,7 +216,7 @@ def is_compatible() -> bool: + + def is_compatible() -> bool: + # TODO: Specify closer! +- return sys.platform == "linux" ++ return sys.platform == "linux" or sys.platform == "freebsd" + + + def is_installed() -> bool: diff --git a/deskutils/normcap/files/patch-normcap_screengrab_handlers_grim.py b/deskutils/normcap/files/patch-normcap_screengrab_handlers_grim.py new file mode 100644 index 000000000000..bcc3946dafa4 --- /dev/null +++ b/deskutils/normcap/files/patch-normcap_screengrab_handlers_grim.py @@ -0,0 +1,11 @@ +--- normcap/screengrab/handlers/grim.py.orig 2024-05-08 15:26:52 UTC ++++ normcap/screengrab/handlers/grim.py +@@ -17,7 +17,7 @@ def is_compatible() -> bool: + + def is_compatible() -> bool: + return ( +- sys.platform == "linux" ++ (sys.platform == "linux" or sys.platform == "freebsd") + and system_info.has_wayland_display_manager() + and system_info.has_wlroots_compositor() + ) diff --git a/deskutils/normcap/files/patch-normcap_screengrab_handlers_qt.py b/deskutils/normcap/files/patch-normcap_screengrab_handlers_qt.py new file mode 100644 index 000000000000..b0816db50dc6 --- /dev/null +++ b/deskutils/normcap/files/patch-normcap_screengrab_handlers_qt.py @@ -0,0 +1,11 @@ +--- normcap/screengrab/handlers/qt.py.orig 2024-05-08 15:30:01 UTC ++++ normcap/screengrab/handlers/qt.py +@@ -11,7 +11,7 @@ def is_compatible() -> bool: + + + def is_compatible() -> bool: +- return sys.platform != "linux" or not system_info.has_wayland_display_manager() ++ return (sys.platform != "linux" and sys.platform != "freebsd") or not system_info.has_wayland_display_manager() + + + def is_installed() -> bool: diff --git a/deskutils/normcap/files/patch-normcap_screengrab_permissions.py b/deskutils/normcap/files/patch-normcap_screengrab_permissions.py index 8da592601bb7..1d15b7eec29c 100644 --- a/deskutils/normcap/files/patch-normcap_screengrab_permissions.py +++ b/deskutils/normcap/files/patch-normcap_screengrab_permissions.py @@ -1,31 +1,31 @@ ---- normcap/screengrab/permissions.py.orig 2024-01-22 09:18:58 UTC +--- normcap/screengrab/permissions.py.orig 2024-05-19 21:44:57 UTC +++ normcap/screengrab/permissions.py -@@ -225,9 +225,9 @@ def has_screenshot_permission() -> bool: +@@ -222,9 +222,9 @@ def has_screenshot_permission() -> bool: logger.debug("Checking screenshot permission") if sys.platform == "darwin": return _macos_has_screenshot_permission() -- if sys.platform == "linux" and not utils.is_wayland_display_manager(): -+ if (sys.platform == "linux" or sys.platform.startswith("freebsd")) and not utils.is_wayland_display_manager(): +- if sys.platform == "linux" and not system_info.has_wayland_display_manager(): ++ if (sys.platform == "linux" or sys.platform.startswith("freebsd")) and not system_info.has_wayland_display_manager(): return True -- if sys.platform == "linux" and utils.is_wayland_display_manager(): -+ if (sys.platform == "linux" or sys.platform.startswith("freebsd")) and utils.is_wayland_display_manager(): +- if sys.platform == "linux" and system_info.has_wayland_display_manager(): ++ if (sys.platform == "linux" or sys.platform.startswith("freebsd")) and system_info.has_wayland_display_manager(): return _dbus_portal_has_screenshot_permission() if sys.platform == "win32": return True -@@ -245,14 +245,14 @@ def request_screenshot_permission( +@@ -242,14 +242,14 @@ def request_screenshot_permission( ) return -- if sys.platform == "linux" and not utils.is_wayland_display_manager(): -+ if (sys.platform == "linux" or sys.platform.startswith("freebsd")) and not utils.is_wayland_display_manager(): +- if sys.platform == "linux" and not system_info.has_wayland_display_manager(): ++ if (sys.platform == "linux" or sys.platform.startswith("freebsd")) and not system_info.has_wayland_display_manager(): logger.debug( "Not necessary to request screenshot permission on Linux, if the " "display manager is not Wayland. Skipping." ) return -- if sys.platform == "linux" and utils.is_wayland_display_manager(): -+ if (sys.platform == "linux" or sys.platform.startswith("freebsd")) and utils.is_wayland_display_manager(): +- if sys.platform == "linux" and system_info.has_wayland_display_manager(): ++ if (sys.platform == "linux" or sys.platform.startswith("freebsd")) and system_info.has_wayland_display_manager(): logger.debug("Show request permission dialog.") dbus_portal_show_request_permission_dialog( title=dialog_title, text=linux_dialog_text diff --git a/deskutils/normcap/files/patch-normcap_screengrab_system__info.py b/deskutils/normcap/files/patch-normcap_screengrab_system__info.py new file mode 100644 index 000000000000..c36e731eddff --- /dev/null +++ b/deskutils/normcap/files/patch-normcap_screengrab_system__info.py @@ -0,0 +1,29 @@ +--- normcap/screengrab/system_info.py.orig 2024-05-08 15:07:15 UTC ++++ normcap/screengrab/system_info.py +@@ -15,7 +15,7 @@ def has_wlroots_compositor() -> bool: + Certainly not wlroots based are: KDE, GNOME and Unity. + Others are likely wlroots based. + """ +- if sys.platform != "linux": ++ if sys.platform != "linux" and sys.platform != "freebsd": + return False + + kde_full_session = os.environ.get("KDE_FULL_SESSION", "").lower() +@@ -39,7 +39,7 @@ def has_wayland_display_manager() -> bool: + + def has_wayland_display_manager() -> bool: + """Identify relevant display managers (Linux).""" +- if sys.platform != "linux": ++ if sys.platform != "linux" and sys.platform != "freebsd": + return False + + xdg_session_type = os.environ.get("XDG_SESSION_TYPE", "").lower() +@@ -54,7 +54,7 @@ def get_gnome_version() -> str: + Returns: + Version string or empty string if not detected. + """ +- if sys.platform != "linux": ++ if sys.platform != "linux" and sys.platform != "freebsd": + return "" + + if ( diff --git a/deskutils/normcap/files/patch-tests_tests__clipboard_test__handlers_test__pbcopy.py b/deskutils/normcap/files/patch-tests_tests__clipboard_test__handlers_test__pbcopy.py new file mode 100644 index 000000000000..b32aa217613d --- /dev/null +++ b/deskutils/normcap/files/patch-tests_tests__clipboard_test__handlers_test__pbcopy.py @@ -0,0 +1,10 @@ +--- tests/tests_clipboard/test_handlers/test_pbcopy.py.orig 2024-05-08 15:30:34 UTC ++++ tests/tests_clipboard/test_handlers/test_pbcopy.py +@@ -13,6 +13,7 @@ from normcap.clipboard.handlers import pbcopy + ("darwin", True), + ("win32", False), + ("linux", False), ++ ("freebsd", False), + ], + ) + def test_pbcopy_is_compatible(monkeypatch, platform, result): diff --git a/deskutils/normcap/files/patch-tests_tests__clipboard_test__handlers_test__qtclipboard.py b/deskutils/normcap/files/patch-tests_tests__clipboard_test__handlers_test__qtclipboard.py new file mode 100644 index 000000000000..b0f010c406e1 --- /dev/null +++ b/deskutils/normcap/files/patch-tests_tests__clipboard_test__handlers_test__qtclipboard.py @@ -0,0 +1,11 @@ +--- tests/tests_clipboard/test_handlers/test_qtclipboard.py.orig 2024-05-08 15:38:08 UTC ++++ tests/tests_clipboard/test_handlers/test_qtclipboard.py +@@ -18,6 +18,8 @@ real_import = builtins.__import__ + ("win32", "wayland", True), + ("linux", "", True), + ("linux", "wayland", False), ++ ("freebsd", "", True), ++ ("freebsd", "wayland", False), + ], + ) + def test_qtclipboard_is_compatible(monkeypatch, platform, wayland_display, result): diff --git a/deskutils/normcap/files/patch-tests_tests__clipboard_test__handlers_test__windll.py b/deskutils/normcap/files/patch-tests_tests__clipboard_test__handlers_test__windll.py new file mode 100644 index 000000000000..3dfb95a83b04 --- /dev/null +++ b/deskutils/normcap/files/patch-tests_tests__clipboard_test__handlers_test__windll.py @@ -0,0 +1,11 @@ +--- tests/tests_clipboard/test_handlers/test_windll.py.orig 2024-05-08 15:34:16 UTC ++++ tests/tests_clipboard/test_handlers/test_windll.py +@@ -29,7 +29,7 @@ def clipboard_blocked(): + + + @pytest.mark.parametrize( +- ("platform", "result"), [("win32", True), ("darwin", False), ("linux", False)] ++ ("platform", "result"), [("win32", True), ("darwin", False), ("linux", False), ("freebsd", False)] + ) + def test_windll_is_compatible(monkeypatch, platform, result): + monkeypatch.setattr(windll.sys, "platform", platform) diff --git a/deskutils/normcap/files/patch-tests_tests__clipboard_test__handlers_test__wlclipboard.py b/deskutils/normcap/files/patch-tests_tests__clipboard_test__handlers_test__wlclipboard.py new file mode 100644 index 000000000000..78017e972f15 --- /dev/null +++ b/deskutils/normcap/files/patch-tests_tests__clipboard_test__handlers_test__wlclipboard.py @@ -0,0 +1,42 @@ +--- tests/tests_clipboard/test_handlers/test_wlclipboard.py.orig 2024-05-07 18:10:18 UTC ++++ tests/tests_clipboard/test_handlers/test_wlclipboard.py +@@ -18,6 +18,12 @@ from normcap.clipboard.handlers import wlclipboard + ("linux", "Wayland", "Gnome Wayland", "45.1", False), + ("linux", "", "Gnome Shell", "44", False), + ("linux", "", "", "44", False), ++ ("freebsd", "Wayland", "", "44", True), ++ ("freebsd", "", "Gnome Wayland", "44", True), ++ ("freebsd", "Wayland", "Gnome Wayland", "44", True), ++ ("freebsd", "Wayland", "Gnome Wayland", "45.1", False), ++ ("freebsd", "", "Gnome Shell", "44", False), ++ ("freebsd", "", "", "44", False), + ("win32", "Wayland", "Gnome Wayland", "", False), + ("darwin", "Wayland", "Gnome Wayland", "", False), + ], +@@ -38,6 +44,8 @@ def test_wlcopy_is_compatible( + [ + ("linux", True, True), + ("linux", False, False), ++ ("freebsd", True, True), ++ ("freebsd", False, False), + ], + ) + def test_wlcopy_is_installed(platform, has_wlcopy, result, monkeypatch): +@@ -53,7 +61,7 @@ def test_wlcopy_is_installed(platform, has_wlcopy, res + # see https://github.com/bugaevc/wl-clipboard/issues/168 + @pytest.mark.skipif(True, reason="Buggy in Gnome 45") + @pytest.mark.skipif(not shutil.which("wl-copy"), reason="Needs wl-copy") +-@pytest.mark.skipif(sys.platform != "linux", reason="Linux specific test") ++@pytest.mark.skipif(sys.platform != "linux" and sys.platform != "freebsd", reason="Linux specific test") + def test_wlcopy_copy(): + text = f"this is a unique test {uuid.uuid4()}" + +@@ -70,7 +78,7 @@ def test_wlcopy_copy(): + + + @pytest.mark.skipif(True, reason="Buggy in Gnome 45") +-@pytest.mark.skipif(sys.platform == "linux", reason="Non-Linux specific test") ++@pytest.mark.skipif(sys.platform == "linux" or sys.platform == "freebsd", reason="Non-Linux specific test") + def test_wlcopy_copy_on_non_linux(): + with pytest.raises((FileNotFoundError, OSError)): + wlclipboard.copy(text="this is a test") diff --git a/deskutils/normcap/files/patch-tests_tests__clipboard_test__handlers_test__xclip.py b/deskutils/normcap/files/patch-tests_tests__clipboard_test__handlers_test__xclip.py new file mode 100644 index 000000000000..05ea011ce0c5 --- /dev/null +++ b/deskutils/normcap/files/patch-tests_tests__clipboard_test__handlers_test__xclip.py @@ -0,0 +1,33 @@ +--- tests/tests_clipboard/test_handlers/test_xclip.py.orig 2024-05-08 15:16:58 UTC ++++ tests/tests_clipboard/test_handlers/test_xclip.py +@@ -18,6 +18,12 @@ from normcap.clipboard.handlers import xclip + ("linux", "", "Gnome Shell", True, True), + ("linux", "", "", True, True), + ("linux", "Wayland", "Gnome Wayland", False, True), ++ ("freebsd", "Wayland", "", True, True), ++ ("freebsd", "", "Gnome Wayland", True, True), ++ ("freebsd", "Wayland", "Gnome Wayland", True, True), ++ ("freebsd", "", "Gnome Shell", True, True), ++ ("freebsd", "", "", True, True), ++ ("freebsd", "Wayland", "Gnome Wayland", False, True), + ("win32", "Wayland", "Gnome Shell", False, False), + ("win32", "Wayland", "Gnome Wayland", True, False), + ("darwin", "Wayland", "Gnome Wayland", True, False), +@@ -38,7 +44,7 @@ def test_xclip_is_compatible( + + + @pytest.mark.skipif(not shutil.which("xclip"), reason="Needs xclip") +-@pytest.mark.skipif(sys.platform != "linux", reason="Linux specific test") ++@pytest.mark.skipif(sys.platform != "linux" and sys.platform != "freebsd", reason="Linux specific test") + def test_xclip_copy(): + text = f"this is a unique test {uuid.uuid4()}" + +@@ -54,7 +60,7 @@ def test_xclip_copy(): + assert text == clipped + + +-@pytest.mark.skipif(sys.platform == "linux", reason="Non-Linux specific test") ++@pytest.mark.skipif(sys.platform == "linux" or sys.platform == "freebsd", reason="Non-Linux specific test") + def test_xclip_copy_on_non_linux(): + with pytest.raises((FileNotFoundError, OSError)): + xclip.copy(text="this is a test") diff --git a/deskutils/normcap/files/patch-tests_tests__clipboard_test__system__info.py b/deskutils/normcap/files/patch-tests_tests__clipboard_test__system__info.py new file mode 100644 index 000000000000..2b83a6dacf2e --- /dev/null +++ b/deskutils/normcap/files/patch-tests_tests__clipboard_test__system__info.py @@ -0,0 +1,31 @@ +--- tests/tests_clipboard/test_system_info.py.orig 2024-05-07 18:10:18 UTC ++++ tests/tests_clipboard/test_system_info.py +@@ -10,6 +10,10 @@ from normcap.clipboard import system_info + ("wayland", "", "linux", True), + ("", "wayland", "linux", True), + ("", "", "linux", False), ++ ("wayland", "wayland", "freebsd", True), ++ ("wayland", "", "freebsd", True), ++ ("", "wayland", "freebsd", True), ++ ("", "", "freebsd", False), + ("wayland", "wayland", "win32", False), + ("wayland", "wayland", "darwin", False), + ], +@@ -29,6 +33,8 @@ def test_os_has_wayland_display_manager( + [ + ("linux", "awesome", True), + ("linux", "gnome", False), ++ ("freebsd", "awesome", True), ++ ("freebsd", "gnome", False), + ("win32", "awesome", False), + ("darwin", "awesome", False), + ], +@@ -45,6 +51,8 @@ def test_os_has_awesome_wm(monkeypatch, platform, desk + [ + ("linux", "gnome", "gnome", "/usr/bin/gnome-shell", "33.3.0"), + ("linux", "kde", "", "/usr/bin/gnome-shell", ""), ++ ("freebsd", "gnome", "gnome", "/usr/local/bin/gnome-shell", "33.3.0"), ++ ("freebsd", "kde", "", "/usr/local/bin/gnome-shell", ""), + ("darwin", "", "", "", ""), + ("darwin", "", "", "/usr/bin/gnome-shell", ""), + ("win32", "", "", "", ""), diff --git a/deskutils/normcap/files/patch-tests_tests__gui_test__system__info.py b/deskutils/normcap/files/patch-tests_tests__gui_test__system__info.py new file mode 100644 index 000000000000..00e8babebc90 --- /dev/null +++ b/deskutils/normcap/files/patch-tests_tests__gui_test__system__info.py @@ -0,0 +1,10 @@ +--- tests/tests_gui/test_system_info.py.orig 2024-05-08 15:32:00 UTC ++++ tests/tests_gui/test_system_info.py +@@ -188,6 +188,7 @@ def test_config_directory_fallback(monkeypatch): + ("platform", "binary", "directory"), + [ + ("linux", "tesseract", "bin"), ++ ("freebsd", "tesseract", "bin"), + ("win32", "tesseract.exe", "tesseract"), + ("darwin", "tesseract", "bin"), + ], diff --git a/deskutils/normcap/files/patch-tests_tests__screengrab_test__handlers_test__dbus__portal.py b/deskutils/normcap/files/patch-tests_tests__screengrab_test__handlers_test__dbus__portal.py new file mode 100644 index 000000000000..103ce17e425e --- /dev/null +++ b/deskutils/normcap/files/patch-tests_tests__screengrab_test__handlers_test__dbus__portal.py @@ -0,0 +1,38 @@ +--- tests/tests_screengrab/test_handlers/test_dbus_portal.py.orig 2024-05-08 15:04:22 UTC ++++ tests/tests_screengrab/test_handlers/test_dbus_portal.py +@@ -8,7 +8,7 @@ from normcap.screengrab.permissions import has_screens + + + @pytest.mark.gui() +-@pytest.mark.skipif(sys.platform != "linux", reason="Linux specific test") ++@pytest.mark.skipif((sys.platform != "linux" and sys.platform != "freebsd"), reason="Linux specific test") + @pytest.mark.skipif("GITHUB_ACTIONS" in os.environ, reason="Skip on Action Runner") + def test_synchronized_capture(dbus_portal, qapp): + if not has_screenshot_permission(): +@@ -20,7 +20,7 @@ def test_synchronized_capture(dbus_portal, qapp): + + + @pytest.mark.gui() +-@pytest.mark.skipif(sys.platform != "linux", reason="Linux specific test") ++@pytest.mark.skipif((sys.platform != "linux" and sys.platform != "freebsd"), reason="Linux specific test") + def test_synchronized_capture_triggers_request_error(monkeypatch, dbus_portal): + def _mocked_interface_call(*args): + return dbus_portal.QtDBus.QDBusMessage() +@@ -33,7 +33,7 @@ def test_synchronized_capture_triggers_request_error(m + + + @pytest.mark.gui() +-@pytest.mark.skipif(sys.platform != "linux", reason="Linux specific test") ++@pytest.mark.skipif((sys.platform != "linux" and sys.platform != "freebsd"), reason="Linux specific test") + @pytest.mark.skipif("GITHUB_ACTIONS" in os.environ, reason="Skip on Action Runner") + def test_synchronized_capture_triggers_response_error(monkeypatch, dbus_portal): + def _decorated_got_signal(method): +@@ -55,7 +55,7 @@ def test_synchronized_capture_triggers_response_error( + + + @pytest.mark.gui() +-@pytest.mark.skipif(sys.platform != "linux", reason="Linux specific test") ++@pytest.mark.skipif((sys.platform != "linux" and sys.platform != "freebsd"), reason="Linux specific test") + def test_synchronized_capture_triggers_timeout(monkeypatch, dbus_portal): + timeout = 1 + monkeypatch.setattr(dbus_portal, "TIMEOUT_SECONDS", timeout) diff --git a/deskutils/normcap/files/patch-tests_tests__screengrab_test__main.py b/deskutils/normcap/files/patch-tests_tests__screengrab_test__main.py new file mode 100644 index 000000000000..83c829083a5c --- /dev/null +++ b/deskutils/normcap/files/patch-tests_tests__screengrab_test__main.py @@ -0,0 +1,17 @@ +--- tests/tests_screengrab/test_main.py.orig 2024-05-08 15:24:40 UTC ++++ tests/tests_screengrab/test_main.py +@@ -39,6 +39,14 @@ def test_capture(qapp): + ("linux", "41.0", False, False, False, Handler.QT), + ("linux", "40.0", True, False, False, Handler.DBUS_SHELL), + ("linux", "40.0", False, False, False, Handler.QT), ++ ("freebsd", "", False, True, True, Handler.QT), ++ ("freebsd", "", True, True, True, Handler.GRIM), ++ ("freebsd", "", True, False, True, Handler.DBUS_PORTAL), ++ ("freebsd", "", True, False, False, Handler.DBUS_PORTAL), ++ ("freebsd", "41.0", True, False, False, Handler.DBUS_PORTAL), ++ ("freebsd", "41.0", False, False, False, Handler.QT), ++ ("freebsd", "40.0", True, False, False, Handler.DBUS_SHELL), ++ ("freebsd", "40.0", False, False, False, Handler.QT), + ], + ) + def test_get_available_handlers( diff --git a/deskutils/normcap/files/patch-tests_tests__screengrab_test__permissions.py b/deskutils/normcap/files/patch-tests_tests__screengrab_test__permissions.py new file mode 100644 index 000000000000..e1ee4bce391e --- /dev/null +++ b/deskutils/normcap/files/patch-tests_tests__screengrab_test__permissions.py @@ -0,0 +1,46 @@ +--- tests/tests_screengrab/test_permissions.py.orig 2024-05-08 15:23:15 UTC ++++ tests/tests_screengrab/test_permissions.py +@@ -7,7 +7,7 @@ from normcap.screengrab import permissions + from normcap.screengrab import permissions + + +-@pytest.mark.skipif(sys.platform in {"win32", "linux"}, reason="macOS specific test") ++@pytest.mark.skipif(sys.platform in {"win32", "linux", "freebsd"}, reason="macOS specific test") + def test_macos_has_screenshot_permission(caplog): + with caplog.at_level(logging.WARNING): + result = permissions._macos_has_screenshot_permission() +@@ -22,7 +22,7 @@ def test_macos_has_screenshot_permission_on_non_macos( + assert result is True + + +-@pytest.mark.skipif(sys.platform in {"win32", "linux"}, reason="macOS specific test") ++@pytest.mark.skipif(sys.platform in {"win32", "linux", "freebsd"}, reason="macOS specific test") + def test_macos_request_screenshot_permission(caplog): + with caplog.at_level(logging.DEBUG): + permissions._macos_request_screenshot_permission() +@@ -36,7 +36,7 @@ def test_macos_request_screenshot_permission_on_non_ma + assert "couldn't request" in caplog.text.lower() + + +-@pytest.mark.skipif(sys.platform in {"win32", "linux"}, reason="macOS specific test") ++@pytest.mark.skipif(sys.platform in {"win32", "linux", "freebsd"}, reason="macOS specific test") + def test_macos_reset_screenshot_permission(caplog): + with caplog.at_level(logging.ERROR): + permissions.macos_reset_screenshot_permission() +@@ -72,14 +72,14 @@ def test_has_screenshot_permission_raises(monkeypatch, + _ = permissions.has_screenshot_permission() + + +-@pytest.mark.skipif(sys.platform in {"win32", "linux"}, reason="macOS specific test") ++@pytest.mark.skipif(sys.platform in {"win32", "linux", "freebsd"}, reason="macOS specific test") + def test_macos_open_privacy_settings(caplog): + with caplog.at_level(logging.ERROR): + permissions._macos_open_privacy_settings() + assert "couldn't open" not in caplog.text.lower() + + +-@pytest.mark.skipif(sys.platform in {"win32", "linux"}, reason="macOS specific test") ++@pytest.mark.skipif(sys.platform in {"win32", "linux", "freebsd"}, reason="macOS specific test") + def test_macos_open_privacy_settings_logs_exception(monkeypatch, caplog): + def mocked_run(*_, **__): + raise ValueError("Mocked exception on 'open' call") diff --git a/deskutils/normcap/files/patch-tests_tests__screengrab_test__system__info.py b/deskutils/normcap/files/patch-tests_tests__screengrab_test__system__info.py new file mode 100644 index 000000000000..cea0aa502755 --- /dev/null +++ b/deskutils/normcap/files/patch-tests_tests__screengrab_test__system__info.py @@ -0,0 +1,34 @@ +--- tests/tests_screengrab/test_system_info.py.orig 2024-05-08 15:20:50 UTC ++++ tests/tests_screengrab/test_system_info.py +@@ -10,6 +10,7 @@ def test_display_manager_is_wayland_on_windows(monkeyp + assert is_wayland is False + + ++@pytest.mark.skipif(sys.platform not in {"linux", "freebsd"}, reason="Linux/FreeBSD specific test") + def test_display_manager_is_wayland_on_linux_xdg_session_type(monkeypatch): + monkeypatch.setattr(system_info.sys, "platform", "linux") + +@@ -35,6 +36,7 @@ def test_gnome_version_on_windows(monkeypatch): + assert not version + + ++@pytest.mark.skipif(sys.platform not in {"linux", "freebsd"}, reason="Linux/FreeBSD specific test") + def test_gnome_version_on_linux_from_cmd(monkeypatch): + monkeypatch.setattr(system_info.sys, "platform", "linux") + monkeypatch.setenv("GNOME_DESKTOP_SESSION_ID", "") +@@ -55,6 +57,7 @@ def test_gnome_version_on_linux_from_cmd(monkeypatch): + assert str(version) == "33.3" + + ++@pytest.mark.skipif(sys.platform not in {"linux", "freebsd"}, reason="Linux/FreeBSD specific test") + def test_gnome_version_on_linux_without_gnome_shell(monkeypatch): + monkeypatch.setattr(system_info.sys, "platform", "linux") + monkeypatch.setenv("GNOME_DESKTOP_SESSION_ID", "") +@@ -70,6 +73,7 @@ def test_gnome_version_on_linux_without_gnome_shell(mo + assert not version + + ++@pytest.mark.skipif(sys.platform not in {"linux", "freebsd"}, reason="Linux/FreeBSD specific test") + def test_gnome_version_on_linux_unknown_exception(monkeypatch, caplog): + monkeypatch.setattr(system_info.sys, "platform", "linux") + monkeypatch.setattr(system_info.shutil, "which", lambda _: True)