pythonPackages.pil: put it inside python-packages.nix and disable on py3k

This commit is contained in:
Domen Kožar 2014-08-24 16:53:52 +02:00
parent 463ca0db3f
commit ecb77869d2
2 changed files with 44 additions and 51 deletions

View file

@ -1,45 +0,0 @@
{ fetchurl, stdenv, python, buildPythonPackage, libjpeg, zlib, freetype }:
let version = "1.1.7"; in
buildPythonPackage {
name = "imaging-${version}";
src = fetchurl {
url = "http://effbot.org/downloads/Imaging-${version}.tar.gz";
sha256 = "04aj80jhfbmxqzvmq40zfi4z3cw6vi01m3wkk6diz3lc971cfnw9";
};
buildInputs = [ python libjpeg zlib freetype ];
doCheck = true;
preConfigure = ''
sed -i "setup.py" \
-e 's|^FREETYPE_ROOT =.*$|FREETYPE_ROOT = libinclude("${freetype}")|g ;
s|^JPEG_ROOT =.*$|JPEG_ROOT = libinclude("${libjpeg}")|g ;
s|^ZLIB_ROOT =.*$|ZLIB_ROOT = libinclude("${zlib}")|g ;'
'';
checkPhase = "${python}/bin/${python.executable} selftest.py";
buildPhase = "${python}/bin/${python.executable} setup.py build_ext -i";
postInstall = ''
cd "$out"/lib/python*/site-packages
ln -s $PWD PIL
'';
meta = {
homepage = http://www.pythonware.com/products/pil/;
description = "The Python Imaging Library (PIL)";
longDescription = ''
The Python Imaging Library (PIL) adds image processing
capabilities to your Python interpreter. This library
supports many file formats, and provides powerful image
processing and graphics capabilities.
'';
license = "http://www.pythonware.com/products/pil/license.htm";
};
}

View file

@ -28,7 +28,7 @@ pythonPackages = modules // import ./python-packages-generated.nix {
# Python packages for all python versions
rec {
inherit python isPy26 isPy27 isPy33 isPy34 isPyPy pythonName;
inherit python isPy26 isPy27 isPy33 isPy34 isPyPy isPy3k pythonName;
inherit (pkgs) fetchurl fetchsvn fetchgit stdenv unzip;
# helpers
@ -112,11 +112,6 @@ rec {
# version of nixpart.
nixpart0 = nixpart;
pil = import ../development/python-modules/pil {
inherit (pkgs) fetchurl stdenv libjpeg zlib freetype;
inherit python buildPythonPackage;
};
pitz = import ../applications/misc/pitz {
inherit (pkgs) stdenv fetchurl;
inherit buildPythonPackage tempita jinja2 pyyaml clepy mock nose decorator docutils;
@ -5447,6 +5442,49 @@ rec {
propagatedBuildInputs = [ unittest2 ];
};
pil = buildPythonPackage rec {
name = "PIL-${version}";
version = "1.1.7";
src = fetchurl {
url = "http://effbot.org/downloads/Imaging-${version}.tar.gz";
sha256 = "04aj80jhfbmxqzvmq40zfi4z3cw6vi01m3wkk6diz3lc971cfnw9";
};
buildInputs = [ python pkgs.libjpeg pkgs.zlib pkgs.freetype ];
disabled = isPy3k;
doCheck = true;
preConfigure = ''
sed -i "setup.py" \
-e 's|^FREETYPE_ROOT =.*$|FREETYPE_ROOT = libinclude("${pkgs.freetype}")|g ;
s|^JPEG_ROOT =.*$|JPEG_ROOT = libinclude("${pkgs.libjpeg}")|g ;
s|^ZLIB_ROOT =.*$|ZLIB_ROOT = libinclude("${pkgs.zlib}")|g ;'
'';
checkPhase = "${python}/bin/${python.executable} selftest.py";
buildPhase = "${python}/bin/${python.executable} setup.py build_ext -i";
postInstall = ''
cd "$out"/lib/python*/site-packages
ln -s $PWD PIL
'';
meta = {
homepage = http://www.pythonware.com/products/pil/;
description = "The Python Imaging Library (PIL)";
longDescription = ''
The Python Imaging Library (PIL) adds image processing
capabilities to your Python interpreter. This library
supports many file formats, and provides powerful image
processing and graphics capabilities.
'';
license = "http://www.pythonware.com/products/pil/license.htm";
};
};
pillow = buildPythonPackage rec {