Merge pull request #11553 from FRidh/pil

WIP: remove PIL as dependency
This commit is contained in:
Domen Kožar 2015-12-08 22:15:05 +01:00
commit 4b0fcf8ea1
10 changed files with 28 additions and 125 deletions

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, buildPythonPackage, pygtk, pil, python27Packages }:
{ stdenv, fetchurl, buildPythonPackage, python27Packages }:
buildPythonPackage rec {
namePrefix = "";
@ -9,7 +9,7 @@ buildPythonPackage rec {
sha256 = "0k3pqbvk08kb1nr0qldaj9bc7ca6rvcycgfi2n7gqmsirq5kscys";
};
pythonPath = [ pygtk pil python27Packages.sqlite3 ];
propagatedBuildInputs = with python27Packages; [ pygtk pillow sqlite3 ];
meta = {
description = "Image viewer designed to handle comic books";

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, buildPythonPackage, python, pygtk, pil, libX11, gettext }:
{ stdenv, fetchurl, buildPythonPackage, python, pygtk, pillow, libX11, gettext }:
buildPythonPackage rec {
namePrefix = "";
@ -17,7 +17,7 @@ buildPythonPackage rec {
sed -i "s@/usr/local/share/locale@$out/share/locale@" mirage.py
'';
pythonPath = [ pygtk pil ];
propagatedBuildInputs = [ pygtk pillow ];
meta = {
description = "Simple image viewer written in PyGTK";

View File

@ -1,6 +1,6 @@
{ stdenv, fetchurl, python, pyqt5, sip_4_16, poppler_utils, pkgconfig, libpng
, imagemagick, libjpeg, fontconfig, podofo, qt5, icu, sqlite
, pil, makeWrapper, unrar, chmlib, pythonPackages, xz, libusb1, libmtp
, makeWrapper, unrar, chmlib, pythonPackages, xz, libusb1, libmtp
, xdg_utils
}:
@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
buildInputs =
[ python pyqt5 sip_4_16 poppler_utils libpng imagemagick libjpeg
fontconfig podofo qt5.base pil chmlib icu sqlite libusb1 libmtp xdg_utils
fontconfig podofo qt5.base chmlib icu sqlite libusb1 libmtp xdg_utils
pythonPackages.mechanize pythonPackages.lxml pythonPackages.dateutil
pythonPackages.cssutils pythonPackages.beautifulsoup pythonPackages.pillow
pythonPackages.sqlite3 pythonPackages.netifaces pythonPackages.apsw

View File

@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
pythonPackages.twisted
pythonPackages.gmpy
pythonPackages.netifaces
pythonPackages.pil
pythonPackages.pillow
pythonPackages.pycrypto
pythonPackages.pyasn1
pythonPackages.requests

View File

@ -1,5 +1,5 @@
{ fetchurl, stdenv, python, makeWrapper, lib
, xpdf, pil, pyopengl, pygame
, xpdf, pillow, pyopengl, pygame
, setuptools, mesa, freeglut }:
let version = "0.10.5";
@ -17,7 +17,7 @@ in
# Note: We need to have `setuptools' in the path to be able to use
# PyOpenGL.
buildInputs = [ makeWrapper xpdf pil pyopengl pygame ];
buildInputs = [ makeWrapper xpdf pillow pyopengl pygame ];
configurePhase = ''
sed -i "impressive.py" \
@ -44,7 +44,7 @@ in
${lib.concatStringsSep ":"
(map (path:
path + "/lib/${python.libPrefix}/site-packages")
[ pil pyopengl pygame setuptools ])} \
[ pillow pyopengl pygame setuptools ])} \
--prefix LIBRARY_PATH ":" "${mesa}/lib:${freeglut}/lib"
'';

View File

@ -1,45 +0,0 @@
{stdenv, fetchurl, python, pil, pygame, SDL} @ args: with args;
stdenv.mkDerivation {
name = "thePenguinMachine";
src = fetchurl {
url = http://www.migniot.com/matrix/projects/thepenguinmachine/ThePenguinMachine.tar.gz;
sha256 = "09ljks8vj75g00h3azc83yllbfsrxwmv1c9g32gylcmsshik0dqv";
};
broken = true; # Not found
buildInputs = [python pil pygame SDL];
configurePhase = ''
sed -e "/includes = /aincludes.append('${SDL}/include/SDL')" -i setup.py;
sed -e "/includes = /aincludes.append('$(echo ${pygame}/include/python*)')" -i setup.py;
cat setup.py;
export NIX_LDFLAGS="$NIX_LDFLAGS -lgcc_s"
'';
buildPhase = ''
sed -e "s/pygame.display.toggle_fullscreen.*/pass;/" -i tpm/Application.py
sed -e 's@"Surface"@"pygame.Surface"@' -i src/surfutils.c
python setup.py build;
python setup.py build_clib;
python setup.py build_ext;
python setup.py build_py;
python setup.py build_scripts;
'';
installPhase = ''
python setup.py install --prefix=$out
mkdir -p "$out"/share/tpm/
cp -r . "$out"/share/tpm/build-dir
mkdir -p "$out/bin"
echo "#! /bin/sh" >> "$out/bin/tpm"
echo "export PYTHONPATH=\"\$PYTHONPATH:$PYTHONPATH:$(echo ${pil}/lib/python*/site-packages/PIL)\"" >> "$out/bin/tpm"
echo "cd \"$out/share/tpm/build-dir\"" >> "$out/bin/tpm"
echo "export PYTHONPATH=\"\$PYTHONPATH:$PYTHONPATH:$(echo ${pil}/lib/python*/site-packages/PIL)\"" >> "$out/bin/tpm"
echo "${python}/bin/python \"$out\"/share/tpm/build-dir/ThePenguinMachine.py \"\$@\"" >> "$out/bin/tpm"
chmod a+x "$out/bin/tpm"
'';
meta = {
description = "An Incredible Machine clone";
};
}

View File

@ -1,8 +1,8 @@
{ stdenv, fetchurl, buildPythonPackage, pythonPackages
, python, cython, pkgconfig
, xorg, gtk, glib, pango, cairo, gdk_pixbuf, pygtk, atk, pygobject, pycairo
, xorg, gtk, glib, pango, cairo, gdk_pixbuf, atk, pycairo
, makeWrapper, xkbcomp, xorgserver, getopt, xauth, utillinux, which, fontsConf, xkeyboard_config
, ffmpeg, x264, libvpx, pil, libwebp
, ffmpeg, x264, libvpx, libwebp
, libfakeXinerama }:
buildPythonPackage rec {
@ -29,8 +29,8 @@ buildPythonPackage rec {
makeWrapper
];
propagatedBuildInputs = [
pil pygtk pygobject pythonPackages.rencode
propagatedBuildInputs = with pythonPackages; [
pillow pygtk pygobject
];
postPatch = ''

View File

@ -1,4 +1,4 @@
{stdenv, fetchurl, unzip, python, makeWrapper, ghostscript, pngnq, pil, djvulibre
{stdenv, fetchurl, unzip, python, makeWrapper, ghostscript, pngnq, pillow, djvulibre
, optipng, unrar}:
stdenv.mkDerivation {
@ -15,6 +15,8 @@ stdenv.mkDerivation {
buildInputs = [ unzip python makeWrapper ];
broken = true; # Not found.
phases = "unpackPhase patchPhase installPhase";
unpackPhase = ''
@ -36,7 +38,7 @@ stdenv.mkDerivation {
mkdir -p $PYDIR
cp -R *.py pylrs $PYDIR
wrapProgram $out/bin/pdfread.py --prefix PYTHONPATH : $PYTHONPATH:${pil}/$LIBSUFFIX/PIL:$PYDIR \
wrapProgram $out/bin/pdfread.py --prefix PYTHONPATH : $PYTHONPATH:${pillow}/$LIBSUFFIX/PIL:$PYDIR \
--prefix PATH : ${ghostscript}/bin:${pngnq}/bin:${djvulibre}/bin:${unrar}/bin:${optipng}/bin
'';

View File

@ -2679,7 +2679,9 @@ let
jbig2enc = callPackage ../tools/graphics/jbig2enc { };
pdfread = callPackage ../tools/graphics/pdfread { };
pdfread = callPackage ../tools/graphics/pdfread {
inherit (pythonPackages) pillow;
};
briss = callPackage ../tools/graphics/briss { };
@ -8996,8 +8998,6 @@ let
numeric = callPackage ../development/python-modules/numeric { };
pil = pythonPackages.pil;
psyco = callPackage ../development/python-modules/psyco { };
pycairo = pythonPackages.pycairo;
@ -12120,6 +12120,7 @@ let
impressive = callPackage ../applications/office/impressive {
# XXX These are the PyOpenGL dependencies, which we need here.
inherit (pythonPackages) pyopengl;
inherit (pythonPackages) pillow;
};
inferno = callPackage_i686 ../applications/inferno { };
@ -12409,7 +12410,10 @@ let
mimms = callPackage ../applications/audio/mimms {};
mirage = callPackage ../applications/graphics/mirage {};
mirage = callPackage ../applications/graphics/mirage {
inherit (pythonPackages) pygtk;
inherit (pythonPackages) pillow;
};
mixxx = callPackage ../applications/audio/mixxx {
inherit (vamp) vampSDK;
@ -14272,8 +14276,6 @@ let
tome4 = callPackage ../games/tome4 { };
tpm = callPackage ../games/thePenguinMachine { };
trackballs = callPackage ../games/trackballs {
debug = false;
guile = guile_1_8;

View File

@ -5119,7 +5119,7 @@ in modules // {
sha256 = "1dnmnkc21zdfaypskbpvkwl0wpkpn0nagj1fc338w64mbxrk8ny7";
};
commonDeps = with self;
propagatedBuildInputs = with self;
[
apipkg
bottle
@ -5135,19 +5135,7 @@ in modules // {
simplejson
sqlite3dbm
timelib
];
pythonPath = commonDeps ++
[
modules.sqlite3
];
propagatedBuildInputs = commonDeps;
buildInputs = with self;
[
pil
] ++ propagatedBuildInputs;
] ++ optionals (!isPy3k) [ modules.sqlite3 ];
meta = {
description = "Library for parsing MediaWiki articles and converting them to different output formats";
@ -13280,50 +13268,6 @@ in modules // {
};
};
pil = buildPythonPackage rec {
name = "PIL-${version}";
version = "1.1.7";
src = pkgs.fetchurl {
url = "http://effbot.org/downloads/Imaging-${version}.tar.gz";
sha256 = "04aj80jhfbmxqzvmq40zfi4z3cw6vi01m3wkk6diz3lc971cfnw9";
};
buildInputs = with self; [ python pkgs.libjpeg pkgs.zlib pkgs.freetype ];
disabled = isPy3k;
postInstall = "ln -s $out/${python.sitePackages} $out/${python.sitePackages}/PIL";
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 ;'
'' + stdenv.lib.optionalString stdenv.isDarwin ''
# Remove impurities
substituteInPlace setup.py \
--replace '"/Library/Frameworks",' "" \
--replace '"/System/Library/Frameworks"' ""
'';
checkPhase = "${python.interpreter} selftest.py";
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 {
name = "Pillow-2.9.0";