aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/development/python-modules/wxPython
diff options
context:
space:
mode:
authorMx Kookie <kookie@spacekookie.de>2020-10-31 19:35:09 +0100
committerMx Kookie <kookie@spacekookie.de>2020-10-31 19:35:09 +0100
commitc4625b175f8200f643fd6e11010932ea44c78433 (patch)
treebce3f89888c8ac3991fa5569a878a9eab6801ccc /infra/libkookie/nixpkgs/pkgs/development/python-modules/wxPython
parent49f735974dd103039ddc4cb576bb76555164a9e7 (diff)
parentd661aa56a8843e991261510c1bb28fdc2f6975ae (diff)
Add 'infra/libkookie/' from commit 'd661aa56a8843e991261510c1bb28fdc2f6975ae'
git-subtree-dir: infra/libkookie git-subtree-mainline: 49f735974dd103039ddc4cb576bb76555164a9e7 git-subtree-split: d661aa56a8843e991261510c1bb28fdc2f6975ae
Diffstat (limited to 'infra/libkookie/nixpkgs/pkgs/development/python-modules/wxPython')
-rw-r--r--infra/libkookie/nixpkgs/pkgs/development/python-modules/wxPython/3.0.nix91
-rw-r--r--infra/libkookie/nixpkgs/pkgs/development/python-modules/wxPython/4.0.nix62
2 files changed, 153 insertions, 0 deletions
diff --git a/infra/libkookie/nixpkgs/pkgs/development/python-modules/wxPython/3.0.nix b/infra/libkookie/nixpkgs/pkgs/development/python-modules/wxPython/3.0.nix
new file mode 100644
index 000000000000..dc15c1c01bee
--- /dev/null
+++ b/infra/libkookie/nixpkgs/pkgs/development/python-modules/wxPython/3.0.nix
@@ -0,0 +1,91 @@
+{ fetchurl
+, lib
+, stdenv
+, darwin
+, openglSupport ? true
+, libX11
+, wxGTK
+, wxmac
+, pkgconfig
+, buildPythonPackage
+, pyopengl
+, isPy3k
+, isPyPy
+, python
+, cairo
+, pango
+}:
+
+assert wxGTK.unicode;
+
+buildPythonPackage rec {
+ pname = "wxPython";
+ version = "3.0.2.0";
+
+ disabled = isPy3k || isPyPy;
+ doCheck = false;
+
+ src = fetchurl {
+ url = "mirror://sourceforge/wxpython/wxPython-src-${version}.tar.bz2";
+ sha256 = "0qfzx3sqx4mwxv99sfybhsij4b5pc03ricl73h4vhkzazgjjjhfm";
+ };
+
+ dontUseSetuptoolsBuild = true;
+ dontUsePipInstall = true;
+
+ hardeningDisable = [ "format" ];
+
+ nativeBuildInputs = [ pkgconfig ]
+ ++ (lib.optionals (!stdenv.isDarwin) [ wxGTK libX11 ])
+ ++ (lib.optionals stdenv.isDarwin [ wxmac ]);
+
+ buildInputs = [ ]
+ ++ (lib.optionals (!stdenv.isDarwin) [ (wxGTK.gtk) ])
+ ++ (lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
+ ApplicationServices
+ AudioToolbox
+ CFNetwork
+ Carbon
+ Cocoa
+ CoreGraphics
+ CoreServices
+ CoreText
+ DiskArbitration
+ IOKit
+ ImageIO
+ OpenGL
+ Security
+ ]))
+ ++ (lib.optional openglSupport pyopengl);
+
+ preConfigure = ''
+ cd wxPython
+ # remove wxPython's darwin hack that interference with python-2.7-distutils-C++.patch
+ substituteInPlace config.py \
+ --replace "distutils.unixccompiler.UnixCCompiler = MyUnixCCompiler" ""
+ # set the WXPREFIX to $out instead of the storepath of wxwidgets
+ substituteInPlace config.py \
+ --replace "WXPREFIX = getWxConfigValue('--prefix')" "WXPREFIX = '$out'"
+ # this check is supposed to only return false on older systems running non-framework python
+ substituteInPlace src/osx_cocoa/_core_wrap.cpp \
+ --replace "return wxPyTestDisplayAvailable();" "return true;"
+ '' + lib.optionalString (!stdenv.isDarwin) ''
+ substituteInPlace wx/lib/wxcairo.py \
+ --replace 'cairoLib = None' 'cairoLib = ctypes.CDLL("${cairo}/lib/libcairo.so")'
+ substituteInPlace wx/lib/wxcairo.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 = "";
+
+ installPhase = ''
+ ${python.interpreter} setup.py install WXPORT=${if stdenv.isDarwin then "osx_cocoa" else "gtk2"} NO_HEADERS=0 BUILD_GLCANVAS=${if openglSupport then "1" else "0"} UNICODE=1 --prefix=$out
+ wrapPythonPrograms
+ '';
+
+ passthru = { inherit wxGTK openglSupport; };
+}
diff --git a/infra/libkookie/nixpkgs/pkgs/development/python-modules/wxPython/4.0.nix b/infra/libkookie/nixpkgs/pkgs/development/python-modules/wxPython/4.0.nix
new file mode 100644
index 000000000000..406493362c46
--- /dev/null
+++ b/infra/libkookie/nixpkgs/pkgs/development/python-modules/wxPython/4.0.nix
@@ -0,0 +1,62 @@
+{ lib
+, stdenv
+, buildPythonPackage
+, fetchPypi
+, pkgconfig
+, which
+, cairo
+, pango
+, python
+, doxygen
+, ncurses
+, wxGTK
+, numpy
+, pillow
+, six
+}:
+
+buildPythonPackage rec {
+ pname = "wxPython";
+ version = "4.0.7.post2";
+
+ src = fetchPypi {
+ inherit pname version;
+ sha256 = "5a229e695b64f9864d30a5315e0c1e4ff5e02effede0a07f16e8d856737a0c4e";
+ };
+
+ doCheck = false;
+
+ nativeBuildInputs = [ pkgconfig which doxygen wxGTK ];
+ buildInputs = [ ncurses wxGTK.gtk ];
+
+ 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
+ '';
+
+ passthru = { inherit wxGTK; };
+
+
+ meta = {
+ description = "Cross platform GUI toolkit for Python, Phoenix version";
+ homepage = "http://wxpython.org/";
+ license = lib.licenses.wxWindows;
+ };
+
+}