diff options
author | Fabian Affolter <fabian@affolter-engineering.ch> | 2022-11-03 08:30:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-03 08:30:17 +0100 |
commit | 2bb38d1b00f0b48e37e86b71a6f19a788b03ae86 (patch) | |
tree | efe2604197e03eb84b79cfea518fe542ab5065ad /pkgs/development | |
parent | 0d90bcf7385cf87dcf70fd33c97cc650695c6764 (diff) | |
parent | 99ec664800bc73a6c5acd8307f4927491fb4e706 (diff) |
Merge pull request #199251 from fabaff/weasyprint-bump
python310Packages.pydyf: 0.1.2 -> 0.5.0, python310Packages.weasyprint: 54.3 -> 57.0
Diffstat (limited to 'pkgs/development')
3 files changed, 49 insertions, 55 deletions
diff --git a/pkgs/development/python-modules/pydyf/default.nix b/pkgs/development/python-modules/pydyf/default.nix index 4cf44e3c67eb6..935cc044e5c10 100644 --- a/pkgs/development/python-modules/pydyf/default.nix +++ b/pkgs/development/python-modules/pydyf/default.nix @@ -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 ]; }; diff --git a/pkgs/development/python-modules/weasyprint/default.nix b/pkgs/development/python-modules/weasyprint/default.nix index e4576a303c500..5ec5c5997706b 100644 --- a/pkgs/development/python-modules/weasyprint/default.nix +++ b/pkgs/development/python-modules/weasyprint/default.nix @@ -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 ]; }; diff --git a/pkgs/development/python-modules/weasyprint/library-paths.patch b/pkgs/development/python-modules/weasyprint/library-paths.patch index bcd1c48ff61a0..6d884f43ed3cd 100644 --- a/pkgs/development/python-modules/weasyprint/library-paths.patch +++ b/pkgs/development/python-modules/weasyprint/library-paths.patch @@ -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() \ No newline at end of file |