Skip to content

Commit

Permalink
wxPython: Add 4.2.0
Browse files Browse the repository at this point in the history
Add wxPython v4.2.0
Disable wxPython v4.1.1 for Python v3.10, because wxWidgets/Phoenix#2016
  • Loading branch information
jamesdbrock committed Sep 29, 2022
1 parent 8f267bd commit 1fa2f2d
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkgs/development/python-modules/wxPython/4.1.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
, pkg-config
, python
, isPy27
, isPy310
, doxygen
, cairo
, ncurses
Expand All @@ -32,7 +33,9 @@ in
buildPythonPackage rec {
pname = "wxPython";
version = "4.1.1";
disabled = isPy27;
# wxPython v4.1 doesn't work with Python v3.10
# https://github.com/wxWidgets/Phoenix/issues/2016
disabled = isPy27 || isPy310;

src = fetchPypi {
inherit pname version;
Expand Down
106 changes: 106 additions & 0 deletions pkgs/development/python-modules/wxPython/4.2.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
{ lib
, stdenv
, fetchPypi
, buildPythonPackage
, which
, pkg-config
, python
, isPy27
, doxygen
, cairo
, ncurses
, pango
, wxGTK
, pillow
, numpy
, attrdict
, sip
, libXinerama
, libSM
, libXxf86vm
, libXtst
, libGLU
, libGL
, xorgproto
, gst_all_1
, libglvnd
, mesa
, webkitgtk
, autoPatchelfHook
}:
let
dynamic-linker = stdenv.cc.bintools.dynamicLinker;
in
buildPythonPackage rec {
pname = "wxPython";
version = "4.2.0";
disabled = isPy27;

src = fetchPypi {
inherit pname version;
sha256 = "663cebc4509d7e5d113518865fe274f77f95434c5d57bc386ed58d65ceed86c7";
};

# https://github.com/NixOS/nixpkgs/issues/75759
# https://github.com/wxWidgets/Phoenix/issues/1316
doCheck = false;

nativeBuildInputs = [
which
doxygen
wxGTK.gtk
pkg-config
] ++ lib.optionals stdenv.isLinux [
autoPatchelfHook
sip
];

buildInputs = [
wxGTK.gtk
ncurses
] ++ lib.optionals stdenv.isLinux [
libXinerama
libSM
libXxf86vm
libXtst
xorgproto
gst_all_1.gstreamer
gst_all_1.gst-plugins-base
libGLU
libGL
libglvnd
mesa
webkitgtk
];

propagatedBuildInputs = [ pillow numpy attrdict ];

DOXYGEN = "${doxygen}/bin/doxygen";

preConfigure = lib.optionalString (!stdenv.isDarwin) ''
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-3.0.so"),
("pangocairo", "${pango.out}/lib/libpangocairo-1.0.so"),
("cairoLib = None", "cairoLib = ctypes.CDLL('${cairo}/lib/libcairo.so')"),
("appsvc", None)
]}'
'';

buildPhase = ''
${python.interpreter} build.py -v build_wx dox etg --nodoc sip build_py
'';

installPhase = ''
${python.interpreter} setup.py install --skip-build --prefix=$out
wrapPythonPrograms
'';

meta = with lib; {
broken = stdenv.isDarwin;
description = "Cross platform GUI toolkit for Python, Phoenix version";
homepage = "http://wxpython.org/";
license = licenses.wxWindows;
maintainers = with maintainers; [ tfmoraes ];
};
}
6 changes: 6 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11868,6 +11868,12 @@ in {
};
};

wxPython_4_2 = callPackage ../development/python-modules/wxPython/4.2.nix {
wxGTK = pkgs.wxGTK31.override {
withGtk2 = false;
withWebKit = true;
};
};
x11_hash = callPackage ../development/python-modules/x11_hash { };

x256 = callPackage ../development/python-modules/x256 { };
Expand Down

0 comments on commit 1fa2f2d

Please sign in to comment.