2021-01-11 07:54:33 +00:00
|
|
|
{lib, stdenv, fetchurl, unzip, python, makeWrapper, ghostscript, pngnq, pillow, djvulibre
|
2010-03-23 23:04:41 +00:00
|
|
|
, 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:
|
2020-04-01 02:11:51 +01:00
|
|
|
url = "http://vicerveza.homeunix.net/~viric/soft/PDFRead-1.8.2-Source-noGUI-noInstaller.zip";
|
2010-03-23 23:04:41 +00:00
|
|
|
sha256 = "0mzxpnk97f0ww5ds7h4wsval3g4lnrhv6rhspjs7cy4i41gmk8an";
|
|
|
|
};
|
|
|
|
|
2021-02-07 09:17:39 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = [ unzip python ];
|
2010-03-23 23:04:41 +00:00
|
|
|
|
2015-12-08 14:14:45 +00:00
|
|
|
broken = true; # Not found.
|
|
|
|
|
2010-03-23 23:04:41 +00:00
|
|
|
phases = "unpackPhase patchPhase installPhase";
|
|
|
|
|
|
|
|
unpackPhase = ''
|
|
|
|
unzip $src
|
|
|
|
sourceRoot=`pwd`/PDFRead/src
|
|
|
|
'';
|
|
|
|
|
|
|
|
patchPhase = ''
|
|
|
|
sed -i 's,#!/usr.*,#!${python}/bin/python,' pdfread.py
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2012-01-18 20:16:00 +00:00
|
|
|
mkdir -p $out/bin
|
2010-03-23 23:04:41 +00:00
|
|
|
cp pdfread.py $out/bin
|
|
|
|
chmod +x $out/bin/pdfread.py
|
|
|
|
|
|
|
|
LIBSUFFIX=lib/${python.libPrefix}/site-packages/
|
|
|
|
PYDIR=$out/$LIBSUFFIX
|
2012-01-18 20:16:00 +00:00
|
|
|
mkdir -p $PYDIR
|
2010-03-23 23:04:41 +00:00
|
|
|
cp -R *.py pylrs $PYDIR
|
|
|
|
|
2015-12-08 14:14:59 +00:00
|
|
|
wrapProgram $out/bin/pdfread.py --prefix PYTHONPATH : $PYTHONPATH:${pillow}/$LIBSUFFIX/PIL:$PYDIR \
|
2021-01-15 09:19:50 +00:00
|
|
|
--prefix PATH : ${lib.makeBinPath [ ghostscript pngnq djvulibre unrar optipng ]}
|
2010-03-23 23:04:41 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2010-03-23 23:04:41 +00:00
|
|
|
description = "PDF/DJVU to ebook format converter";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://www.mobileread.com/forums/showthread.php?t=21906";
|
2015-06-10 12:00:11 +01:00
|
|
|
license = licenses.mit;
|
2010-03-23 23:04:41 +00:00
|
|
|
};
|
|
|
|
}
|