1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
|
{
lib,
stdenv,
buildPythonPackage,
setuptools,
fetchPypi,
replaceVars,
# build
autoPatchelfHook,
attrdict,
doxygen,
pkg-config,
python,
sip,
which,
buildPackages,
# runtime
cairo,
gst_all_1,
gtk3,
libGL,
libGLU,
libSM,
libXinerama,
libXtst,
libXxf86vm,
libglvnd,
libgbm,
pango,
webkitgtk_4_0,
wxGTK,
xorgproto,
# propagates
numpy,
pillow,
six,
}:
buildPythonPackage rec {
pname = "wxpython";
version = "4.2.2";
format = "other";
src = fetchPypi {
pname = "wxPython";
inherit version;
hash = "sha256-XbywZQ9n/cLFlleVolX/qj17CfsUmqjaLQ2apE444ro=";
};
patches = [
(replaceVars ./4.2-ctypes.patch {
libgdk = "${gtk3.out}/lib/libgdk-3.so";
libpangocairo = "${pango}/lib/libpangocairo-1.0.so";
libcairo = "${cairo}/lib/libcairo.so";
})
./0001-add-missing-bool-c.patch # Add missing bool.c from old source
];
# https://github.com/wxWidgets/Phoenix/issues/2575
postPatch = ''
ln -s ${lib.getExe buildPackages.waf} bin/waf
substituteInPlace build.py \
--replace-fail "distutils.dep_util" "setuptools.modified"
'';
nativeBuildInputs = [
attrdict
pkg-config
setuptools
sip
which
wxGTK
] ++ lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ];
buildInputs =
[
wxGTK
]
++ lib.optionals stdenv.hostPlatform.isLinux [
gst_all_1.gst-plugins-base
gst_all_1.gstreamer
libGL
libGLU
libSM
libXinerama
libXtst
libXxf86vm
libglvnd
libgbm
webkitgtk_4_0
xorgproto
];
propagatedBuildInputs = [
numpy
pillow
six
];
buildPhase = ''
runHook preBuild
export DOXYGEN=${doxygen}/bin/doxygen
export PATH="${wxGTK}/bin:$PATH"
export WAF=$PWD/bin/waf
${python.pythonOnBuildForHost.interpreter} build.py -v --use_syswx dox etg sip --nodoc build_py
runHook postBuild
'';
installPhase = ''
runHook preInstall
${python.pythonOnBuildForHost.interpreter} setup.py install --skip-build --prefix=$out
wrapPythonPrograms
runHook postInstall
'';
checkPhase = ''
runHook preCheck
${python.interpreter} build.py -v test
runHook postCheck
'';
meta = with lib; {
changelog = "https://github.com/wxWidgets/Phoenix/blob/wxPython-${version}/CHANGES.rst";
description = "Cross platform GUI toolkit for Python, Phoenix version";
homepage = "http://wxpython.org/";
license = licenses.wxWindows;
maintainers = with maintainers; [ hexa ];
};
}
|