1{ stdenv
2, lib
3, buildPythonPackage
4, fetchFromGitHub
5, pytestCheckHook
6, chardet
7, cssselect
8, lxml
9, timeout-decorator
10}:
11
12buildPythonPackage rec {
13 pname = "readability-lxml";
14 version = "0.8.1";
15
16 src = fetchFromGitHub {
17 owner = "buriy";
18 repo = "python-readability";
19 rev = "v${version}";
20 hash = "sha256-MKdQRety24qOG9xgIdaCJ72XEImP42SlMG6tC7bwzo4=";
21 };
22
23 propagatedBuildInputs = [ chardet cssselect lxml ];
24
25 postPatch = ''
26 substituteInPlace setup.py --replace 'sys.platform == "darwin"' "False"
27 '';
28
29 checkInputs = [
30 pytestCheckHook
31 timeout-decorator
32 ];
33
34 meta = with lib; {
35 broken = stdenv.isDarwin;
36 description = "Fast python port of arc90's readability tool";
37 homepage = "https://github.com/buriy/python-readability";
38 license = licenses.apsl20;
39 maintainers = with maintainers; [ siraben ];
40 };
41}