git: f99755cf7cc4 - main - x11/py-caffeine-ng: update to 4.2.0

From: Hiroki Tagato <tagattie_at_FreeBSD.org>
Date: Tue, 16 Jan 2024 23:54:57 UTC
The branch main has been updated by tagattie:

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

commit f99755cf7cc473845f3141f009f775eef07457f3
Author:     Hiroki Tagato <tagattie@FreeBSD.org>
AuthorDate: 2024-01-16 23:52:44 +0000
Commit:     Hiroki Tagato <tagattie@FreeBSD.org>
CommitDate: 2024-01-16 23:54:47 +0000

    x11/py-caffeine-ng: update to 4.2.0
    
    While here:
    - delete test target since it is not offered by upstream anymore
    - make portclippy happy
    
    Changelog: https://codeberg.org/WhyNotHugo/caffeine-ng/src/tag/v4.2.0/CHANGELOG.rst
---
 x11/py-caffeine-ng/Makefile                    | 63 +++++++-----------
 x11/py-caffeine-ng/distinfo                    |  6 +-
 x11/py-caffeine-ng/files/patch-caffeine_cli.py |  4 +-
 x11/py-caffeine-ng/files/patch-setup.py        | 21 ------
 x11/py-caffeine-ng/pkg-plist                   | 90 ++++++++++++++++++++++++++
 5 files changed, 117 insertions(+), 67 deletions(-)

diff --git a/x11/py-caffeine-ng/Makefile b/x11/py-caffeine-ng/Makefile
index fcb5a0ba6ab4..472d745f1e92 100644
--- a/x11/py-caffeine-ng/Makefile
+++ b/x11/py-caffeine-ng/Makefile
@@ -1,8 +1,9 @@
 PORTNAME=	caffeine-ng
-DISTVERSION=	4.0.2
-PORTREVISION=	3
+DISTVERSIONPREFIX=	v
+DISTVERSION=	4.2.0
+DISTVERSIONSUFFIX=	-0-g5027f55
 CATEGORIES=	x11 python
-MASTER_SITES=	PYPI
+MASTER_SITES=	https://codeberg.org/WhyNotHugo/${PORTNAME}/releases/download/${DISTVERSIONPREFIX}${DISTVERSION}/
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
 
 MAINTAINER=	tagattie@FreeBSD.org
@@ -14,54 +15,34 @@ LICENSE_COMB=	multi
 LICENSE_FILE_GPLv3+ =	${WRKSRC}/LICENCE
 LICENSE_FILE_LGPL3+ =	${WRKSRC}/LGPL
 
-BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}setuptools_scm>0:devel/py-setuptools_scm@${PY_FLAVOR}
-LIB_DEPENDS=	libappindicator3.so:devel/libappindicator \
-		libnotify.so:devel/libnotify
-RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}click7>=7.1:devel/py-click7@${PY_FLAVOR} \
-		${PYTHON_PKGNAMEPREFIX}ewmh>=0.1.4:devel/py-ewmh@${PY_FLAVOR} \
-		${PYTHON_PKGNAMEPREFIX}xdg>=0.25:devel/py-xdg@${PY_FLAVOR} \
-		${PYTHON_PKGNAMEPREFIX}setproctitle>=1.1.10:devel/py-setproctitle@${PY_FLAVOR} \
-		${PYTHON_PKGNAMEPREFIX}wheel>=0.29.0:devel/py-wheel@${PY_FLAVOR} \
+PY_DEPENDS=	${PYTHON_PKGNAMEPREFIX}click>0:devel/py-click@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}dbus>0:devel/py-dbus@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}ewmh>0:devel/py-ewmh@${PY_FLAVOR} \
 		${PYTHON_PKGNAMEPREFIX}pulsectl>0:audio/py-pulsectl@${PY_FLAVOR} \
