Files
nixpkgs/pkgs/development/python-modules/wxPython/4.0.nix
Alyssa Ross 2bfa93e01c treewide: python{ => .pythonForBuild}.interpreter
It won't be enough to fix cross in all cases, but it is in at least
one: pywayland.  I've only made the change in cases I'm confident it's
correct, as it would be wrong to change this when python.interpreter
is used in wrappers, and possibly when it's used for running tests.
2023-02-26 20:26:17 +00:00

89 lines
1.9 KiB
Nix

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