summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/python-unrar/default.nix
blob: 1b1244d90e59f136a15b05226fc41894d5508c7b (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
43
44
45
46
{
  stdenv,
  lib,
  replaceVars,
  buildPythonPackage,
  fetchPypi,
  unrar,
  pytestCheckHook,
  setuptools,
}:
buildPythonPackage rec {
  pname = "python-unrar";
  version = "0.4";
  pyproject = true;

  src = fetchPypi {
    pname = "unrar";
    inherit version;
    hash = "sha256-skRHpbkwJL5gDvglVmi6I6MPRRF2V3tpFVnqE1n30WQ=";
  };

  build-system = [
    setuptools
  ];

  patches = [
    (replaceVars ./use_nix_unrar_path.patch {
      unrar_lib_path = "${unrar}/lib/libunrar${stdenv.hostPlatform.extensions.sharedLibrary}";
    })
  ];

  nativeCheckInputs = [ pytestCheckHook ];

  doCheck = true;

  pythonImportsCheck = [ "unrar" ];

  meta = {
    homepage = "http://github.com/matiasb/python-unrar";
    changelog = "https://github.com/matiasb/python-unrar/releases/tag/v${version}";
    description = "Wrapper for UnRAR library, plus a rarfile module on top of it";
    license = lib.licenses.gpl3Plus;
    maintainers = with lib.maintainers; [ DrymarchonShaun ];
    platforms = lib.platforms.linux;
  };
}