Skip to content

Commit 5079aac

Browse files
authored
python312Packages.weasyprint: cleanup, mark as broken on darwin (#412183)
2 parents 39fa280 + 1f3967f commit 5079aac

File tree

1 file changed

+29
-20
lines changed

1 file changed

+29
-20
lines changed

pkgs/development/python-modules/weasyprint/default.nix

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,45 @@
11
{
2-
stdenv,
32
lib,
3+
stdenv,
44
pkgs,
55
buildPythonPackage,
6-
cffi,
7-
cssselect2,
8-
fetchPypi,
9-
flit-core,
6+
fetchFromGitHub,
107
fontconfig,
11-
fonttools,
128
glib,
139
harfbuzz,
1410
pango,
11+
12+
# build-system
13+
flit-core,
14+
15+
# dependencies
16+
cffi,
17+
cssselect2,
18+
fonttools,
1519
pillow,
1620
pydyf,
1721
pyphen,
22+
tinycss2,
23+
tinyhtml5,
24+
25+
# tests
1826
pytest-cov-stub,
1927
pytestCheckHook,
20-
pythonOlder,
2128
replaceVars,
22-
tinycss2,
23-
tinyhtml5,
29+
versionCheckHook,
30+
writableTmpDirAsHomeHook,
2431
}:
2532

2633
buildPythonPackage rec {
2734
pname = "weasyprint";
2835
version = "65.1";
2936
pyproject = true;
3037

31-
disabled = pythonOlder "3.9";
32-
33-
src = fetchPypi {
34-
inherit version;
35-
pname = "weasyprint";
36-
hash = "sha256-EgKBvb1C/6p9flztvjGCos7zbqWtl/6fNX5DvmoeWOo=";
38+
src = fetchFromGitHub {
39+
owner = "Kozea";
40+
repo = "WeasyPrint";
41+
tag = "v${version}";
42+
hash = "sha256-iSeuRX1dnnrGZbcb1yTxOJPD5kgIWY6oz/0v02QJqSs=";
3743
};
3844

3945
patches = [
@@ -64,7 +70,10 @@ buildPythonPackage rec {
6470
pkgs.ghostscript
6571
pytest-cov-stub
6672
pytestCheckHook
73+
versionCheckHook
74+
writableTmpDirAsHomeHook
6775
];
76+
versionCheckProgramArg = "--version";
6877

6978
disabledTests = [
7079
# needs the Ahem font (fails on macOS)
@@ -93,11 +102,6 @@ buildPythonPackage rec {
93102
# Set env variable explicitly for Darwin, but allow overriding when invoking directly
94103
makeWrapperArgs = [ "--set-default FONTCONFIG_FILE ${FONTCONFIG_FILE}" ];
95104

96-
preCheck = ''
97-
# Fontconfig wants to create a cache.
98-
export HOME=$TMPDIR
99-
'';
100-
101105
pythonImportsCheck = [ "weasyprint" ];
102106

103107
meta = {
@@ -107,5 +111,10 @@ buildPythonPackage rec {
107111
homepage = "https://weasyprint.org/";
108112
license = lib.licenses.bsd3;
109113
teams = [ lib.teams.apm ];
114+
badPlatforms = [
115+
# Fatal Python error: Segmentation fault
116+
# "...weasyprint/pdf/fonts.py", line 221 in _harfbuzz_subset
117+
lib.systems.inspect.patterns.isDarwin
118+
];
110119
};
111120
}

0 commit comments

Comments
 (0)