From eb42c82f6b27fa9b5545479a58f7a1d597dff244 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Sat, 15 Aug 2015 10:03:12 +0200 Subject: [PATCH 1/4] wxPython: 3.0.0.0 -> 3.0.2.0 --- pkgs/development/python-modules/wxPython/3.0.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/wxPython/3.0.nix b/pkgs/development/python-modules/wxPython/3.0.nix index 4974daebb2b..2ef62b87cc5 100644 --- a/pkgs/development/python-modules/wxPython/3.0.nix +++ b/pkgs/development/python-modules/wxPython/3.0.nix @@ -4,7 +4,7 @@ assert wxGTK.unicode; with stdenv.lib; -let version = "3.0.0.0"; in +let version = "3.0.2.0"; in if isPyPy then throw "wxPython-${version} not supported for interpreter ${python.executable}" else stdenv.mkDerivation { name = "wxPython-${version}"; @@ -13,7 +13,7 @@ if isPyPy then throw "wxPython-${version} not supported for interpreter ${python src = fetchurl { url = "mirror://sourceforge/wxpython/wxPython-src-${version}.tar.bz2"; - sha256 = "af88695e820dd914e8375dc91ecb736f6fb605979bb38460ace61bbea494dc11"; + sha256 = "0qfzx3sqx4mwxv99sfybhsij4b5pc03ricl73h4vhkzazgjjjhfm"; }; buildInputs = [ pkgconfig wxGTK (wxGTK.gtk) pythonPackages.python pythonPackages.wrapPython ] @@ -26,4 +26,4 @@ if isPyPy then throw "wxPython-${version} not supported for interpreter ${python meta = { platforms = stdenv.lib.platforms.all; }; -} \ No newline at end of file +} From 9a0f8b5a4f27623c81ef87499d6aea541f831079 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Wed, 2 Sep 2015 19:40:38 +0200 Subject: [PATCH 2/4] wxPython-3: refactor --- .../python-modules/wxPython/3.0.nix | 31 ++++++++++--------- .../python-modules/wxPython/builder3.0.sh | 22 ------------- 2 files changed, 17 insertions(+), 36 deletions(-) delete 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 index 2ef62b87cc5..7cb05c59db6 100644 --- a/pkgs/development/python-modules/wxPython/3.0.nix +++ b/pkgs/development/python-modules/wxPython/3.0.nix @@ -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; -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}"; - - builder = ./builder3.0.sh; - + src = fetchurl { url = "mirror://sourceforge/wxpython/wxPython-src-${version}.tar.bz2"; sha256 = "0qfzx3sqx4mwxv99sfybhsij4b5pc03ricl73h4vhkzazgjjjhfm"; }; - - buildInputs = [ pkgconfig wxGTK (wxGTK.gtk) pythonPackages.python pythonPackages.wrapPython ] - ++ optional openglSupport pythonPackages.pyopengl; + + 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; }; - - meta = { - platforms = stdenv.lib.platforms.all; - }; } 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 7403c67d091..00000000000 --- 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 From f6a875d5ae12c8ef6587a3a632640225a13aca1b Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Sat, 5 Sep 2015 12:58:00 +0200 Subject: [PATCH 3/4] wxPython: refactor to generic --- .../python-modules/wxPython/2.8.nix | 25 +++----------- .../python-modules/wxPython/3.0.nix | 31 +++-------------- .../python-modules/wxPython/builder.sh | 22 ------------ .../python-modules/wxPython/generic.nix | 34 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 6 ++-- 5 files changed, 47 insertions(+), 71 deletions(-) delete mode 100644 pkgs/development/python-modules/wxPython/builder.sh create mode 100644 pkgs/development/python-modules/wxPython/generic.nix diff --git a/pkgs/development/python-modules/wxPython/2.8.nix b/pkgs/development/python-modules/wxPython/2.8.nix index a6fd0100f58..4a464e572b8 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 7cb05c59db6..6892d7e8729 100644 --- a/pkgs/development/python-modules/wxPython/3.0.nix +++ b/pkgs/development/python-modules/wxPython/3.0.nix @@ -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; }; -} +}) diff --git a/pkgs/development/python-modules/wxPython/builder.sh b/pkgs/development/python-modules/wxPython/builder.sh deleted file mode 100644 index 1ad71e3b9cd..00000000000 --- 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/generic.nix b/pkgs/development/python-modules/wxPython/generic.nix new file mode 100644 index 00000000000..44fe24ae67a --- /dev/null +++ b/pkgs/development/python-modules/wxPython/generic.nix @@ -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; }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 47b9be6bde3..e29be7ac354 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -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; }; From 1fff5d7aa26928f9640a124dedf63303e7ba1641 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Sun, 6 Sep 2015 15:01:47 +0200 Subject: [PATCH 4/4] wxpython: remove redundant attribute `openglSupport` --- pkgs/development/python-modules/wxPython/generic.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkgs/development/python-modules/wxPython/generic.nix b/pkgs/development/python-modules/wxPython/generic.nix index 44fe24ae67a..8990f5cf4d1 100644 --- a/pkgs/development/python-modules/wxPython/generic.nix +++ b/pkgs/development/python-modules/wxPython/generic.nix @@ -28,7 +28,5 @@ buildPythonPackage rec { ${python}/bin/${python.executable} setup.py ${stdenv.lib.concatStringsSep " " setupPyBuildFlags} install --prefix=$out ''; - inherit openglSupport; - passthru = { inherit wxGTK openglSupport; }; }