summaryrefslogtreecommitdiffstats
path: root/pkgs/tools/graphics/pdfread
diff options
context:
space:
mode:
authorLluís Batlle i Rossell <viric@vicerveza.homeunix.net>2010-03-23 23:04:41 +0000
committerLluís Batlle i Rossell <viric@vicerveza.homeunix.net>2010-03-23 23:04:41 +0000
commita991201bf56e3904d267d6e453f9ee0f03017a12 (patch)
tree7a9bc94be1297b1d4b928ac33e56aa78aaade4b7 /pkgs/tools/graphics/pdfread
parent60b8b2b6139c60cbc3c019a6bed377ccf862cde8 (diff)
Adding optipng, and a basic expression for pdfread.
svn path=/nixpkgs/trunk/; revision=20802
Diffstat (limited to 'pkgs/tools/graphics/pdfread')
-rw-r--r--pkgs/tools/graphics/pdfread/default.nix48
1 files changed, 48 insertions, 0 deletions
diff --git a/pkgs/tools/graphics/pdfread/default.nix b/pkgs/tools/graphics/pdfread/default.nix
new file mode 100644
index 000000000000..1fc14445bbdb
--- /dev/null
+++ b/pkgs/tools/graphics/pdfread/default.nix
@@ -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";
+ };
+}