git: 70d529b486a8 - main - devel/py-inotify-simple: New port

From: Michael Gmelin <grembo_at_FreeBSD.org>
Date: Sun, 18 Feb 2024 11:45:48 UTC
The branch main has been updated by grembo:

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

commit 70d529b486a8e1a6e9ce3222d36cdebf808d3ca1
Author:     Michael Gmelin <grembo@FreeBSD.org>
AuthorDate: 2024-02-12 12:29:48 +0000
Commit:     Michael Gmelin <grembo@FreeBSD.org>
CommitDate: 2024-02-18 11:45:31 +0000

    devel/py-inotify-simple: New port
    
    Simple wrapper around inotify
---
 devel/Makefile                                     |  1 +
 devel/py-inotify-simple/Makefile                   | 22 ++++++++++++++++++++++
 devel/py-inotify-simple/distinfo                   |  3 +++
 .../files/patch-inotify__simple.py                 | 11 +++++++++++
 devel/py-inotify-simple/pkg-descr                  |  2 ++
 5 files changed, 39 insertions(+)

diff --git a/devel/Makefile b/devel/Makefile
index 85f5d0834ee4..d5d56f3dd325 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -4832,6 +4832,7 @@
     SUBDIR += py-iniconfig
     SUBDIR += py-inifile
     SUBDIR += py-iniparse
+    SUBDIR += py-inotify-simple
     SUBDIR += py-installer
     SUBDIR += py-intbitset
     SUBDIR += py-intelhex
diff --git a/devel/py-inotify-simple/Makefile b/devel/py-inotify-simple/Makefile
new file mode 100644
index 000000000000..8b558c4fd177
--- /dev/null
+++ b/devel/py-inotify-simple/Makefile
@@ -0,0 +1,22 @@
+PORTNAME=	inotify-simple
+PORTVERSION=	1.3.5
+CATEGORIES=	devel python
+MASTER_SITES=	PYPI
+PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
+DISTNAME=	${PORTNAME:S/-/_/}-${PORTVERSION}
+
+MAINTAINER=	grembo@FreeBSD.org
+COMMENT=	Simple wrapper around inotify
+WWW=		https://github.com/chrisjbillington/inotify_simple
+
+LICENSE=	BSD2CLAUSE
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+LIB_DEPENDS=	libinotify.so:devel/libinotify
+
+USES=		python
+USE_PYTHON=	autoplist distutils
+
+NO_ARCH=	yes
+
+.include <bsd.port.mk>
diff --git a/devel/py-inotify-simple/distinfo b/devel/py-inotify-simple/distinfo
new file mode 100644
index 000000000000..e783015aa211
--- /dev/null
+++ b/devel/py-inotify-simple/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1707611159
+SHA256 (inotify_simple-1.3.5.tar.gz) = 8440ffe49c4ae81a8df57c1ae1eb4b6bfa7acb830099bfb3e305b383005cc128
+SIZE (inotify_simple-1.3.5.tar.gz) = 9747
diff --git a/devel/py-inotify-simple/files/patch-inotify__simple.py b/devel/py-inotify-simple/files/patch-inotify__simple.py
new file mode 100644
index 000000000000..6f4492d46d69
--- /dev/null
+++ b/devel/py-inotify-simple/files/patch-inotify__simple.py
@@ -0,0 +1,11 @@
+--- inotify_simple.py.orig	2024-02-11 00:28:11 UTC
++++ inotify_simple.py
+@@ -82,7 +82,7 @@ class INotify(FileIO):
+                 manually with ``os.read(fd)``) to raise ``BlockingIOError`` if no data
+                 is available."""
+         try:
+-            libc_so = find_library('c')
++            libc_so = find_library('inotify')
+         except RuntimeError: # Python on Synology NASs raises a RuntimeError
+             libc_so = None
+         global _libc; _libc = _libc or CDLL(libc_so or 'libc.so.6', use_errno=True)
diff --git a/devel/py-inotify-simple/pkg-descr b/devel/py-inotify-simple/pkg-descr
new file mode 100644
index 000000000000..096712030194
--- /dev/null
+++ b/devel/py-inotify-simple/pkg-descr
@@ -0,0 +1,2 @@
+inotify_simple is a simple Python wrapper around inotify.
+No fancy bells and whistles, just a literal wrapper with ctypes.