2014-05-17 12:14:52 +02:00
|
|
|
{ stdenv, fetchurl, fetchpatch, pkgconfig, zlib, freetype, libjpeg, jbig2dec, openjpeg
|
2010-08-09 22:59:38 +02:00
|
|
|
, libX11, libXext }:
|
|
|
|
stdenv.mkDerivation rec {
|
2013-08-29 19:29:22 +02:00
|
|
|
name = "mupdf-1.3";
|
2010-08-09 22:59:38 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
2012-10-04 08:37:54 +02:00
|
|
|
url = "http://mupdf.com/download/archive/${name}-source.tar.gz";
|
2013-08-29 19:29:22 +02:00
|
|
|
sha256 = "0y247nka5gkr1ajn47jrlp5rcnf6h4ff7dfsprma3h4wxqdv7a5b";
|
2010-08-09 22:59:38 +02:00
|
|
|
};
|
|
|
|
|
2014-05-17 12:14:52 +02:00
|
|
|
patches = [(fetchpatch {
|
2014-03-06 21:21:03 +01:00
|
|
|
name = "CVE-2014-2013.patch";
|
|
|
|
url = "http://git.ghostscript.com/?p=mupdf.git;a=commitdiff_plain;"
|
|
|
|
+ "h=60dabde18d7fe12b19da8b509bdfee9cc886aafc";
|
2014-05-17 12:14:52 +02:00
|
|
|
sha256 = "0p721f3g2djz9fy6rcgj83c20f5k257wg2d0yvvmp02m7sp06l0g";
|
2014-03-06 21:21:03 +01:00
|
|
|
})];
|
|
|
|
|
2010-08-09 22:59:38 +02:00
|
|
|
buildInputs = [ pkgconfig zlib freetype libjpeg jbig2dec openjpeg libX11 libXext ];
|
|
|
|
|
2013-11-05 14:44:54 +01:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2010-08-09 22:59:38 +02:00
|
|
|
preBuild = ''
|
2014-05-17 14:14:07 +02:00
|
|
|
export makeFlags="prefix=$out build=release XCFLAGS=-fpic"
|
2012-10-04 08:37:54 +02:00
|
|
|
export NIX_CFLAGS_COMPILE=" $NIX_CFLAGS_COMPILE -I$(echo ${openjpeg}/include/openjpeg-*) "
|
2010-08-09 22:59:38 +02:00
|
|
|
'';
|
|
|
|
|
2013-08-29 19:29:22 +02: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 22:59:38 +02:00
|
|
|
meta = {
|
|
|
|
homepage = http://mupdf.com/;
|
2014-04-03 06:55:17 +02:00
|
|
|
repositories.git = git://git.ghostscript.com/mupdf.git;
|
2010-08-09 22:59:38 +02:00
|
|
|
description = "Lightweight PDF viewer and toolkit written in portable C";
|
|
|
|
license = "GPLv3+";
|
|
|
|
maintainers = with stdenv.lib.maintainers; [ viric ];
|
|
|
|
platforms = with stdenv.lib.platforms; linux;
|
|
|
|
};
|
|
|
|
}
|