nixpkgs/pkgs/development/python-modules/wxPython/3.0.nix

59 lines
1.6 KiB
Nix
Raw Normal View History

{ fetchurl
, lib
2017-02-15 01:26:17 +00:00
, stdenv
, darwin
, openglSupport ? true
, libX11
, wxGTK
2017-02-15 01:26:17 +00:00
, wxmac
, pkgconfig
, buildPythonPackage
, pyopengl
, isPy3k
, isPyPy
, python
}:
2014-03-25 21:32:39 +00:00
assert wxGTK.unicode;
2014-03-25 21:32:39 +00:00
buildPythonPackage rec {
name = "wxPython-${version}";
2015-09-02 17:40:38 +00:00
version = "3.0.2.0";
2014-03-25 21:32:39 +00:00
disabled = isPy3k || isPyPy;
doCheck = false;
src = fetchurl {
url = "mirror://sourceforge/wxpython/wxPython-src-${version}.tar.bz2";
sha256 = "0qfzx3sqx4mwxv99sfybhsij4b5pc03ricl73h4vhkzazgjjjhfm";
};
2016-05-31 14:24:38 +00:00
hardeningDisable = [ "format" ];
2017-02-15 01:26:17 +00:00
propagatedBuildInputs = [ pkgconfig ]
++ (lib.optional openglSupport pyopengl)
++ (lib.optionals (!stdenv.isDarwin) [ wxGTK (wxGTK.gtk) libX11 ])
++ (lib.optionals stdenv.isDarwin [ wxmac darwin.apple_sdk.frameworks.Cocoa ])
;
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" ""
# 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;"
'';
2017-02-15 01:26:17 +00:00
NIX_LDFLAGS = lib.optionalString (!stdenv.isDarwin) "-lX11 -lgdk-x11-2.0";
buildPhase = "";
installPhase = ''
2017-02-15 01:26:17 +00:00
${python.interpreter} setup.py install WXPORT=${if stdenv.isDarwin then "osx_cocoa" else "gtk2"} NO_HEADERS=1 BUILD_GLCANVAS=${if openglSupport then "1" else "0"} UNICODE=1 --prefix=$out
wrapPythonPrograms
'';
2014-03-25 21:32:39 +00:00
passthru = { inherit wxGTK openglSupport; };
}