Adding optipng, and a basic expression for pdfread.

svn path=/nixpkgs/trunk/; revision=20802
This commit is contained in:
Lluís Batlle i Rossell 2010-03-23 23:04:41 +00:00
parent 60b8b2b613
commit a991201bf5
3 changed files with 75 additions and 0 deletions

View File

@ -0,0 +1,18 @@
{ stdenv, fetchurl }:
# This package comes with its own copy of zlib, libpng and pngxtern
stdenv.mkDerivation rec {
name = "optipng-0.6.4";
src = fetchurl {
url = "mirror://sourceforge/optipng/${name}.tar.gz";
sha256 = "0ivnm07zlww20i7dba0zk5dyg8f3hlj03j7vazq520r43lmqj01h";
};
meta = {
homepage = http://optipng.sourceforge.net/;
description = "A PNG optimizer";
license = "bsd";
};
}

View File

@ -0,0 +1,48 @@
{stdenv, fetchurl, unzip, python, makeWrapper, ghostscript, pngnq, pil, djvulibre
, optipng, unrar}:
stdenv.mkDerivation {
name = "pdfread-1.8.2";
src = fetchurl {
# I got it from http://www.mobileread.com/forums/showthread.php?t=21906
# But that needs user registration to allow downloading.
# This is an evolution from pdfread 1.7 in http://pdfread.sourceforge.net/
# Temporary place:
url = http://vicerveza.homeunix.net/~viric/soft/PDFRead-1.8.2-Source-noGUI-noInstaller.zip;
sha256 = "0mzxpnk97f0ww5ds7h4wsval3g4lnrhv6rhspjs7cy4i41gmk8an";
};
buildInputs = [ unzip python makeWrapper ];
phases = "unpackPhase patchPhase installPhase";
unpackPhase = ''
unzip $src
sourceRoot=`pwd`/PDFRead/src
'';
patchPhase = ''
sed -i 's,#!/usr.*,#!${python}/bin/python,' pdfread.py
'';
installPhase = ''
ensureDir $out/bin
cp pdfread.py $out/bin
chmod +x $out/bin/pdfread.py
LIBSUFFIX=lib/${python.libPrefix}/site-packages/
PYDIR=$out/$LIBSUFFIX
ensureDir $PYDIR
cp -R *.py pylrs $PYDIR
wrapProgram $out/bin/pdfread.py --prefix PYTHONPATH : $PYTHONPATH:${pil}/$LIBSUFFIX/PIL:$PYDIR \
--prefix PATH : ${ghostscript}/bin:${pngnq}/bin:${djvulibre}/bin:${unrar}/bin:${optipng}/bin
'';
meta = {
description = "PDF/DJVU to ebook format converter";
homepage = http://www.mobileread.com/forums/showthread.php?t=21906;
license = "bsd";
};
}

View File

@ -1275,6 +1275,10 @@ let
inherit fetchurl stdenv iproute lzo openssl nettools;
};
optipng = import ../tools/graphics/optipng {
inherit fetchurl stdenv;
};
p7zip = import ../tools/archivers/p7zip {
inherit fetchurl stdenv;
};
@ -1318,6 +1322,11 @@ let
inherit fetchurl stdenv;
};
pdfread = import ../tools/graphics/pdfread {
inherit stdenv fetchurl unzip python makeWrapper ghostscript pngnq pil
djvulibre unrar optipng;
};
pg_top = import ../tools/misc/pg_top {
inherit fetchurl stdenv ncurses postgresql;
};