2018-07-21 16:41:48 +01:00
|
|
|
{ lib
|
2019-05-01 23:40:10 +01:00
|
|
|
, stdenv
|
2018-07-21 16:41:48 +01:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
2021-01-19 06:50:56 +00:00
|
|
|
, pkg-config
|
2018-07-21 16:41:48 +01:00
|
|
|
, which
|
2019-05-01 23:40:10 +01:00
|
|
|
, cairo
|
|
|
|
, pango
|
|
|
|
, python
|
|
|
|
, doxygen
|
|
|
|
, ncurses
|
2021-01-14 08:25:45 +00:00
|
|
|
, libintl
|
|
|
|
, wxGTK
|
|
|
|
, wxmac
|
|
|
|
, IOKit
|
|
|
|
, Carbon
|
|
|
|
, Cocoa
|
|
|
|
, AudioToolbox
|
|
|
|
, OpenGL
|
|
|
|
, CoreFoundation
|
2018-07-21 16:41:48 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "wxPython";
|
2019-11-19 14:35:40 +00:00
|
|
|
version = "4.0.7.post2";
|
2018-07-21 16:41:48 +01:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2019-11-19 14:35:40 +00:00
|
|
|
sha256 = "5a229e695b64f9864d30a5315e0c1e4ff5e02effede0a07f16e8d856737a0c4e";
|
2018-07-21 16:41:48 +01:00
|
|
|
};
|
|
|
|
|
2019-05-01 23:40:10 +01:00
|
|
|
doCheck = false;
|
2018-07-21 16:41:48 +01:00
|
|
|
|
2021-01-19 06:50:56 +00:00
|
|
|
nativeBuildInputs = [ pkg-config which doxygen ]
|
2021-01-14 08:25:45 +00:00
|
|
|
++ (if stdenv.isDarwin then [ wxmac ] else [ wxGTK ]);
|
|
|
|
|
|
|
|
buildInputs = [ ncurses libintl ]
|
|
|
|
++ (if stdenv.isDarwin
|
|
|
|
then
|
|
|
|
[ AudioToolbox Carbon Cocoa CoreFoundation IOKit OpenGL ]
|
|
|
|
else
|
|
|
|
[ wxGTK.gtk ]
|
|
|
|
);
|
2019-05-01 23:40:10 +01:00
|
|
|
|
|
|
|
DOXYGEN = "${doxygen}/bin/doxygen";
|
|
|
|
|
|
|
|
preConfigure = lib.optionalString (!stdenv.isDarwin) ''
|
|
|
|
substituteInPlace wx/lib/wxcairo/wx_pycairo.py \
|
|
|
|
--replace 'cairoLib = None' 'cairoLib = ctypes.CDLL("${cairo}/lib/libcairo.so")'
|
|
|
|
substituteInPlace wx/lib/wxcairo/wx_pycairo.py \
|
|
|
|
--replace '_dlls = dict()' '_dlls = {k: ctypes.CDLL(v) for k, v in [
|
|
|
|
("gdk", "${wxGTK.gtk}/lib/libgtk-x11-2.0.so"),
|
|
|
|
("pangocairo", "${pango.out}/lib/libpangocairo-1.0.so"),
|
|
|
|
("appsvc", None)
|
|
|
|
]}'
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
${python.interpreter} build.py -v --use_syswx dox etg --nodoc sip build_py
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
${python.interpreter} setup.py install --skip-build --prefix=$out
|
|
|
|
'';
|
|
|
|
|
2021-01-14 08:25:45 +00:00
|
|
|
passthru = { wxWidgets = if stdenv.isDarwin then wxmac else wxGTK; };
|
2018-07-21 16:41:48 +01:00
|
|
|
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Cross platform GUI toolkit for Python, Phoenix version";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://wxpython.org/";
|
2018-07-21 16:41:48 +01:00
|
|
|
license = lib.licenses.wxWindows;
|
|
|
|
};
|
|
|
|
|
2019-05-01 23:40:10 +01:00
|
|
|
}
|