2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
arabic-reshaper,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
fetchpatch2,
|
|
|
|
html5lib,
|
|
|
|
pillow,
|
|
|
|
pyhanko,
|
|
|
|
pyhanko-certvalidator,
|
|
|
|
pypdf,
|
|
|
|
pytestCheckHook,
|
|
|
|
python-bidi,
|
|
|
|
pythonOlder,
|
|
|
|
pythonRelaxDepsHook,
|
|
|
|
reportlab,
|
|
|
|
setuptools,
|
|
|
|
svglib,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "xhtml2pdf";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "0.2.15";
|
2024-01-02 11:29:13 +00:00
|
|
|
pyproject = true;
|
2022-03-30 09:31:56 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
2022-03-30 09:31:56 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2024-04-21 15:54:59 +00:00
|
|
|
owner = "xhtml2pdf";
|
|
|
|
repo = "xhtml2pdf";
|
2023-05-24 13:37:59 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-JXxh/n1kUsy3O4P/6WTfa5p+mYy/t4ZBUhlHp+ypoQc=";
|
2022-03-30 09:31:56 +00:00
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
patches = [
|
|
|
|
# https://github.com/xhtml2pdf/xhtml2pdf/pull/754
|
|
|
|
(fetchpatch2 {
|
|
|
|
name = "reportlab-compat.patch";
|
|
|
|
url = "https://github.com/xhtml2pdf/xhtml2pdf/commit/1252510bd23b833b45b4d252aeac62c1eb51eeef.patch";
|
|
|
|
hash = "sha256-9Fkn086uh2biabmiChbBna8Q4lJV/604yX1ng9j5TGs=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pythonRelaxDepsHook
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonRelaxDeps = [ "reportlab" ];
|
2024-04-21 15:54:59 +00:00
|
|
|
|
2020-11-21 19:51:51 +00:00
|
|
|
propagatedBuildInputs = [
|
2022-03-30 09:31:56 +00:00
|
|
|
arabic-reshaper
|
|
|
|
html5lib
|
|
|
|
pillow
|
2022-04-27 09:35:20 +00:00
|
|
|
pyhanko
|
2024-04-21 15:54:59 +00:00
|
|
|
pyhanko-certvalidator
|
2023-03-15 16:39:30 +00:00
|
|
|
pypdf
|
2022-03-30 09:31:56 +00:00
|
|
|
python-bidi
|
|
|
|
reportlab
|
|
|
|
svglib
|
2020-11-21 19:51:51 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2022-03-30 09:31:56 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
disabledTests = [
|
|
|
|
# Tests requires network access
|
|
|
|
"test_document_cannot_identify_image"
|
|
|
|
"test_document_with_broken_image"
|
|
|
|
];
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"xhtml2pdf"
|
2024-01-02 11:29:13 +00:00
|
|
|
"xhtml2pdf.pisa"
|
2022-03-30 09:31:56 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "PDF generator using HTML and CSS";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/xhtml2pdf/xhtml2pdf";
|
2023-05-24 13:37:59 +00:00
|
|
|
changelog = "https://github.com/xhtml2pdf/xhtml2pdf/releases/tag/v${version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.asl20;
|
2022-03-30 09:31:56 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "xhtml2pdf";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|