-		${PYTHON_PKGNAMEPREFIX}dbus>0:devel/py-dbus@${PY_FLAVOR}
-TEST_DEPENDS=	${PYTHON_PKGNAMEPREFIX}tox>0:devel/py-tox@${PY_FLAVOR} \
-		${PYTHON_PKGNAMEPREFIX}flake8>0:devel/py-flake8@${PY_FLAVOR} \
-		${PYTHON_PKGNAMEPREFIX}flake8-bugbear>0:devel/py-flake8-bugbear@${PY_FLAVOR} \
-		${PYTHON_PKGNAMEPREFIX}flake8-import-order>0:devel/py-flake8-import-order@${PY_FLAVOR}
+		${PYTHON_PKGNAMEPREFIX}setproctitle>0:devel/py-setproctitle@${PY_FLAVOR}
+BUILD_DEPENDS=	${PY_DEPENDS} \
+		scdoc:textproc/scdoc
+LIB_DEPENDS=	libayatana-appindicator3.so:devel/libayatana-appindicator \
+		libnotify.so:devel/libnotify
+RUN_DEPENDS=	${PY_DEPENDS}
 
-USES=		desktop-file-utils gettext-tools gnome python
+USES=		gettext-tools gnome meson pkgconfig python
 USE_GNOME=	gdkpixbuf2 gtk30 pygobject3
-USE_PYTHON=	autoplist distutils
+GLIB_SCHEMAS=	net.launchpad.caffeine.gschema.xml
 
+BINARY_ALIAS=	python3=${PYTHON_CMD}
 NO_ARCH=	yes
 
-GLIB_SCHEMAS=	net.launchpad.caffeine.gschema.xml
+PORTDOCS=	CHANGELOG.rst README.md
 
 OPTIONS_DEFINE=	DOCS
 
-PORTDOCS=	README.rst
-
-REINPLACE_ARGS=	-i ""
-
-SCHEMASDIR=	share/glib-2.0/schemas
-
 post-patch:
-	${REINPLACE_CMD} -e 's|/usr|${LOCALBASE}|g; s|/etc|${LOCALBASE}/etc|g' \
-		${WRKSRC}/setup.py
-
-post-install:
-	${MKDIR} ${STAGEDIR}${PREFIX}/${SCHEMASDIR}
-.for schema in ${GLIB_SCHEMAS}
-	${INSTALL_DATA} ${WRKSRC}/${SCHEMASDIR}/${schema} ${STAGEDIR}${PREFIX}/${SCHEMASDIR}
-.endfor
-
-post-install-DOCS-on:
-	${MKDIR} ${STAGEDIR}${DOCSDIR}
-.for doc in ${PORTDOCS}
-	${INSTALL_MAN} ${WRKSRC}/${doc} ${STAGEDIR}${DOCSDIR}
-.endfor
+	${REINPLACE_CMD} -e "s|/etc|${LOCALBASE}/etc|g; \
+		s|python.full_path()|'${PYTHON_CMD}'|g" ${WRKSRC}/meson.build
 
-do-test:
-	cd ${TEST_WRKSRC} && ${SETENV} ${TEST_ENV} ${PYTHON_CMD} -m tox
+do-install-DOCS-on:
+	@${MKDIR} ${STAGEDIR}${DOCSDIR}
+	${INSTALL_MAN} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR}
 
 .include <bsd.port.mk>
diff --git a/x11/py-caffeine-ng/distinfo b/x11/py-caffeine-ng/distinfo
index 54adb79da374..81a99aba7cc2 100644
--- a/x11/py-caffeine-ng/distinfo
+++ b/x11/py-caffeine-ng/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1658886222
-SHA256 (caffeine-ng-4.0.2.tar.gz) = ba62235c9d1eb7a3e2e448e3f7a43e66188a4beca3edbb206f8b905ba626eab5
-SIZE (caffeine-ng-4.0.2.tar.gz) = 163529
+TIMESTAMP = 1705404140
+SHA256 (caffeine-ng-v4.2.0-0-g5027f55.tar.gz) = 32727416837fa0a705e8aa76c966194f9bae8b1a897ffa62bf1fb7db7f374e2b
+SIZE (caffeine-ng-v4.2.0-0-g5027f55.tar.gz) = 131741
diff --git a/x11/py-caffeine-ng/files/patch-caffeine_cli.py b/x11/py-caffeine-ng/files/patch-caffeine_cli.py
index e6c094fd8474..09022ae28076 100644
--- a/x11/py-caffeine-ng/files/patch-caffeine_cli.py
+++ b/x11/py-caffeine-ng/files/patch-caffeine_cli.py
@@ -1,4 +1,4 @@
---- caffeine/cli.py.orig	2022-07-27 02:03:53 UTC
+--- caffeine/cli.py.orig	2023-03-09 15:23:08 UTC
 +++ caffeine/cli.py
 @@ -1,4 +1,4 @@
 -import ctypes
