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