2022-10-06 18:32:54 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
2022-12-17 10:02:37 +00:00
|
|
|
, fetchpatch
|
2022-10-06 18:32:54 +00:00
|
|
|
, isPy27
|
|
|
|
, rdflib
|
|
|
|
, html5lib
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pyrdfa3";
|
|
|
|
version = "3.5.3";
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
2022-10-06 18:32:54 +00:00
|
|
|
disabled = isPy27;
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit version;
|
|
|
|
pname = "pyRdfa3";
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-FXZjqSuH3zRbb2m94jXf9feXiRYI4S/h5PqNrWhxMa4=";
|
2022-10-06 18:32:54 +00:00
|
|
|
};
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
name = "CVE-2022-4396.patch";
|
|
|
|
url = "https://github.com/RDFLib/pyrdfa3/commit/ffd1d62dd50d5f4190013b39cedcdfbd81f3ce3e.patch";
|
|
|
|
hash = "sha256-prRrOwylYcEqKLr/8LIpyJ5Yyt+6+HTUqH5sQXU8tqc=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2022-10-06 18:32:54 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "'html = pyRdfa.rdflibparsers:StructuredDataParser'" "'html = pyRdfa.rdflibparsers:StructuredDataParser'," \
|
|
|
|
--replace "'hturtle = pyRdfa.rdflibparsers:HTurtleParser'" "'hturtle = pyRdfa.rdflibparsers:HTurtleParser',"
|
|
|
|
'';
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
rdflib
|
|
|
|
html5lib
|
|
|
|
];
|
|
|
|
|
|
|
|
# Does not work with python3
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "pyRdfa" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "RDFa 1.1 distiller/parser library";
|
|
|
|
homepage = "https://www.w3.org/2012/pyRdfa/";
|
|
|
|
license = licenses.w3c;
|
|
|
|
maintainers = with maintainers; [ ambroisie ];
|
|
|
|
};
|
|
|
|
}
|