3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #199251 from fabaff/weasyprint-bump

python310Packages.pydyf: 0.1.2 -> 0.5.0, python310Packages.weasyprint: 54.3 -> 57.0
This commit is contained in:
Fabian Affolter 2022-11-03 08:30:17 +01:00 committed by GitHub
commit 2bb38d1b00
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 49 additions and 55 deletions

View file

@ -1,49 +1,47 @@
{ lib
, buildPythonPackage
, fetchpatch
, fetchPypi
, isPy3k
, pytestCheckHook
, coverage
, flit-core
, ghostscript
, pillow
, pytestCheckHook
, pythonOlder
}:
buildPythonPackage rec {
pname = "pydyf";
version = "0.1.2";
disabled = !isPy3k;
version = "0.5.0";
format = "pyproject";
disabled = pythonOlder "3.7";
src = fetchPypi {
inherit version;
pname = "pydyf";
sha256 = "sha256-Hi9d5IF09QXeAlp9HnzwG73ZQiyoq5RReCvwDuF4YCw=";
inherit pname version;
hash = "sha256-UedRrhUEA3wfwfSBURkTewEYAs1fbDU52wZsRVsUp+E=";
};
patches = [
# Fix tests for Ghostscript 9.56
# Remove after v0.1.3 has been released
(fetchpatch {
url = "https://github.com/CourtBouillon/pydyf/commit/d4c34823f1d15368753c9c26f7acc7a24fc2d979.patch";
sha256 = "sha256-2hHZW/q5CbStbpSJYbm3b23qKXANEb5jbPGQ83uHC+Q=";
})
];
postPatch = ''
substituteInPlace pyproject.toml \
--replace "--isort --flake8 --cov --no-cov-on-fail" ""
'';
nativeBuildInputs = [
flit-core
];
checkInputs = [
pytestCheckHook
coverage
ghostscript
pillow
pytestCheckHook
];
pythonImportsCheck = [
"pydyf"
];
meta = with lib; {
homepage = "https://doc.courtbouillon.org/pydyf/stable/";
description = "Low-level PDF generator written in Python and based on PDF specification 1.7";
homepage = "https://doc.courtbouillon.org/pydyf/stable/";
license = licenses.bsd3;
maintainers = with maintainers; [ rprecenth ];
};

View file

@ -1,39 +1,38 @@
{ buildPythonPackage
, fetchPypi
, fetchpatch
, pytestCheckHook
{ lib
, stdenv
, buildPythonPackage
, cairosvg
, flit-core
, fonttools
, pydyf
, pyphen
, cffi
, cssselect2
, html5lib
, tinycss2
, fetchPypi
, flit-core
, fontconfig
, fonttools
, ghostscript
, glib
, harfbuzz
, html5lib
, pango
, fontconfig
, lib
, stdenv
, ghostscript
, isPy3k
, substituteAll
, pillow
, pydyf
, pyphen
, pytestCheckHook
, pythonOlder
, substituteAll
, tinycss2
}:
buildPythonPackage rec {
pname = "weasyprint";
version = "54.3";
disabled = !isPy3k;
version = "57.0";
format = "pyproject";
disabled = pythonOlder "3.7";
src = fetchPypi {
inherit version;
pname = "weasyprint";
sha256 = "sha256-4E2gQGMFZsRMqiAgM/B/hYdl9TZwkEWoCXOfPQSOidY=";
hash = "sha256-e29cwTgZ6afYdIwdvw6NJET3pIGKmDOfgtzKqCK/kRs=";
};
patches = [
@ -46,12 +45,6 @@ buildPythonPackage rec {
pangocairo = "${pango.out}/lib/libpangocairo-1.0${stdenv.hostPlatform.extensions.sharedLibrary}";
harfbuzz = "${harfbuzz.out}/lib/libharfbuzz${stdenv.hostPlatform.extensions.sharedLibrary}";
})
# Disable tests for new Ghostscript
# Remove when next version is released
(fetchpatch {
url = "https://github.com/Kozea/WeasyPrint/commit/e544398b00d76bc0317ea7e2abe40dc46b380910.patch";
sha256 = "sha256-oQO3j9Mo1x98WaLPROxsOn0qkeYRJrCx5QWWKoHvabE=";
})
];
nativeBuildInputs = [
@ -96,9 +89,13 @@ buildPythonPackage rec {
export HOME=$TMPDIR
'';
pythonImportsCheck = [
"weasyprint"
];
meta = with lib; {
homepage = "https://weasyprint.org/";
description = "Converts web documents to PDF";
homepage = "https://weasyprint.org/";
license = licenses.bsd3;
maintainers = with maintainers; [ elohmeier ];
};

View file

@ -1,10 +1,10 @@
diff --git a/weasyprint/text/ffi.py b/weasyprint/text/ffi.py
index 0734cbea..22e31a5e 100644
index 09f614aad..cbe9a73dd 100644
--- a/weasyprint/text/ffi.py
+++ b/weasyprint/text/ffi.py
@@ -387,22 +387,11 @@ def _dlopen(ffi, *names):
return ffi.dlopen(names[0]) # pragma: no cover
@@ -415,22 +415,11 @@ def _dlopen(ffi, *names):
with suppress((OSError, FileNotFoundError)):
os.add_dll_directory(dll_directory)
-gobject = _dlopen(
- ffi, 'gobject-2.0-0', 'gobject-2.0', 'libgobject-2.0-0',
@ -18,7 +18,7 @@ index 0734cbea..22e31a5e 100644
- 'libharfbuzz-0.dll')
-fontconfig = _dlopen(
- ffi, 'fontconfig-1', 'fontconfig', 'libfontconfig', 'libfontconfig.so.1',
- 'libfontconfig-1.dylib', 'libfontconfig-1.dll')
- 'libfontconfig.1.dylib', 'libfontconfig-1.dll')
-pangoft2 = _dlopen(
- ffi, 'pangoft2-1.0-0', 'pangoft2-1.0', 'libpangoft2-1.0-0',
- 'libpangoft2-1.0.so.0', 'libpangoft2-1.0.dylib', 'libpangoft2-1.0-0.dll')
@ -28,5 +28,4 @@ index 0734cbea..22e31a5e 100644
+fontconfig = _dlopen(ffi, '@fontconfig@')
+pangoft2 = _dlopen(ffi, '@pangoft2@')
gobject.g_type_init()
gobject.g_type_init()