summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2015-09-17 22:10:35 +0200
committerVladimír Čunát <vcunat@gmail.com>2015-09-17 22:10:35 +0200
commitfba3a4e227d847bfe5238fcbb249f3ffc3aa1807 (patch)
tree24aeabcfbfcbd385312697faeff4331ce409793f /pkgs/development/python-modules
parent80b26e4079ce1eb3c08683ea4e4835b965d5c974 (diff)
parent1fff5d7aa26928f9640a124dedf63303e7ba1641 (diff)
Merge #9665: wxPython: update & refactor
Diffstat (limited to 'pkgs/development/python-modules')
-rw-r--r--pkgs/development/python-modules/wxPython/2.8.nix25
-rw-r--r--pkgs/development/python-modules/wxPython/3.0.nix30
-rw-r--r--pkgs/development/python-modules/wxPython/builder.sh22
-rw-r--r--pkgs/development/python-modules/wxPython/builder3.0.sh22
-rw-r--r--pkgs/development/python-modules/wxPython/generic.nix32
5 files changed, 42 insertions, 89 deletions
diff --git a/pkgs/development/python-modules/wxPython/2.8.nix b/pkgs/development/python-modules/wxPython/2.8.nix
index a6fd0100f587..4a464e572b80 100644
--- a/pkgs/development/python-modules/wxPython/2.8.nix
+++ b/pkgs/development/python-modules/wxPython/2.8.nix
@@ -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;
- };
-}
+})
diff --git a/pkgs/development/python-modules/wxPython/3.0.nix b/pkgs/development/python-modules/wxPython/3.0.nix
index 4974daebb2bb..6892d7e87298 100644
--- a/pkgs/development/python-modules/wxPython/3.0.nix
+++ b/pkgs/development/python-modules/wxPython/3.0.nix
@@ -1,29 +1,9 @@
-{ stdenv, fetchurl, pkgconfig, wxGTK, pythonPackages, openglSupport ? true, python, isPyPy }:
+{ callPackage, ... } @ args:
-assert wxGTK.unicode;
+callPackage ./generic.nix (args // rec {
-with stdenv.lib;
+ version = "3.0.2.0";
-let version = "3.0.0.0"; in
+ sha256 = "0qfzx3sqx4mwxv99sfybhsij4b5pc03ricl73h4vhkzazgjjjhfm";
-if isPyPy then throw "wxPython-${version} not supported for interpreter ${python.executable}" else 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; };
-
- meta = {
- platforms = stdenv.lib.platforms.all;
- };
-} \ No newline at end of file
+})
diff --git a/pkgs/development/python-modules/wxPython/builder.sh b/pkgs/development/python-modules/wxPython/builder.sh
deleted file mode 100644
index 1ad71e3b9cdc..000000000000
--- a/pkgs/development/python-modules/wxPython/builder.sh
+++ /dev/null
@@ -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
diff --git a/pkgs/development/python-modules/wxPython/builder3.0.sh b/pkgs/development/python-modules/wxPython/builder3.0.sh
deleted file mode 100644
index 7403c67d0912..000000000000
--- a/pkgs/development/python-modules/wxPython/builder3.0.sh
+++ /dev/null
@@ -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
diff --git a/pkgs/development/python-modules/wxPython/generic.nix b/pkgs/development/python-modules/wxPython/generic.nix
new file mode 100644
index 000000000000..8990f5cf4d1b
--- /dev/null
+++ b/pkgs/development/python-modules/wxPython/generic.nix
@@ -0,0 +1,32 @@
+{ 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
+ '';
+
+ passthru = { inherit wxGTK openglSupport; };
+}