1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 lark,
6 lxml,
7 oletools,
8 pytestCheckHook,
9 pythonOlder,
10 setuptools,
11}:
12
13buildPythonPackage rec {
14 pname = "rtfde";
15 version = "0.1.1";
16 pyproject = true;
17
18 disabled = pythonOlder "3.7";
19
20 src = fetchFromGitHub {
21 owner = "seamustuohy";
22 repo = "RTFDE";
23 rev = "refs/tags/${version}";
24 hash = "sha256-ai9JQ3gphY/IievBNdHiblIpc0IPS9wp7CVvBIRzG/4=";
25 };
26
27 postPatch = ''
28 # https://github.com/seamustuohy/RTFDE/issues/31
29 substituteInPlace setup.py \
30 --replace-fail "==" ">="
31 '';
32
33 build-system = [ setuptools ];
34
35 dependencies = [
36 lark
37 oletools
38 ];
39
40 nativeCheckInputs = [
41 lxml
42 pytestCheckHook
43 ];
44
45 pythonImportsCheck = [ "RTFDE" ];
46
47 meta = with lib; {
48 description = "Library for extracting encapsulated HTML and plain text content from the RTF bodies";
49 homepage = "https://github.com/seamustuohy/RTFDE";
50 changelog = "https://github.com/seamustuohy/RTFDE/releases/tag/${version}";
51 license = licenses.lgpl3Only;
52 maintainers = with maintainers; [ fab ];
53 };
54}