pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

py-mfusepy: Update along upstream master (now tracking git)



Module Name:	pkgsrc-wip
Committed By:	Greg Troxel <gdt%lexort.com@localhost>
Pushed By:	gdt
Date:		Tue Oct 6 12:21:44 2026 -0400
Changeset:	60460008d0c770590e46fc229035b8e454472a80

Modified Files:
	py-mfusepy/Makefile
	py-mfusepy/distinfo
Removed Files:
	py-mfusepy/patches/patch-mfusepy.py
	py-mfusepy/patches/patch-tests_test__examples.py
	py-mfusepy/patches/patch-tests_test__struct__layout.py

Log Message:
py-mfusepy: Update along upstream master (now tracking git)

Upstream just merged NetBSD support.  Track git master instead of the
6-months-ago release.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=60460008d0c770590e46fc229035b8e454472a80

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 py-mfusepy/Makefile                                |  14 +-
 py-mfusepy/distinfo                                |   9 +-
 py-mfusepy/patches/patch-mfusepy.py                | 188 ---------------------
 py-mfusepy/patches/patch-tests_test__examples.py   |  30 ----
 .../patches/patch-tests_test__struct__layout.py    |  38 -----
 5 files changed, 15 insertions(+), 264 deletions(-)

diffs:
diff --git a/py-mfusepy/Makefile b/py-mfusepy/Makefile
index a8b6e5cb86..9b8ab3353b 100644
--- a/py-mfusepy/Makefile
+++ b/py-mfusepy/Makefile
@@ -1,10 +1,12 @@
 # $NetBSD$
 
-DISTNAME=	mfusepy-3.1.1
+DISTNAME=	mfusepy-3.1.1.32
 PKGNAME=	${PYPKGPREFIX}-${DISTNAME}
 PKGREVISION=	1
 CATEGORIES=	filesystems python
-MASTER_SITES=	${MASTER_SITE_PYPI:=m/mfusepy/}
+MASTER_SITES=	${MASTER_SITE_GITHUB:=mxmlnkn/}
+GITHUB_PROJECT=	mfusepy
+GITHUB_TAG=	b3b03ef8aebb8c1629d7982285731bd887826c8e
 
 MAINTAINER=	gdt%NetBSD.org@localhost
 HOMEPAGE=	https://pypi.org/project/mfusepy/
@@ -15,6 +17,14 @@ USE_LANGUAGES=	# none
 
 TOOL_DEPENDS+=	${PYPKGPREFIX}-setuptools>=77:../../devel/py-setuptools
 
+SUBST_CLASSES+=		version
+SUBST_STAGE.version=	pre-configure
+SUBST_FILES.version=	pyproject.toml
+SUBST_SED.version=	-e 's/3.1.1/${PKGVERSION_NOREV}/'
+
+# TEST DEPENDS
+USE_LANGUAGES+=	c
+
 # Upstream has many test dependencies, not expressed in pyproject.toml.
 # At least:
 #   loopback
diff --git a/py-mfusepy/distinfo b/py-mfusepy/distinfo
index e88b625c51..f1514edc58 100644
--- a/py-mfusepy/distinfo
+++ b/py-mfusepy/distinfo
@@ -1,8 +1,5 @@
 $NetBSD$
 
