25 buildPythonPackage rec {
30 disabled = pythonOlder "3.9";
35 hash = "sha256-jYaA1zL3+g/LxYdpKlpcsJXDUlYnBmkY1uIDy/Qrf80=";
40 src = ./library-paths.patch;
41 fontconfig = "${fontconfig.lib}/lib/libfontconfig${stdenv.hostPlatform.extensions.sharedLibrary}";
42 pangoft2 = "${pango.out}/lib/libpangoft2-1.0${stdenv.hostPlatform.extensions.sharedLibrary}";
43 gobject = "${glib.out}/lib/libgobject-2.0${stdenv.hostPlatform.extensions.sharedLibrary}";
44 pango = "${pango.out}/lib/libpango-1.0${stdenv.hostPlatform.extensions.sharedLibrary}";
45 pangocairo = "${pango.out}/lib/libpangocairo-1.0${stdenv.hostPlatform.extensions.sharedLibrary}";
46 harfbuzz = "${harfbuzz.out}/lib/libharfbuzz${stdenv.hostPlatform.extensions.sharedLibrary}";
50 nativeBuildInputs = [ flit-core ];
52 propagatedBuildInputs = [
61 ] ++ fonttools.optional-dependencies.woff;
69 # needs the Ahem font (fails on macOS)
71 # sensitive to sandbox environments
73 "test_tabulation_character"
74 "test_linear_gradients_5"
75 "test_linear_gradients_12"
78 FONTCONFIG_FILE = "${fontconfig.out}/etc/fonts/fonts.conf";
80 # Set env variable explicitly for Darwin, but allow overriding when invoking directly
81 makeWrapperArgs = [ "--set-default FONTCONFIG_FILE ${FONTCONFIG_FILE}" ];
84 substituteInPlace pyproject.toml \
85 --replace "--isort --flake8 --cov --no-cov-on-fail" ""
89 # Fontconfig wants to create a cache.
93 pythonImportsCheck = [ "weasyprint" ];
96 description = "Converts web documents to PDF";
97 mainProgram = "weasyprint";
98 homepage = "https://weasyprint.org/";
99 license = licenses.bsd3;