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