-BLAKE2s (mfusepy-3.1.1.tar.gz) = a72506eb624ee8750863452c0c8c493f9ce40ddb0c27f2a196270d6f7953eece
-SHA512 (mfusepy-3.1.1.tar.gz) = 3d2b2d7531998bccd2b218e31983efd0b1d0854c9f4af3a88922fb89a55cd5c4e6972fa50031cae29f553b599686ad9dd1cb84134989fb876a9fa3b34f64547f
-Size (mfusepy-3.1.1.tar.gz) = 34549 bytes
-SHA1 (patch-mfusepy.py) = 4069b5c6efd150a116d182a7251dd2aa79675bc3
-SHA1 (patch-tests_test__examples.py) = 3ce125d03050c7d152d6f764de9eb071e9381c69
-SHA1 (patch-tests_test__struct__layout.py) = b982f1593550c9cff006f01a88313a77c94c404e
+BLAKE2s (mfusepy-3.1.1.32-b3b03ef8aebb8c1629d7982285731bd887826c8e.tar.gz) = a5a5873e809a5cc5cdd1981f7556c8a8b7c388b90437c2a174e07fdb252344ff
+SHA512 (mfusepy-3.1.1.32-b3b03ef8aebb8c1629d7982285731bd887826c8e.tar.gz) = b6f6e0ab842035ec0c3e50ef0525417b7b536c8db710b1de03b68d54e4ea9606ef59d4ed9f3a1d9c29237617ebfce1b3c0f4bd4b866b9e528cd5274bf0c4f46f
+Size (mfusepy-3.1.1.32-b3b03ef8aebb8c1629d7982285731bd887826c8e.tar.gz) = 159414 bytes
diff --git a/py-mfusepy/patches/patch-mfusepy.py b/py-mfusepy/patches/patch-mfusepy.py
deleted file mode 100644
index 34512a6c95..0000000000
--- a/py-mfusepy/patches/patch-mfusepy.py
+++ /dev/null
@@ -1,188 +0,0 @@
-$NetBSD$
-
-From upstream pending PR, less CI hunk and hunk for code added
-since 3.1.1:
-
-  https://github.com/mxmlnkn/mfusepy/pull/59
-
---- mfusepy.py.orig	2026-03-13 00:36:12.000000000 +0000
-+++ mfusepy.py
-@@ -99,6 +99,11 @@ if not _libfuse_path:
-         _libfuse_path = (
-             find_library('fuse4x') or find_library('osxfuse') or find_library('fuse') or find_library('fuse-t')
-         )
-+    elif _system == 'NetBSD':
-+        # On NetBSD 10+ librefuse implements FUSE 3, targeting 3.10 compatibility.
-+        # On NetBSD, find_library only works if a C compiler or ld is in PATH (and e.g. not within pkgsrc builds,
-+        # where the compiler wrappers drop -lrefuse), so fall back to the soname of the base system library.
-+        _libfuse_path = find_library('refuse') or 'librefuse.so.2'
-     elif _system == 'Windows':
-         # pytype: disable=module-attr
-         try:
-@@ -139,6 +144,10 @@ _libfuse = ctypes.CDLL(_libfuse_path)
- if _system == 'Darwin' and hasattr(_libfuse, 'macfuse_version'):
-     _system = 'Darwin-MacFuse'
- 
-+# NetBSD's librefuse is a FUSE reimplementation on top of puffs (no perfused daemon needed).
-+# Its struct layouts differ from libfuse and are fixed, i.e. independent of the FUSE API version.
-+_librefuse = _system == 'NetBSD' and hasattr(_libfuse, '__fuse_main')
-+
- 
- def get_fuse_version(libfuse):
-     version = libfuse.fuse_version()
-@@ -155,7 +164,7 @@ if fuse_version_major == 2 and fuse_vers
-         f"Found library {_libfuse_path} is too old: {fuse_version_major}.{fuse_version_minor}. "
-         "There have been several ABI breaks in each version. Libfuse < 2.6 is not supported!"
-     )
--if fuse_version_major != 2 and not (fuse_version_major == 3 and _system == 'Linux'):
-+if fuse_version_major != 2 and not (fuse_version_major == 3 and _system in ('Linux', 'NetBSD')):
-     raise AttributeError(
-         f"Found library {_libfuse_path} has wrong major version: {fuse_version_major}. Expected FUSE 2!"
-     )
-@@ -747,56 +756,25 @@ _fuse_int32 = ctypes.c_int32 if (fuse_ve
- _fuse_uint32 = ctypes.c_uint32 if (fuse_version_major, fuse_version_minor) >= (3, 17) else ctypes.c_uint
- _fuse_file_info_fields_: list[FieldsEntry] = []
- _fuse_file_info_fields_bitfield: list[BitFieldsEntry] = []
--# Bogus check. It fixes the struct for NetBSD, but it makes the examples not run anymore!
--if _system == 'NetBSD_False':
--    # NetBSD has its own FUSE library reimplementation with mismatching struct layouts!
--    # writepage is a bitfield (as in libFUSE 3.x), but the fh_old member still exists and the reported version is 2.9!
--    # https://www.netbsd.org/docs/puffs/
-+if _librefuse:
-+    # librefuse has one fuse_file_info layout for all API versions: fh_old still exists (removed in FUSE 3),
-+    # writepage is a bitfield and poll_events exists (both as in FUSE 3).
-     # https://github.com/NetBSD/src/blob/netbsd-11/lib/librefuse/fuse.h#L100-L129
--    # https://github.com/NetBSD/src/blob/netbsd-10/lib/librefuse/fuse.h#L100-L129
--    #  - fuse_file_info is unchanged between 10 and 11
--    #  - FUSE_USE_VERSION is not set, but is set to _REFUSE_VERSION_ (3.10) with a warning if not set!
--    #  - However, the CI prints FUSE version 2.9?!
--    #  - Seems there is no sane way to get the correct compiled version! This is again an absolute shit show!
--    # https://github.com/NetBSD/src/blob/netbsd-9/lib/librefuse/fuse.h#L51-L61
--    #  - fuse_file_info looks quite different and version is specified as 2.6!
--    #  - #define FUSE_USE_VERSION 26
--    fuse_version = (fuse_version_major, fuse_version_minor)
-     _fuse_file_info_fields_ = [
-         ('flags', ctypes.c_int32),
-         ('fh_old', ctypes.c_uint32),
--    ]
--
--    if fuse_version >= (2, 9):
--        _fuse_file_info_fields_bitfield += [('writepage', ctypes.c_int32, 1)]
--    else:
--        _fuse_file_info_fields_ += [('writepage', ctypes.c_int32)]
--
--    _fuse_file_info_fields_bitfield += [
--        ('direct_io', ctypes.c_uint32, 1),  # Introduced in FUSE 2.4
--        ('keep_cache', ctypes.c_uint32, 1),  # Introduced in FUSE 2.4
--        ('flush', ctypes.c_uint32, 1),  # Introduced in FUSE 2.6
--    ]
--    if fuse_version >= (2, 9):
--        _fuse_file_info_fields_bitfield += [
--            ('nonseekable', ctypes.c_uint, 1),  # Introduced in FUSE 2.8
--            ('flock_release', ctypes.c_uint, 1),  # Introduced in FUSE 2.9
--            ('cache_readdir', ctypes.c_uint, 1),  # Introduced in FUSE 3.5
--        ]
--
--    _fuse_file_info_flag_count = sum(x[2] for x in _fuse_file_info_fields_bitfield)
--    assert _fuse_file_info_flag_count < ctypes.sizeof(_fuse_uint32) * 8
--
--    _fuse_file_info_fields_ += _fuse_file_info_fields_bitfield
--    _fuse_file_info_fields_ += [
--        ('padding', _fuse_uint32, ctypes.sizeof(_fuse_uint32) * 8 - _fuse_file_info_flag_count),
-+        ('writepage', ctypes.c_uint32, 1),
-+        ('direct_io', ctypes.c_uint32, 1),
-+        ('keep_cache', ctypes.c_uint32, 1),
-+        ('flush', ctypes.c_uint32, 1),
-+        ('nonseekable', ctypes.c_uint32, 1),
-+        ('flock_release', ctypes.c_uint32, 1),
-+        ('cache_readdir', ctypes.c_uint32, 1),
-+        ('padding', ctypes.c_uint32, 25),
-         ('fh', ctypes.c_uint64),
-         ('lock_owner', ctypes.c_uint64),
-+        ('poll_events', ctypes.c_uint32),
-     ]
--
--    if fuse_version >= (2, 9):
--        _fuse_file_info_fields_ += [('poll_events', ctypes.c_uint32)]
--
- elif fuse_version_major == 2:
-     _fh_old_type = ctypes.c_uint if _system == 'OpenBSD' else ctypes.c_ulong
-     _fuse_file_info_fields_ = [
-@@ -937,14 +915,12 @@ _fuse_conn_info_fields: list[FieldsEntry
-     ('proto_major', ctypes.c_uint),
-     ('proto_minor', ctypes.c_uint),
- ]
--# For some reason, NetBSD return 2.9 even though the API is 3.10!
--# The correct version is important for the struct layout!
--# https://github.com/NetBSD/src/blob/netbsd-10/lib/librefuse/fuse.h#L58-L59
--# However, the fuse_operations layout probably fits the advertised version because I had segfaults from utimens!
--if fuse_version_major == 2 or _system == 'NetBSD':  # No idea why NetBSD did not remove it -.-
-+# librefuse has one fuse_conn_info layout for all API versions, containing the FUSE 2 and FUSE 3 members.
-+# https://github.com/NetBSD/src/blob/netbsd-11/lib/librefuse/fuse.h
-+if fuse_version_major == 2 or _librefuse:
-     _fuse_conn_info_fields += [('async_read', _fuse_uint32)]
- _fuse_conn_info_fields += [('max_write', _fuse_uint32)]
--if fuse_version_major == 3 or _system == 'NetBSD':
-+if fuse_version_major == 3 or _librefuse:
-     _fuse_conn_info_fields += [('max_read', _fuse_uint32)]
- _fuse_conn_info_fields += [('max_readahead', _fuse_uint32)]
- if _system == 'Darwin':
-@@ -955,11 +931,11 @@ _fuse_conn_info_fields += [
-     ('max_background', _fuse_uint32),  # Added in 2.9
-     ('congestion_threshold', _fuse_uint32),  # Added in 2.9
- ]
--if fuse_version_major == 2 and _system != 'NetBSD':
-+if fuse_version_major == 2 and not _librefuse:
-     _fuse_conn_info_fields += [('reserved', _fuse_uint32 * (22 if _system == 'Darwin' else 23))]
--elif fuse_version_major == 3 or _system == 'NetBSD':
-+elif fuse_version_major == 3 or _librefuse:
-     _fuse_conn_info_fields += [('time_gran', _fuse_uint32)]
--    if fuse_version_minor < 17 or _system == 'NetBSD':
-+    if fuse_version_minor < 17 or _librefuse:
-         _fuse_conn_info_fields += [('reserved', _fuse_uint32 * 22)]
-     else:
-         _fuse_conn_info_fields += [
-@@ -1037,7 +1013,7 @@ if fuse_version_major == 3:
-     if fuse_version_minor >= 15 and fuse_version_minor < 17:
-         _fuse_config_fields_ += [('parallel_direct_writes', ctypes.c_int)]
- 
--    if _system != 'NetBSD':
-+    if not _librefuse:
-         _fuse_config_fields_ += [
-             ('show_help', _fuse_int32),
-             ('modules', ctypes.c_char_p),
-@@ -1243,6 +1219,15 @@ if _system == "OpenBSD":
-     def fuse_main_real(argc, argv, fuse_ops_v, sizeof_fuse_ops, ctx_p):
-         return _libfuse.fuse_main(argc, argv, fuse_ops_v, ctx_p)
- 
-+elif _librefuse:
-+    # librefuse's fuse_main_real is only a shim for binaries built against FUSE 2.6: it always interprets
-+    # the operations as struct fuse_operations_v26. __fuse_main takes the layout version instead of the size.
-+    # The FUSE 3 fuse_operations defined above is struct fuse_operations_v38 (used for FUSE_USE_VERSION 38..310).
-+    _REFUSE_OP_VERSION = 38
-+
-+    def fuse_main_real(argc, argv, fuse_ops_v, sizeof_fuse_ops, ctx_p):
-+        return getattr(_libfuse, '__fuse_main')(argc, argv, fuse_ops_v, _REFUSE_OP_VERSION, ctx_p)
-+
- else:
-     fuse_main_real = _libfuse.fuse_main_real
- 
-@@ -1379,7 +1364,8 @@ class FUSE:
-         }
- 
-         argsb = [arg.encode(encoding, self.errors) for arg in args]
--        argv = (ctypes.c_char_p * len(argsb))(*argsb)
-+        argc = len(argsb)
-+        argv = (ctypes.c_char_p * (argc + 1))(*argsb, None)  # Null terminate explicitly
- 
-         alternative_callbacks = {
-             "readdir": ["readdir_with_offset"],
-@@ -1443,7 +1429,7 @@ class FUSE:
-         except ValueError:
-             old_handler = SIG_DFL
- 
--        err = fuse_main_real(len(argsb), argv, ctypes.pointer(fuse_ops), ctypes.sizeof(fuse_ops), None)
-+        err = fuse_main_real(argc, argv, ctypes.pointer(fuse_ops), ctypes.sizeof(fuse_ops), None)
- 
-         try:
-             signal(SIGINT, old_handler)
diff --git a/py-mfusepy/patches/patch-tests_test__examples.py b/py-mfusepy/patches/patch-tests_test__examples.py
deleted file mode 100644
index bd09193db9..0000000000
--- a/py-mfusepy/patches/patch-tests_test__examples.py
+++ /dev/null
@@ -1,30 +0,0 @@
-$NetBSD$
-
-Tests depend on ioctl_opt, not documented:
-  https://github.com/mxmlnkn/mfusepy/issues/48
-  https://github.com/mxmlnkn/mfusepy/pull/60
-
-Reimplementation of PR patch, less continuing to run the tests on
-Linux.  Filed upstream as a comment in the PR.
-
---- tests/test_examples.py.orig	2026-09-30 13:47:39.350361831 +0000
-+++ tests/test_examples.py
-@@ -19,7 +19,8 @@ from types import ModuleType
- from typing import Optional
- 
- import pytest
--from ioctl_opt import IOWR
-+#from ioctl_opt import IOWR
-+ioctl_opt=None
- 
- pwd: Optional[ModuleType]
- try:
-@@ -248,7 +249,7 @@ def test_read_write_file_system(cli, tmp
-             with open(path, 'rb') as file:
-                 # Test a simple ioctl command that returns the argument incremented by one.
-                 argument = 123
--                iowr_m = IOWR(ord('M'), 1, ctypes.c_uint32)
-+                iowr_m = ioctl_opt.IOWR(ord('M'), 1, ctypes.c_uint32)
-                 result = fcntl.ioctl(file, iowr_m, struct.pack('I', argument))
-                 assert struct.unpack('I', result)[0] == argument + 1
- 
diff --git a/py-mfusepy/patches/patch-tests_test__struct__layout.py b/py-mfusepy/patches/patch-tests_test__struct__layout.py
deleted file mode 100644
index e856af22d6..0000000000
--- a/py-mfusepy/patches/patch-tests_test__struct__layout.py
+++ /dev/null
@@ -1,38 +0,0 @@
-$NetBSD$
-
-Logically part of mfusepy.py patch.
-
---- tests/test_struct_layout.py.orig	2026-03-13 00:36:12.000000000 +0000
-+++ tests/test_struct_layout.py
-@@ -1,6 +1,5 @@
- import ctypes
- import os
--import platform
- import pprint
- import shutil
- import subprocess
-@@ -82,8 +81,7 @@ STRUCT_NAMES = {
-     ],
- }
- 
--if platform.system() != 'NetBSD':
--    STRUCT_NAMES['fuse_file_info'] = ['flags', 'fh', 'lock_owner']
-+STRUCT_NAMES['fuse_file_info'] = ['flags', 'fh', 'lock_owner']
- 
- if mfusepy.fuse_version_major == 3:
-     STRUCT_NAMES['fuse_config'] = [
-@@ -188,10 +186,12 @@ def c_run(name: str, source: str) -> str
-             f'-DFUSE_USE_VERSION={mfusepy.fuse_version_major}{mfusepy.fuse_version_minor}',
-             '-D_FILE_OFFSET_BITS=64',
-         ]
--        cflags += [f'-I{path}' for path in include_paths if os.path.exists(path)]
-+        # librefuse's fuse.h is in the default include path, do not pick up the headers of a libfuse package.
-+        if not mfusepy._librefuse:
-+            cflags += [f'-I{path}' for path in include_paths if os.path.exists(path)]
- 
-         # Add possible pkg-config flags if available
--        for fuse_lib in ("fuse", "fuse3"):
-+        for fuse_lib in () if mfusepy._librefuse else ("fuse", "fuse3"):
-             try:
-                 pkg_config_flags = subprocess.check_output(['pkg-config', '--cflags', fuse_lib], text=True).split()
-                 cflags.extend(pkg_config_flags)


Home | Main Index | Thread Index | Old Index