import py-pynotify-0.9.6

inotify functionality allows you to register one or more directories for
watching, and to simply block and wait for notification events.

ok aja@
This commit is contained in:
jasper 2018-01-24 18:06:34 +00:00
parent b171c396ce
commit 680ba71df7
7 changed files with 112 additions and 0 deletions

View File

@ -0,0 +1,32 @@
# $OpenBSD: Makefile,v 1.1.1.1 2018/01/24 18:06:34 jasper Exp $
COMMENT = filesystem events monitoring
MODPY_EGG_VERSION = 0.9.6
DISTNAME = pyinotify-${MODPY_EGG_VERSION}
PKGNAME = py-${DISTNAME}
CATEGORIES = devel
HOMEPAGE = https://github.com/seb-m/pyinotify
MAINTAINER = Jasper Lievisse Adriaanse <jasper@openbsd.org>
# MIT
PERMIT_PACKAGE_CDROM = Yes
WANTLIB = pthread ${MODPY_WANTLIB} lib/inotify/inotify
LIB_DEPENDS = devel/libinotify
MODULES = lang/python
MODPY_PI = Yes
MODPY_SETUPTOOLS = Yes
FLAVORS = python3
FLAVOR ?=
pre-configure:
${SUBST_CMD} ${WRKSRC}/setup.py ${WRKSRC}/python*/pyinotify.py
.include <bsd.port.mk>

View File

@ -0,0 +1,2 @@
SHA256 (pyinotify-0.9.6.tar.gz) = nJmKXXYGyoNQZc2rwBOubGbrnqdqAKHjvG4M/itPcfQ=
SIZE (pyinotify-0.9.6.tar.gz) = 60998

View File

@ -0,0 +1,17 @@
$OpenBSD: patch-python2_pyinotify_py,v 1.1.1.1 2018/01/24 18:06:34 jasper Exp $
Index: python2/pyinotify.py
--- python2/pyinotify.py.orig
+++ python2/pyinotify.py
@@ -213,6 +213,11 @@ class _CtypesLibcINotifyWrapper(INotifyWrapper):
except (OSError, IOError):
pass # Will attemp to load it with None anyway.
+ # Special handling for OpenBSD where the library is
+ # installed in a subdirectory.
+ if sys.platform.startswith('openbsd'):
+ libc_name = '${LOCALBASE}/lib/inotify/libinotify.so'
+
if sys.version_info >= (2, 6):
self._libc = ctypes.CDLL(libc_name, use_errno=True)
self._get_errno_func = ctypes.get_errno

View File

@ -0,0 +1,17 @@
$OpenBSD: patch-python3_pyinotify_py,v 1.1.1.1 2018/01/24 18:06:34 jasper Exp $
Index: python3/pyinotify.py
--- python3/pyinotify.py.orig
+++ python3/pyinotify.py
@@ -211,6 +211,11 @@ class _CtypesLibcINotifyWrapper(INotifyWrapper):
except (OSError, IOError):
pass # Will attemp to load it with None anyway.
+ # Special handling for OpenBSD where the library is
+ # installed in a subdirectory.
+ if sys.platform.startswith('openbsd'):
+ libc_name = '${LOCALBASE}/lib/inotify/libinotify.so'
+
self._libc = ctypes.CDLL(libc_name, use_errno=True)
self._get_errno_func = ctypes.get_errno

View File

@ -0,0 +1,33 @@
$OpenBSD: patch-setup_py,v 1.1.1.1 2018/01/24 18:06:34 jasper Exp $
Index: setup.py
--- setup.py.orig
+++ setup.py
@@ -25,7 +25,7 @@ if sys.version_info < (2, 4):
sys.exit(1)
# check linux platform
-if not platform.startswith('linux') and not platform.startswith('freebsd'):
+if not platform.startswith('linux') and not platform.startswith('freebsd') and not platform.startswith('openbsd'):
sys.stderr.write("inotify is not available on %s\n" % platform)
sys.exit(1)
@@ -73,6 +73,8 @@ def should_compile_ext_mod():
try_libc_name = 'c'
if platform.startswith('freebsd'):
try_libc_name = 'inotify'
+ if platform.startswith('openbsd'):
+ return True
libc_name = None
try:
@@ -94,6 +96,9 @@ if compile_ext_mod or should_compile_ext_mod():
# add -fpic if x86_64 arch
if platform in ["linux-x86_64"]:
os.environ["CFLAGS"] = "-fpic"
+ # pass proper path to libinotify
+ if platform.startswith('openbsd'):
+ os.environ["LDFLAGS"] = "-L${LOCALBASE}/lib/inotify/ -linotify"
# sources for ext module
ext_mod_src = ['common/inotify_syscalls.c']
# dst for ext module

View File

@ -0,0 +1,2 @@
inotify functionality allows you to register one or more directories for
watching, and to simply block and wait for notification events.

View File

@ -0,0 +1,9 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2018/01/24 18:06:34 jasper Exp $
lib/python${MODPY_VERSION}/site-packages/${MODPY_PYCACHE}pyinotify.${MODPY_PYC_MAGIC_TAG}pyc
lib/python${MODPY_VERSION}/site-packages/inotify_syscalls.so
lib/python${MODPY_VERSION}/site-packages/pyinotify-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/
lib/python${MODPY_VERSION}/site-packages/pyinotify-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/PKG-INFO
lib/python${MODPY_VERSION}/site-packages/pyinotify-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/SOURCES.txt
lib/python${MODPY_VERSION}/site-packages/pyinotify-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/dependency_links.txt
lib/python${MODPY_VERSION}/site-packages/pyinotify-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/top_level.txt
lib/python${MODPY_VERSION}/site-packages/pyinotify.py