@@ -6,7 +6,7 @@
  import logging
  import signal
  
-@@ -20,8 +20,8 @@ def cli(ctx, verbose):
+@@ -21,8 +21,8 @@ def cli(ctx, verbose):
      signal.signal(signal.SIGINT, signal.SIG_DFL)
  
      # register the process id as 'caffeine'
diff --git a/x11/py-caffeine-ng/files/patch-setup.py b/x11/py-caffeine-ng/files/patch-setup.py
deleted file mode 100644
index 17f11f3fdc86..000000000000
--- a/x11/py-caffeine-ng/files/patch-setup.py
+++ /dev/null
@@ -1,21 +0,0 @@
---- setup.py.orig	2021-01-01 14:03:23 UTC
-+++ setup.py
-@@ -7,13 +7,16 @@ from setuptools import setup
- 
- 
- def get_data_files():
-+    # Let FreeBSD port handle glib schema file to avoid plist error
-+    black_list = ['net.launchpad.caffeine.gschema.xml']
-     data_files = []
- 
-     for path, _dirs, files in walk("share"):
-         target_path = os.path.join("/usr", path)
- 
--        if files:
--            data_files.append((target_path, [os.path.join(path, f) for f in files]))
-+        tl = [os.path.join(path, f) for f in files if f not in black_list]
-+        if tl:
-+            data_files.append((target_path, tl))
- 
-     # Install all icons for the package into /usr/share as well.
-     # This is because the .desktop file actually uses them too.
diff --git a/x11/py-caffeine-ng/pkg-plist b/x11/py-caffeine-ng/pkg-plist
new file mode 100644
index 000000000000..2f808aff496e
--- /dev/null
+++ b/x11/py-caffeine-ng/pkg-plist
@@ -0,0 +1,90 @@
+bin/caffeine
+etc/xdg/autostart/caffeine.desktop
+%%PYTHON_SITELIBDIR%%/caffeine/__init__.py
+%%PYTHON_SITELIBDIR%%/caffeine/__main__.py
+%%PYTHON_SITELIBDIR%%/caffeine/applicationinstance.py
+%%PYTHON_SITELIBDIR%%/caffeine/cli.py
+%%PYTHON_SITELIBDIR%%/caffeine/core.py
+%%PYTHON_SITELIBDIR%%/caffeine/icons.py
+%%PYTHON_SITELIBDIR%%/caffeine/inhibitors.py
+%%PYTHON_SITELIBDIR%%/caffeine/main.py
+%%PYTHON_SITELIBDIR%%/caffeine/paths.py
+%%PYTHON_SITELIBDIR%%/caffeine/procmanager.py
+%%PYTHON_SITELIBDIR%%/caffeine/triggers.py
+%%PYTHON_SITELIBDIR%%/caffeine/utils.py
+%%PYTHON_SITELIBDIR%%/caffeine/version.py
+share/applications/caffeine.desktop
+share/caffeine/glade/GUI.glade
+share/caffeine/glade/proc.glade
+share/caffeine/images/Empty_Cup.svg
+share/caffeine/images/Full_Cup.svg
+share/caffeine/images/application-x-executable.png
+share/icons/hicolor/16x16/apps/caffeine.png
+share/icons/hicolor/16x16/status/caffeine-cup-empty.png
+share/icons/hicolor/16x16/status/caffeine-cup-full.png
+share/icons/hicolor/22x22/apps/caffeine.png
+share/icons/hicolor/22x22/status/caffeine-cup-empty.png
+share/icons/hicolor/22x22/status/caffeine-cup-full.png
+share/icons/hicolor/24x24/apps/caffeine.png
+share/icons/hicolor/24x24/status/caffeine-cup-empty.png
+share/icons/hicolor/24x24/status/caffeine-cup-full.png
+share/icons/hicolor/32x32/apps/caffeine.png
+share/icons/hicolor/32x32/status/caffeine-cup-empty.png
+share/icons/hicolor/32x32/status/caffeine-cup-full.png
+share/icons/hicolor/48x48/apps/caffeine.png
+share/icons/hicolor/48x48/status/caffeine-cup-empty.png
+share/icons/hicolor/48x48/status/caffeine-cup-full.png
+share/icons/hicolor/scalable/apps/caffeine.svg
+share/icons/hicolor/scalable/status/caffeine-cup-empty.svg
+share/icons/hicolor/scalable/status/caffeine-cup-full.svg
+share/icons/ubuntu-mono-dark/status/16/caffeine-cup-empty.png
+share/icons/ubuntu-mono-dark/status/16/caffeine-cup-full.png
+share/icons/ubuntu-mono-dark/status/22/caffeine-cup-empty.png
+share/icons/ubuntu-mono-dark/status/22/caffeine-cup-full.png
+share/icons/ubuntu-mono-dark/status/24/caffeine-cup-empty.png
+share/icons/ubuntu-mono-dark/status/24/caffeine-cup-full.png
+share/icons/ubuntu-mono-dark/status/32/caffeine-cup-empty.png
+share/icons/ubuntu-mono-dark/status/32/caffeine-cup-full.png
+share/icons/ubuntu-mono-dark/status/48/caffeine-cup-empty.png
+share/icons/ubuntu-mono-dark/status/48/caffeine-cup-full.png
+share/icons/ubuntu-mono-dark/status/scalable/caffeine-cup-empty.svg
+share/icons/ubuntu-mono-dark/status/scalable/caffeine-cup-full.svg
+share/locale/ar/LC_MESSAGES/caffeine-ng.mo
+share/locale/be/LC_MESSAGES/caffeine-ng.mo
+share/locale/bg/LC_MESSAGES/caffeine-ng.mo
+share/locale/bs/LC_MESSAGES/caffeine-ng.mo
+share/locale/ca/LC_MESSAGES/caffeine-ng.mo
+share/locale/cs/LC_MESSAGES/caffeine-ng.mo
+share/locale/da/LC_MESSAGES/caffeine-ng.mo
+share/locale/de/LC_MESSAGES/caffeine-ng.mo
+share/locale/el/LC_MESSAGES/caffeine-ng.mo
+share/locale/en_GB/LC_MESSAGES/caffeine-ng.mo
+share/locale/eo/LC_MESSAGES/caffeine-ng.mo
+share/locale/es/LC_MESSAGES/caffeine-ng.mo
+share/locale/eu/LC_MESSAGES/caffeine-ng.mo
+share/locale/fi/LC_MESSAGES/caffeine-ng.mo
+share/locale/fr/LC_MESSAGES/caffeine-ng.mo
+share/locale/gl/LC_MESSAGES/caffeine-ng.mo
+share/locale/he/LC_MESSAGES/caffeine-ng.mo
+share/locale/hu/LC_MESSAGES/caffeine-ng.mo
+share/locale/it/LC_MESSAGES/caffeine-ng.mo
+share/locale/ja/LC_MESSAGES/caffeine-ng.mo
+share/locale/lt/LC_MESSAGES/caffeine-ng.mo
+share/locale/ms/LC_MESSAGES/caffeine-ng.mo
+share/locale/nl/LC_MESSAGES/caffeine-ng.mo
+share/locale/no/LC_MESSAGES/caffeine-ng.mo
+share/locale/pl/LC_MESSAGES/caffeine-ng.mo
+share/locale/pt/LC_MESSAGES/caffeine-ng.mo
+share/locale/pt_BR/LC_MESSAGES/caffeine-ng.mo
+share/locale/ro/LC_MESSAGES/caffeine-ng.mo
+share/locale/ru/LC_MESSAGES/caffeine-ng.mo
+share/locale/sk/LC_MESSAGES/caffeine-ng.mo
+share/locale/sv/LC_MESSAGES/caffeine-ng.mo
+share/locale/th/LC_MESSAGES/caffeine-ng.mo
+share/locale/tr/LC_MESSAGES/caffeine-ng.mo
+share/locale/uk/LC_MESSAGES/caffeine-ng.mo
+share/locale/vi/LC_MESSAGES/caffeine-ng.mo
+share/locale/xh/LC_MESSAGES/caffeine-ng.mo
+share/locale/zh_TW/LC_MESSAGES/caffeine-ng.mo
+share/man/man1/caffeine/caffeine.1.gz
+share/pixmaps/caffeine.png