|
1 |
| -{ stdenv, lib, fetchurl, fetchpatch, pkgconfig |
2 |
| -, freetype, harfbuzz, openjpeg, jbig2dec, libjpeg |
3 |
| -, enableX11 ? true, libX11, libXext |
| 1 | +{ stdenv, lib, fetchurl, fetchpatch, pkgconfig, freetype, harfbuzz, openjpeg |
| 2 | +, jbig2dec, libjpeg , darwin |
| 3 | +, enableX11 ? true, libX11, libXext, libXi, libXrandr |
4 | 4 | , enableCurl ? true, curl, openssl
|
| 5 | +, enableGL ? true, freeglut, mesa_glu |
5 | 6 | }:
|
6 | 7 |
|
7 | 8 | let
|
|
13 | 14 |
|
14 | 15 |
|
15 | 16 | in stdenv.mkDerivation rec {
|
16 |
| - version = "1.11"; |
| 17 | + version = "1.12.0"; |
17 | 18 | name = "mupdf-${version}";
|
18 | 19 |
|
19 | 20 | src = fetchurl {
|
20 | 21 | url = "http://mupdf.com/downloads/archive/${name}-source.tar.gz";
|
21 |
| - sha256 = "02phamcchgsmvjnb3ir7r5sssvx9fcrscn297z73b82n1jl79510"; |
| 22 | + sha256 = "0mc7a92zri27lk17wdr2iffarbfi4lvrmxhc53sz84hm5yl56qsw"; |
22 | 23 | };
|
23 | 24 |
|
24 | 25 | patches = [
|
25 | 26 | # Compatibility with new openjpeg
|
26 | 27 | (fetchpatch {
|
27 |
| - name = "mupdf-1.11-openjpeg-version.patch"; |
28 |
| - url = "https://git.archlinux.org/svntogit/community.git/plain/trunk/0001-mupdf-openjpeg.patch?h=packages/mupdf&id=c19349f42838e4dca02e564b97e0a5ab3e1b943f"; |
29 |
| - sha256 = "0sx7jq84sr8bj6sg2ahg9cdgqz8dh4w6r0ah2yil8vrsznn4la8r"; |
| 28 | + name = "mupdf-1.12-openjpeg-version.patch"; |
| 29 | + url = "https://git.archlinux.org/svntogit/community.git/plain/trunk/0001-mupdf-openjpeg.patch?h=packages/mupdf&id=a910cd33a2b311712f83710dc042fbe80c104306"; |
| 30 | + sha256 = "05i9v2ia586jyjqdb7g68ss4vkfwgp6cwhagc8zzggsba83azyqk"; |
30 | 31 | })
|
| 32 | + ] |
31 | 33 |
|
32 |
| - (fetchurl { |
33 |
| - name = "mupdf-1.11-CVE-2017-6060.patch"; |
34 |
| - url = "http://git.ghostscript.com/?p=mupdf.git;a=blobdiff_plain;f=platform/x11/jstest_main.c;h=f158d9628ed0c0a84e37fe128277679e8334422a;hp=13c3a0a3ba3ff4aae29f6882d23740833c1d842f;hb=06a012a42c9884e3cd653e7826cff1ddec04eb6e;hpb=34e18d127a02146e3415b33c4b67389ce1ddb614"; |
35 |
| - sha256 = "163bllvjrbm0gvjb25lv7b6sih4zr4g4lap3h0cbq8dvpjxx0jfc"; |
36 |
| - }) |
37 |
| - |
38 |
| - (fetchpatch { |
39 |
| - name = "mupdf-1.11-shared_libs-1.patch"; |
40 |
| - url = "https://ftp.osuosl.org/pub/blfs/conglomeration/mupdf/mupdf-1.11-shared_libs-1.patch"; |
41 |
| - sha256 = "127x8jhyj3i9cn3mxw9mm5barw2yk43rvmghg54bhn4rjalx857j"; |
42 |
| - }) |
| 34 | + # Use shared libraries to decrease size |
| 35 | + ++ stdenv.lib.optional (!stdenv.isDarwin) ./mupdf-1.12-shared_libs-1.patch |
43 | 36 |
|
44 |
| - (fetchurl { |
45 |
| - name = "mupdf-1.11-CVE-2017-14685.patch"; |
46 |
| - url = "http://git.ghostscript.com/?p=mupdf.git;a=patch;h=ab1a420613dec93c686acbee2c165274e922f82a"; |
47 |
| - sha256 = "120xapwj0af333n3a32ypxk0jmjv2ia476jg8pzsfqk9a5qqkx46"; |
48 |
| - }) |
49 |
| - |
50 |
| - (fetchurl { |
51 |
| - name = "mupdf-1.11-CVE-2017-14686.patch"; |
52 |
| - url = "http://git.ghostscript.com/?p=mupdf.git;a=patch;h=0f0fbc07d9be31f5e83ec5328d7311fdfd8328b1"; |
53 |
| - sha256 = "0pkn7mfqhmnsyia4rh4mw4q435bzvlc22crqa1bxpaa0gcyky51c"; |
54 |
| - }) |
55 |
| - |
56 |
| - (fetchurl { |
57 |
| - name = "mupdf-1.11-CVE-2017-14687.patch"; |
58 |
| - url = "http://git.ghostscript.com/?p=mupdf.git;a=patch;h=2b16dbd8f73269cb15ca61ece75cf8d2d196ed28"; |
59 |
| - sha256 = "01v41cwrdnz3k32fcadk2gk4knqrm3mavzp6pxhn19nwgmqkshjd"; |
60 |
| - }) |
61 |
| - |
62 |
| - (fetchurl { |
63 |
| - name = "mupdf-1.11-CVE-2017-15587.patch"; |
64 |
| - url = "http://git.ghostscript.com/?p=mupdf.git;a=patch;h=82df2631d7d0446b206ea6b434ea609b6c28b0e8"; |
65 |
| - sha256 = "04kfww7y0wazg6372g44fa2k5kiiigq4616ihkvmp18rz86903n9"; |
66 |
| - }) |
67 |
| - |
68 |
| - (fetchurl { |
69 |
| - name = "mupdf-1.11-CVE-2017-15369.patch"; |
70 |
| - url = "http://git.ghostscript.com/?p=mupdf.git;a=patch;h=c2663e51238ec8256da7fc61ad580db891d9fe9a"; |
71 |
| - sha256 = "0xx2mrbjcymi3gh0l3cq81m6bygp9dv79v1kyrbcvpl5z6wgl71y"; |
72 |
| - }) |
73 |
| - ]; |
| 37 | + ++ stdenv.lib.optional stdenv.isDarwin ./darwin.patch |
| 38 | + ; |
74 | 39 |
|
75 | 40 | postPatch = ''
|
76 | 41 | sed -i "s/__OPENJPEG__VERSION__/${openJpegVersion}/" source/fitz/load-jpx.c
|
77 | 42 | '';
|
78 | 43 |
|
79 | 44 | makeFlags = [ "prefix=$(out)" ];
|
80 | 45 | nativeBuildInputs = [ pkgconfig ];
|
81 |
| - buildInputs = [ freetype harfbuzz openjpeg jbig2dec libjpeg ] |
82 |
| - ++ lib.optionals enableX11 [ libX11 libXext ] |
83 |
| - ++ lib.optionals enableCurl [ curl openssl ]; |
| 46 | + buildInputs = [ freetype harfbuzz openjpeg jbig2dec libjpeg freeglut mesa_glu ] |
| 47 | + ++ lib.optionals enableX11 [ libX11 libXext libXi libXrandr ] |
| 48 | + ++ lib.optionals enableCurl [ curl openssl ] |
| 49 | + ++ lib.optionals enableGL ( |
| 50 | + if stdenv.isDarwin then |
| 51 | + with darwin.apple_sdk.frameworks; [ GLUT OpenGL ] |
| 52 | + else |
| 53 | + [ freeglut mesa_glu ]) |
| 54 | + ; |
84 | 55 | outputs = [ "bin" "dev" "out" "man" "doc" ];
|
85 | 56 |
|
86 | 57 | preConfigure = ''
|
@@ -123,6 +94,6 @@ in stdenv.mkDerivation rec {
|
123 | 94 | description = "Lightweight PDF, XPS, and E-book viewer and toolkit written in portable C";
|
124 | 95 | license = licenses.agpl3Plus;
|
125 | 96 | maintainers = with maintainers; [ viric vrthra fpletz ];
|
126 |
| - platforms = platforms.linux; |
| 97 | + platforms = platforms.unix; |
127 | 98 | };
|
128 | 99 | }
|
0 commit comments