wxPython-3: refactor
This commit is contained in:
parent
eb42c82f6b
commit
9a0f8b5a4f
@ -1,29 +1,32 @@
|
|||||||
{ stdenv, fetchurl, pkgconfig, wxGTK, pythonPackages, openglSupport ? true, python, isPyPy }:
|
{ stdenv, fetchurl, pkgconfig, python, buildPythonPackage, isPy3k, isPyPy, wxGTK, openglSupport ? true, pyopengl }:
|
||||||
|
|
||||||
assert wxGTK.unicode;
|
assert wxGTK.unicode;
|
||||||
|
|
||||||
with stdenv.lib;
|
buildPythonPackage rec {
|
||||||
|
|
||||||
let version = "3.0.2.0"; in
|
disabled = isPy3k || isPyPy;
|
||||||
|
doCheck = false;
|
||||||
|
|
||||||
if isPyPy then throw "wxPython-${version} not supported for interpreter ${python.executable}" else stdenv.mkDerivation {
|
version = "3.0.2.0";
|
||||||
name = "wxPython-${version}";
|
name = "wxPython-${version}";
|
||||||
|
|
||||||
builder = ./builder3.0.sh;
|
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "mirror://sourceforge/wxpython/wxPython-src-${version}.tar.bz2";
|
url = "mirror://sourceforge/wxpython/wxPython-src-${version}.tar.bz2";
|
||||||
sha256 = "0qfzx3sqx4mwxv99sfybhsij4b5pc03ricl73h4vhkzazgjjjhfm";
|
sha256 = "0qfzx3sqx4mwxv99sfybhsij4b5pc03ricl73h4vhkzazgjjjhfm";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ pkgconfig wxGTK (wxGTK.gtk) pythonPackages.python pythonPackages.wrapPython ]
|
buildInputs = [ pkgconfig wxGTK (wxGTK.gtk) ]
|
||||||
++ optional openglSupport pythonPackages.pyopengl;
|
++ stdenv.lib.optional openglSupport pyopengl;
|
||||||
|
|
||||||
|
preConfigure = "cd wxPython";
|
||||||
|
|
||||||
|
setupPyBuildFlags = [ "WXPORT=gtk2" "NO_HEADERS=1" "BUILD_GLCANVAS=${if openglSupport then "1" else "0"}" "UNICODE=1" ];
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
${python}/bin/${python.executable} setup.py ${stdenv.lib.concatStringsSep " " setupPyBuildFlags} install --prefix=$out
|
||||||
|
'';
|
||||||
|
|
||||||
inherit openglSupport;
|
inherit openglSupport;
|
||||||
|
|
||||||
passthru = { inherit wxGTK openglSupport; };
|
passthru = { inherit wxGTK openglSupport; };
|
||||||
|
|
||||||
meta = {
|
|
||||||
platforms = stdenv.lib.platforms.all;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
@ -1,22 +0,0 @@
|
|||||||
source $stdenv/setup
|
|
||||||
|
|
||||||
flags="WXPORT=gtk2 NO_HEADERS=1 BUILD_GLCANVAS=${openglSupport?1:0} UNICODE=1"
|
|
||||||
|
|
||||||
configurePhase() {
|
|
||||||
cd wxPython
|
|
||||||
}
|
|
||||||
|
|
||||||
buildPhase() {
|
|
||||||
python setup.py $flags build
|
|
||||||
}
|
|
||||||
|
|
||||||
installPhase() {
|
|
||||||
python setup.py $flags install --prefix=$out
|
|
||||||
|
|
||||||
# Ugly workaround for Nixpkgs/111.
|
|
||||||
ln -s $out/lib/python*/site-packages/wx-*-gtk2-unicode/* $out/lib/python*/site-packages
|
|
||||||
|
|
||||||
wrapPythonPrograms
|
|
||||||
}
|
|
||||||
|
|
||||||
genericBuild
|
|
Loading…
Reference in New Issue
Block a user