From 9c161c21e73b09ccc2d973ffb18a656e520651e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Tue, 12 Aug 2008 15:10:53 +0000 Subject: [PATCH] Add PIL, the Python Imaging Library. svn path=/nixpkgs/trunk/; revision=12597 --- .../python-modules/imaging/default.nix | 41 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 4 ++ 2 files changed, 45 insertions(+) create mode 100644 pkgs/development/python-modules/imaging/default.nix diff --git a/pkgs/development/python-modules/imaging/default.nix b/pkgs/development/python-modules/imaging/default.nix new file mode 100644 index 00000000000..e4586762527 --- /dev/null +++ b/pkgs/development/python-modules/imaging/default.nix @@ -0,0 +1,41 @@ +{ fetchurl, stdenv, python +, libjpeg, zlib, freetype }: + +let version = "1.1.6"; +in + stdenv.mkDerivation { + name = "python-imaging-${version}"; + src = fetchurl { + url = "http://effbot.org/downloads/Imaging-${version}.tar.gz"; + sha256 = "141zidl3s9v4vfi3nsbg42iq1lc2a932gprqr1kij5hrnn53bmvx"; + }; + + buildInputs = [ python libjpeg zlib freetype ]; + + doCheck = true; + + configurePhase = '' + 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 ;' + ''; + + buildPhase = "python setup.py build_ext -i"; + checkPhase = "python selftest.py"; + installPhase = "python setup.py install --prefix=$out"; + + 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"; + }; + } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index fe916a8fa99..063b9ba072f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4513,6 +4513,10 @@ let pkgs = rec { inherit (gtkLibs) glib gtk; }; + pyimaging = import ../development/python-modules/imaging { + inherit fetchurl stdenv python libjpeg zlib freetype; + }; + pythonSip = builderDefsPackage (selectVersion ../development/python-modules/python-sip "4.7.4") { python=python25; } null;