summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/mfusepy/default.nix
blob: 0dcd575fbc81d8da49260f596652e0b04a19c860 (plain)
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
{
  lib,
  stdenv,
  buildPythonPackage,
  fetchFromGitHub,
  setuptools,
  fuse3,
}:

let
  version = "3.1.0";
in
buildPythonPackage {
  pname = "mfusepy";
  inherit version;
  pyproject = true;

  src = fetchFromGitHub {
    owner = "mxmlnkn";
    repo = "mfusepy";
    tag = "v${version}";
    hash = "sha256-HOibpS6lbrIwhdnbML9nLK9XUo8ILDqAp8ZjGiMKYMQ=";
  };

  # If fuse library path cannot be found, use fuse library path in nixpkgs
  postPatch = lib.optionalString stdenv.hostPlatform.isLinux ''
    substituteInPlace mfusepy.py \
      --replace-fail "_libfuse_path = find_library('fuse3')" '_libfuse_path = "${lib.getLib fuse3}/lib/libfuse3.so.4"'
  '';

  build-system = [ setuptools ];

  # https://github.com/NixOS/nixpkgs/blob/1e1947e8b7962c914b725e8b821e311229e632ae/doc/packages/fuse.section.md?plain=1#L10
  pythonImportsCheck = lib.optionals stdenv.hostPlatform.isLinux [ "mfusepy" ];

  meta = {
    description = "Ctypes bindings for the high-level API in libfuse 2 and 3";
    homepage = "https://github.com/mxmlnkn/mfusepy";
    license = lib.licenses.isc;
    maintainers = with lib.maintainers; [ kyehn ];
  };
}