2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
2022-03-30 09:31:56 +00:00
|
|
|
, arabic-reshaper
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
2022-03-30 09:31:56 +00:00
|
|
|
, fetchFromGitHub
|
2024-04-21 15:54:59 +00:00
|
|
|
, fetchpatch2
|
2020-04-24 23:36:52 +00:00
|
|
|
, html5lib
|
2022-03-30 09:31:56 +00:00
|
|
|
, 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
|
|
|
, pytestCheckHook
|
2020-11-21 19:51:51 +00:00
|
|
|
, python-bidi
|
2022-03-30 09:31:56 +00:00
|
|
|
, pythonOlder
|
2024-04-21 15:54:59 +00:00
|
|
|
, pythonRelaxDepsHook
|
2022-03-30 09:31:56 +00:00
|
|
|
, reportlab
|
2024-04-21 15:54:59 +00:00
|
|
|
, setuptools
|
2022-03-30 09:31:56 +00:00
|
|
|
, 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
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonRelaxDeps = [
|
|
|
|
"reportlab"
|
|
|
|
];
|
|
|
|
|
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
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-03-30 09:31:56 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
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; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A PDF generator using HTML and CSS";
|
|
|
|
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
|
|
|
};
|
|
|
|
}
|