From nobody Tue Jun 25 09:26:11 2024 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4W7fb81JQgz5P9dg; Tue, 25 Jun 2024 09:26:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4W7fb80X5sz4Jqj; Tue, 25 Jun 2024 09:26:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719307572; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TUCM/I8U+hLiF/vlQtIHNuFPMpN3AgN5qgJq8c1gtjI=; b=Gnx4TXXFruuu4Bv0d7wsqtkzjZ7Gf7siSJZrSj13UDJFDtaADHJYm2b0udLSqYZp1mGTbe l2+Qbdq8ClQKbu+SDk/a+LHUFQlWT9mN7ZKtIQFxnjGjYoB3+TJwhSiuF4uLLkDB+rDkMQ wfj9Lw/YgomJTiaFZUvK2cC6YrMG+ybmCpeOqNzxFWXAQRE6X7xRsWh7nKI3t38bNxoEYz hs0WI2QmZmODD8DM4q39upXb8zGCNkYPBiJMucVdV06kIcSMkX4Zy81DhWwXmYXlUwpsCt jlr44mIgo2JbfRHpQx1ZnGvQhMY+/NpQw4/Fdt0HKkEBy7ZWiGG4xFLXkvw77A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1719307572; a=rsa-sha256; cv=none; b=UNFA5tjIJ5Iaa133OLJeL/v3jO6N4tSSk74dZsP7Hhtnf9Q+4W1URCdxfWkTrSh4dPvwGK Rc5lm9N6yxIaHADGrA+GCeCFwipnBwLl7+BJblVqEksE14owWXYMpmZUeKz0tlgYgzMrmg Z3Gq4vmRM3myNYpyAZ4hK6IdJ1yyXcpRac0LknBdLpuT9wBaS7yM3h+AjAVKvJxivtMHCd vWeOQZtqX0bBbc1V2wrUntZEc1B3nWKk9LRtAZfyPZmGgosv8gqYs4f9i9WUg4/astcMA7 KZ2hD3UN8n2Z4mjXx+pwPKanuByNCVppyr7HFbfVmmzQ77RIZFFsdD+rbZvhPw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719307572; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TUCM/I8U+hLiF/vlQtIHNuFPMpN3AgN5qgJq8c1gtjI=; b=R90hbU8AwWx9+x1lmpu3gK5vQYC0/IERGr0LPXcH4EUkaWXrF7JAX/0dqTDQGZRRCmtcR2 +EcGr7fRFMOwQDJOCOyflOsvADBN5cyfUx3iX3rQTp0uED7CpjyDfWeophanPDp+FdFVu1 p7amSI3s2A4jYNGIsisaADKPj0gYAjQDHcxxDBY8Kq59fCXr5atfeaR7OfKmEpsnSpEeW8 SZmQCHHR5ZPB97Ppn6szY97lDTQ4XrBY3UqceZQqNQ3cVE0/x2QXjqI205sUa2GesObIaX dGMxhmI/BcEA6NsctF8z9DCGs2NrIA+/OMVk6w4ME+v9w3OukPLSwEcXlyaHhQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4W7fb8078tzwp6; Tue, 25 Jun 2024 09:26:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 45P9QBqq094362; Tue, 25 Jun 2024 09:26:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 45P9QB4w094359; Tue, 25 Jun 2024 09:26:11 GMT (envelope-from git) Date: Tue, 25 Jun 2024 09:26:11 GMT Message-Id: <202406250926.45P9QB4w094359@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Yuri Victorovich Subject: git: a6ff9a773e09 - main - deskutils/normcap: update 0.5.4 =?utf-8?Q?=E2=86=92?= 0.5.8 List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-all@freebsd.org Sender: owner-dev-commits-ports-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: yuri X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a6ff9a773e0926b5fbb36c5fc94b855c6e3c59fa Auto-Submitted: auto-generated The branch main has been updated by yuri: URL: https://cgit.FreeBSD.org/ports/commit/?id=a6ff9a773e0926b5fbb36c5fc94b855c6e3c59fa commit a6ff9a773e0926b5fbb36c5fc94b855c6e3c59fa Author: Yuri Victorovich AuthorDate: 2024-06-25 07:58:10 +0000 Commit: Yuri Victorovich 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)