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