From 93d313c0ed34df4d4f8969d95c0cf721bb69f10c Mon Sep 17 00:00:00 2001 From: "ambrop7@gmail.com" Date: Tue, 25 Mar 2014 22:32:39 +0100 Subject: [PATCH] Add wxPython-3.0 with OpenGL support. --- .../python-modules/wxPython/3.0.nix | 25 +++++++++++++++++++ .../python-modules/wxPython/builder3.0.sh | 22 ++++++++++++++++ pkgs/top-level/python-packages.nix | 6 +++++ 3 files changed, 53 insertions(+) create mode 100644 pkgs/development/python-modules/wxPython/3.0.nix create mode 100644 pkgs/development/python-modules/wxPython/builder3.0.sh diff --git a/pkgs/development/python-modules/wxPython/3.0.nix b/pkgs/development/python-modules/wxPython/3.0.nix new file mode 100644 index 000000000000..9aa6148643bd --- /dev/null +++ b/pkgs/development/python-modules/wxPython/3.0.nix @@ -0,0 +1,25 @@ +{ stdenv, fetchurl, pkgconfig, wxGTK, pythonPackages, openglSupport ? true }: + +assert wxGTK.unicode; + +with stdenv.lib; + +let version = "3.0.0.0"; in + +stdenv.mkDerivation { + name = "wxPython-${version}"; + + builder = ./builder3.0.sh; + + src = fetchurl { + url = "mirror://sourceforge/wxpython/wxPython-src-${version}.tar.bz2"; + sha256 = "af88695e820dd914e8375dc91ecb736f6fb605979bb38460ace61bbea494dc11"; + }; + + buildInputs = [ pkgconfig wxGTK (wxGTK.gtk) pythonPackages.python pythonPackages.wrapPython ] + ++ optional openglSupport pythonPackages.pyopengl; + + inherit openglSupport; + + passthru = { inherit wxGTK openglSupport; }; +} diff --git a/pkgs/development/python-modules/wxPython/builder3.0.sh b/pkgs/development/python-modules/wxPython/builder3.0.sh new file mode 100644 index 000000000000..7403c67d0912 --- /dev/null +++ b/pkgs/development/python-modules/wxPython/builder3.0.sh @@ -0,0 +1,22 @@ +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 diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index ab605199e7f9..e5a72517d978 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7610,6 +7610,12 @@ rec { wxGTK = pkgs.wxGTK28; }; + wxPython30 = import ../development/python-modules/wxPython/3.0.nix { + inherit (pkgs) stdenv fetchurl pkgconfig; + inherit pythonPackages; + wxGTK = pkgs.wxGTK30; + }; + xe = buildPythonPackage rec { url = "http://www.blarg.net/%7Esteveha/xe-0.7.4.tar.gz"; name = stdenv.lib.nameFromURL url ".tar";