Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / pyrdfa3 / default.nix
blob398da024053af121c5382c4ecbe26c36c20e92fe
1 { lib
2 , buildPythonPackage
3 , fetchPypi
4 , fetchpatch
5 , isPy27
6 , rdflib
7 , html5lib
8 }:
10 buildPythonPackage rec {
11   pname = "pyrdfa3";
12   version = "3.5.3";
13   disabled = isPy27;
15   src = fetchPypi {
16     inherit version;
17     pname = "pyRdfa3";
18     hash = "sha256-FXZjqSuH3zRbb2m94jXf9feXiRYI4S/h5PqNrWhxMa4=";
19   };
21   patches = [
22     (fetchpatch {
23       name = "CVE-2022-4396.patch";
24       url = "https://github.com/RDFLib/pyrdfa3/commit/ffd1d62dd50d5f4190013b39cedcdfbd81f3ce3e.patch";
25       hash = "sha256-prRrOwylYcEqKLr/8LIpyJ5Yyt+6+HTUqH5sQXU8tqc=";
26     })
27   ];
29   postPatch = ''
30     substituteInPlace setup.py \
31       --replace "'html = pyRdfa.rdflibparsers:StructuredDataParser'" "'html = pyRdfa.rdflibparsers:StructuredDataParser'," \
32       --replace "'hturtle = pyRdfa.rdflibparsers:HTurtleParser'" "'hturtle = pyRdfa.rdflibparsers:HTurtleParser',"
33   '';
35   propagatedBuildInputs = [
36     rdflib
37     html5lib
38   ];
40   # Does not work with python3
41   doCheck = false;
43   pythonImportsCheck = [ "pyRdfa" ];
45   meta = with lib; {
46     description = "RDFa 1.1 distiller/parser library";
47     homepage = "https://www.w3.org/2012/pyRdfa/";
48     license = licenses.w3c;
49     maintainers = with maintainers; [ ambroisie ];
50   };