about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/pyfuse3/default.nix
blob: 45dbd1a43ae2cf23ed4244fef4dc4e9614479be6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
{ lib
, buildPythonPackage
, pythonOlder
, fetchFromGitHub
, cython
, pkg-config
, fuse3
, trio
, python
, pytestCheckHook
, pytest-trio
, which
}:

buildPythonPackage rec {
  pname = "pyfuse3";
  version = "3.2.3";

  disabled = pythonOlder "3.5";

  format = "setuptools";

  src = fetchFromGitHub {
    owner = "libfuse";
    repo = "pyfuse3";
    rev = "refs/tags/${version}";
    hash = "sha256-2YrVapCojcFRaljqNeWPMWz3hEgSutKPy2u8FXp0fME=";
  };

  postPatch = ''
    substituteInPlace setup.py \
      --replace "'pkg-config'" "'$(command -v $PKG_CONFIG)'"
  '';

  nativeBuildInputs = [
    cython
    pkg-config
  ];

  buildInputs = [ fuse3 ];

  propagatedBuildInputs = [ trio ];

  preBuild = ''
    ${python.pythonForBuild.interpreter} setup.py build_cython
  '';

  nativeCheckInputs = [
    pytestCheckHook
    pytest-trio
    which
    fuse3
  ];

  # Checks if a /usr/bin directory exists, can't work on NixOS
  disabledTests = [ "test_listdir" ];

  pythonImportsCheck = [
    "pyfuse3"
    "pyfuse3_asyncio"
  ];

  meta = with lib; {
    description = "Python 3 bindings for libfuse 3 with async I/O support";
    homepage = "https://github.com/libfuse/pyfuse3";
    license = licenses.lgpl2Plus;
    maintainers = with maintainers; [ nyanloutre dotlambda ];
    changelog = "https://github.com/libfuse/pyfuse3/blob/${version}/Changes.rst";
  };
}