2010-08-09 21:59:38 +01:00
|
|
|
{ stdenv, fetchurl, pkgconfig, zlib, freetype, libjpeg, jbig2dec, openjpeg
|
|
|
|
, libX11, libXext }:
|
|
|
|
stdenv.mkDerivation rec {
|
2013-08-29 18:29:22 +01:00
|
|
|
name = "mupdf-1.3";
|
2010-08-09 21:59:38 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2012-10-04 07:37:54 +01:00
|
|
|
url = "http://mupdf.com/download/archive/${name}-source.tar.gz";
|
2013-08-29 18:29:22 +01:00
|
|
|
sha256 = "0y247nka5gkr1ajn47jrlp5rcnf6h4ff7dfsprma3h4wxqdv7a5b";
|
2010-08-09 21:59:38 +01:00
|
|
|
};
|
|
|
|
|
2014-03-06 20:21:03 +00:00
|
|
|
patches = [(fetchurl {
|
|
|
|
name = "CVE-2014-2013.patch";
|
|
|
|
url = "http://git.ghostscript.com/?p=mupdf.git;a=commitdiff_plain;"
|
|
|
|
+ "h=60dabde18d7fe12b19da8b509bdfee9cc886aafc";
|
|
|
|
sha256 = "1walj3wir9x50i6lph33bx14c8593r9xrn08gkd3v7r6d15lmjps";
|
|
|
|
})];
|
|
|
|
|
2010-08-09 21:59:38 +01:00
|
|
|
buildInputs = [ pkgconfig zlib freetype libjpeg jbig2dec openjpeg libX11 libXext ];
|
|
|
|
|
2013-11-05 13:44:54 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2010-08-09 21:59:38 +01:00
|
|
|
preBuild = ''
|
2013-11-05 13:44:54 +00:00
|
|
|
export makeFlags="prefix=$out build=release"
|
2012-10-04 07:37:54 +01:00
|
|
|
export NIX_CFLAGS_COMPILE=" $NIX_CFLAGS_COMPILE -I$(echo ${openjpeg}/include/openjpeg-*) "
|
2010-08-09 21:59:38 +01:00
|
|
|
'';
|
|
|
|
|
2013-08-29 18:29:22 +01:00
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/share/applications
|
|
|
|
cat > $out/share/applications/mupdf.desktop <<EOF
|
|
|
|
[Desktop Entry]
|
|
|
|
Type=Application
|
|
|
|
Version=1.0
|
|
|
|
Name=mupdf
|
|
|
|
Comment=PDF viewer
|
|
|
|
Exec=$out/bin/mupdf-x11
|
|
|
|
Terminal=false
|
|
|
|
EOF
|
|
|
|
'';
|
|
|
|
|
2010-08-09 21:59:38 +01:00
|
|
|
meta = {
|
|
|
|
homepage = http://mupdf.com/;
|
|
|
|
description = "Lightweight PDF viewer and toolkit written in portable C";
|
|
|
|
license = "GPLv3+";
|
|
|
|
maintainers = with stdenv.lib.maintainers; [ viric ];
|
|
|
|
platforms = with stdenv.lib.platforms; linux;
|
|
|
|
};
|
|
|
|
}
|