1{ fetchurl
2, lib
3, pythonPackages
4, openglSupport ? true
5, libX11
6, wxGTK
7, pkgconfig
8}:
9
10assert wxGTK.unicode;
11
12with pythonPackages;
13
14buildPythonPackage rec {
15 name = "wxPython-${version}";
16 version = "3.0.2.0";
17
18 disabled = isPy3k || isPyPy;
19 doCheck = false;
20
21 src = fetchurl {
22 url = "mirror://sourceforge/wxpython/wxPython-src-${version}.tar.bz2";
23 sha256 = "0qfzx3sqx4mwxv99sfybhsij4b5pc03ricl73h4vhkzazgjjjhfm";
24 };
25
26 hardeningDisable = [ "format" ];
27
28 propagatedBuildInputs = [ pkgconfig wxGTK (wxGTK.gtk) libX11 ] ++ lib.optional openglSupport pyopengl;
29 preConfigure = "cd wxPython";
30
31 NIX_LDFLAGS = "-lX11 -lgdk-x11-2.0";
32
33 buildPhase = "";
34
35 installPhase = ''
36 ${python.interpreter} setup.py install WXPORT=gtk2 NO_HEADERS=1 BUILD_GLCANVAS=${if openglSupport then "1" else "0"} UNICODE=1 --prefix=$out
37 wrapPythonPrograms
38 '';
39
40 passthru = { inherit wxGTK openglSupport; };
41}