1{ lib
2, stdenv
3, buildPythonPackage
4, pythonOlder
5, fetchFromGitHub
6, cython_3
7, fuse
8, pkg-config
9, pytestCheckHook
10, python
11, setuptools
12, which
13}:
14
15buildPythonPackage rec {
16 pname = "llfuse";
17 version = "1.5.0";
18
19 format = "pyproject";
20
21 disabled = pythonOlder "3.8";
22
23 src = fetchFromGitHub {
24 owner = "python-llfuse";
25 repo = "python-llfuse";
26 rev = "refs/tags/release-${version}";
27 hash = "sha256-6/iW5eHmX6ODVPLFkOo3bN9yW8ixqy2MHwQ2r9FA0iI=";
28 };
29
30 nativeBuildInputs = [ cython_3 pkg-config setuptools ];
31
32 buildInputs = [ fuse ];
33
34 preConfigure = ''
35 substituteInPlace setup.py \
36 --replace "'pkg-config'" "'${stdenv.cc.targetPrefix}pkg-config'"
37 '';
38
39 preBuild = ''
40 ${python.pythonOnBuildForHost.interpreter} setup.py build_cython
41 '';
42
43 # On Darwin, the test requires macFUSE to be installed outside of Nix.
44 doCheck = !stdenv.isDarwin;
45 nativeCheckInputs = [ pytestCheckHook which ];
46
47 disabledTests = [
48 "test_listdir" # accesses /usr/bin
49 ];
50
51 meta = with lib; {
52 description = "Python bindings for the low-level FUSE API";
53 homepage = "https://github.com/python-llfuse/python-llfuse";
54 changelog = "https://github.com/python-llfuse/python-llfuse/raw/release-${version}/Changes.rst";
55 license = licenses.lgpl2Plus;
56 platforms = platforms.unix;
57 maintainers = with maintainers; [ bjornfor dotlambda ];
58 };
59}