2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
2022-10-06 18:32:54 +00:00
|
|
|
, setuptools
|
2021-02-05 17:12:51 +00:00
|
|
|
, pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
, which
|
|
|
|
, cairo
|
|
|
|
, pango
|
|
|
|
, python
|
|
|
|
, doxygen
|
|
|
|
, ncurses
|
2021-01-15 22:18:51 +00:00
|
|
|
, libintl
|
|
|
|
, wxGTK
|
2022-12-17 10:02:37 +00:00
|
|
|
, gtk3
|
2021-01-15 22:18:51 +00:00
|
|
|
, IOKit
|
|
|
|
, Carbon
|
|
|
|
, Cocoa
|
|
|
|
, AudioToolbox
|
|
|
|
, OpenGL
|
|
|
|
, CoreFoundation
|
2021-06-28 23:13:55 +00:00
|
|
|
, pillow
|
|
|
|
, numpy
|
2022-10-30 15:09:59 +00:00
|
|
|
, six
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "wxPython";
|
|
|
|
version = "4.0.7.post2";
|
2022-10-06 18:32:54 +00:00
|
|
|
format = "other";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
|
|
|
sha256 = "5a229e695b64f9864d30a5315e0c1e4ff5e02effede0a07f16e8d856737a0c4e";
|
|
|
|
};
|
|
|
|
|
|
|
|
doCheck = false;
|
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
nativeBuildInputs = [ pkg-config which doxygen setuptools wxGTK ];
|
2021-01-15 22:18:51 +00:00
|
|
|
|
|
|
|
buildInputs = [ ncurses libintl ]
|
|
|
|
++ (if stdenv.isDarwin
|
|
|
|
then
|
|
|
|
[ AudioToolbox Carbon Cocoa CoreFoundation IOKit OpenGL ]
|
|
|
|
else
|
2022-12-17 10:02:37 +00:00
|
|
|
[ gtk3 ]
|
2021-01-15 22:18:51 +00:00
|
|
|
);
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
numpy
|
|
|
|
pillow
|
|
|
|
six
|
|
|
|
];
|
2021-06-28 23:13:55 +00:00
|
|
|
|
2020-04-24 23:36:52 +00: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 [
|
2022-12-17 10:02:37 +00:00
|
|
|
("gdk", "${gtk3}/lib/libgtk-x11-2.0.so"),
|
2020-04-24 23:36:52 +00:00
|
|
|
("pangocairo", "${pango.out}/lib/libpangocairo-1.0.so"),
|
|
|
|
("appsvc", None)
|
|
|
|
]}'
|
2022-10-30 15:09:59 +00:00
|
|
|
'' + lib.optionalString (stdenv.isDarwin && stdenv.isAarch64) ''
|
|
|
|
# Remove the OSX-Only wx.webkit module
|
|
|
|
sed -i "s/makeETGRule(.*'WXWEBKIT')/pass/" wscript
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
${python.interpreter} build.py -v --use_syswx dox etg --nodoc sip build_py
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
${python.interpreter} setup.py install --skip-build --prefix=$out
|
|
|
|
'';
|
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
passthru = { wxWidgets = wxGTK; };
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Cross platform GUI toolkit for Python, Phoenix version";
|
|
|
|
homepage = "http://wxpython.org/";
|
|
|
|
license = lib.licenses.wxWindows;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|