1{ lib 2, buildPythonPackage 3, pythonOlder 4, fetchFromGitHub 5, cython_3 6, pkg-config 7, setuptools 8, fuse3 9, trio 10, python 11, pytestCheckHook 12, pytest-trio 13, which 14}: 15 16buildPythonPackage rec { 17 pname = "pyfuse3"; 18 version = "3.3.0"; 19 20 disabled = pythonOlder "3.8"; 21 22 format = "pyproject"; 23 24 src = fetchFromGitHub { 25 owner = "libfuse"; 26 repo = "pyfuse3"; 27 rev = "refs/tags/${version}"; 28 hash = "sha256-GLGuTFdTA16XnXKSBD7ET963a8xH9EG/JfPNu6/3DOg="; 29 }; 30 31 postPatch = '' 32 substituteInPlace setup.py \ 33 --replace "'pkg-config'" "'$(command -v $PKG_CONFIG)'" 34 ''; 35 36 nativeBuildInputs = [ 37 cython_3 38 pkg-config 39 setuptools 40 ]; 41 42 buildInputs = [ fuse3 ]; 43 44 propagatedBuildInputs = [ trio ]; 45 46 preBuild = '' 47 ${python.pythonOnBuildForHost.interpreter} setup.py build_cython 48 ''; 49 50 nativeCheckInputs = [ 51 pytestCheckHook 52 pytest-trio 53 which 54 fuse3 55 ]; 56 57 # Checks if a /usr/bin directory exists, can't work on NixOS 58 disabledTests = [ "test_listdir" ]; 59 60 pythonImportsCheck = [ 61 "pyfuse3" 62 "pyfuse3_asyncio" 63 ]; 64 65 meta = with lib; { 66 description = "Python 3 bindings for libfuse 3 with async I/O support"; 67 homepage = "https://github.com/libfuse/pyfuse3"; 68 license = licenses.lgpl2Plus; 69 maintainers = with maintainers; [ nyanloutre dotlambda ]; 70 changelog = "https://github.com/libfuse/pyfuse3/blob/${version}/Changes.rst"; 71 }; 72}