wxPython: refactor to generic

This commit is contained in:
Vincent Laporte 2015-09-05 12:58:00 +02:00
parent 9a0f8b5a4f
commit f6a875d5ae
5 changed files with 47 additions and 71 deletions

View file

@ -1,24 +1,9 @@
{ stdenv, fetchurl, pkgconfig, wxGTK, pythonPackages, python, isPyPy }:
{ callPackage, ... } @ args:
assert wxGTK.unicode;
callPackage ./generic.nix (args // rec {
let version = "2.8.12.1"; in
version = "2.8.12.1";
if isPyPy then throw "wxPython-${version} not supported for interpreter ${python.executable}" else stdenv.mkDerivation {
name = "wxPython-${version}";
builder = ./builder.sh;
src = fetchurl {
url = "mirror://sourceforge/wxpython/wxPython-src-${version}.tar.bz2";
sha256 = "1l1w4i113csv3bd5r8ybyj0qpxdq83lj6jrc5p7cc10mkwyiagqz";
};
buildInputs = [ pkgconfig wxGTK (wxGTK.gtk) pythonPackages.python pythonPackages.wrapPython ];
passthru = { inherit wxGTK; };
sha256 = "1l1w4i113csv3bd5r8ybyj0qpxdq83lj6jrc5p7cc10mkwyiagqz";
meta = {
platforms = stdenv.lib.platforms.all;
};
}
})

View file

@ -1,32 +1,9 @@
{ stdenv, fetchurl, pkgconfig, python, buildPythonPackage, isPy3k, isPyPy, wxGTK, openglSupport ? true, pyopengl }:
{ callPackage, ... } @ args:
assert wxGTK.unicode;
buildPythonPackage rec {
disabled = isPy3k || isPyPy;
doCheck = false;
callPackage ./generic.nix (args // rec {
version = "3.0.2.0";
name = "wxPython-${version}";
src = fetchurl {
url = "mirror://sourceforge/wxpython/wxPython-src-${version}.tar.bz2";
sha256 = "0qfzx3sqx4mwxv99sfybhsij4b5pc03ricl73h4vhkzazgjjjhfm";
};
sha256 = "0qfzx3sqx4mwxv99sfybhsij4b5pc03ricl73h4vhkzazgjjjhfm";
buildInputs = [ pkgconfig wxGTK (wxGTK.gtk) ]
++ 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;
passthru = { inherit wxGTK openglSupport; };
}
})

View file

@ -1,22 +0,0 @@
source $stdenv/setup
flags="WXPORT=gtk2 NO_HEADERS=1 BUILD_GLCANVAS=0 BUILD_OGL=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

View file

@ -0,0 +1,34 @@
{ stdenv, fetchurl, pkgconfig, python, buildPythonPackage, isPy3k, isPyPy, wxGTK, openglSupport ? true, pyopengl
, version, sha256, ...
}:
assert wxGTK.unicode;
buildPythonPackage rec {
disabled = isPy3k || isPyPy;
doCheck = false;
name = "wxPython-${version}";
inherit version;
src = fetchurl {
url = "mirror://sourceforge/wxpython/wxPython-src-${version}.tar.bz2";
inherit sha256;
};
buildInputs = [ pkgconfig wxGTK (wxGTK.gtk) ]
++ 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;
passthru = { inherit wxGTK openglSupport; };
}

View file

@ -15023,11 +15023,13 @@ let
wxPython = self.wxPython28;
wxPython28 = callPackage ../development/python-modules/wxPython/2.8.nix {
wxPython28 = import ../development/python-modules/wxPython/2.8.nix {
inherit callPackage;
wxGTK = pkgs.wxGTK28;
};
wxPython30 = callPackage ../development/python-modules/wxPython/3.0.nix {
wxPython30 = import ../development/python-modules/wxPython/3.0.nix {
inherit callPackage;
wxGTK = pkgs.wxGTK30;
};