@@ -4,7 +4,15 @@
44, enableCurl ? true, curl, openssl
55}:
66
7−stdenv.mkDerivation rec {
7+let
8+
9+ # OpenJPEG version is hardcoded in package source
10+ openJpegVersion = with stdenv;
11+ lib.concatStringsSep "." (lib.lists.take 2
12+ (lib.splitString "." (lib.getVersion openjpeg)));
13+
14+
15+in stdenv.mkDerivation rec {
816 version = "1.11";
917 name = "mupdf-${version}";
1018
@@ -16,9 +24,9 @@ stdenv.mkDerivation rec {
1624 patches = [
1725 # Compatibility with new openjpeg
1826 (fetchpatch {
19− name = "mupdf-1.11-openjpeg-2.1.1.patch";
20− url = "https://git.archlinux.org/svntogit/community.git/plain/trunk/0001-mupdf-openjpeg.patch?h=packages/mupdf&id=3d997e7ff2ac20c44856ede22760ba6fbca81a5c";
21− sha256 = "1vr12kpzmmfr8pp3scwfhrm5laqwd58xm6vx971c4y8bxy60b2ig";
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";
2230 })
2331
2432 (fetchurl {
@@ -58,6 +66,10 @@ stdenv.mkDerivation rec {
5866 })
5967 ];
6068
69+ postPatch = ''
70+ sed -i "s/__OPENJPEG__VERSION__/${openJpegVersion}/" source/fitz/load-jpx.c
71+ '';
72+
6173 makeFlags = [ "prefix=$(out)" ];
6274 nativeBuildInputs = [ pkgconfig ];
6375 buildInputs = [ freetype harfbuzz openjpeg jbig2dec libjpeg ]