mupdf: 1.13.0 -> 1.14.0

Changelog: https://mupdf.com/release_history.html
gstqt5
Daniël de Kok 2018-11-02 09:20:05 +01:00
parent 6753b2c6c1
commit de6d025592
4 changed files with 73 additions and 102 deletions

View File

@ -1,47 +1,30 @@
diff --git a/Makerules b/Makerules
--- a/Makerules
+++ b/Makerules
@@ -81,22 +81,10 @@ HAVE_GLUT ?= yes
SYS_GLUT_CFLAGS := -Wno-deprecated-declarations
SYS_GLUT_LIBS := -framework GLUT -framework OpenGL
-CC = xcrun cc
-AR = xcrun ar
-LD = xcrun ld
-RANLIB_CMD = xcrun ranlib $@
diff -ruN mupdf-1.14.0-source.orig/Makerules mupdf-1.14.0-source/Makerules
--- mupdf-1.14.0-source.orig/Makerules 2018-11-02 06:57:12.114012496 +0100
+++ mupdf-1.14.0-source/Makerules 2018-11-02 10:11:56.717232992 +0100
@@ -80,13 +80,6 @@
HAVE_GLUT := yes
SYS_GLUT_CFLAGS := -Wno-deprecated-declarations
SYS_GLUT_LIBS := -framework GLUT -framework OpenGL
- CC = xcrun cc
- AR = xcrun ar
- LD = xcrun ld
- RANLIB = xcrun ranlib
-
-# Linux uses pkg-config for system libraries.
-else ifeq "$(OS)" "Linux"
-else ifeq ($(OS),Linux)
- HAVE_OBJCOPY := yes
ifeq ($(shell pkg-config --exists freetype2 && echo yes),yes)
SYS_FREETYPE_CFLAGS := $(shell pkg-config --cflags freetype2)
@@ -119,12 +112,6 @@
SYS_CURL_LIBS := $(shell pkg-config --libs libcurl)
endif
- HAVE_GLUT := yes
- ifeq ($(HAVE_GLUT),yes)
- SYS_GLUT_CFLAGS :=
- SYS_GLUT_LIBS := -lglut -lGL
- endif
-
HAVE_PTHREAD := yes
SYS_PTHREAD_CFLAGS :=
SYS_PTHREAD_LIBS := -lpthread
-HAVE_GLUT := yes
-SYS_GLUT_CFLAGS :=
-SYS_GLUT_LIBS := -lglut -lGL
-
ifeq "$(shell pkg-config --exists 'libcrypto >= 1.1.0' && echo yes)" "yes"
HAVE_LIBCRYPTO := yes
SYS_LIBCRYPTO_CFLAGS := -DHAVE_LIBCRYPTO $(shell pkg-config --cflags libcrypto)
@@ -113,7 +101,7 @@ SYS_CURL_CFLAGS += $(shell pkg-config --cflags openssl)
SYS_CURL_DEPS += $(shell pkg-config --libs openssl)
endif
endif
-SYS_CURL_DEPS += -lpthread -lrt
+SYS_CURL_DEPS += -lpthread
ifeq "$(shell pkg-config --exists x11 xext && echo yes)" "yes"
HAVE_X11 := yes
diff --git a/platform/gl/gl-main.c b/platform/gl/gl-main.c
index d58f7ba..808af18 100644
--- a/platform/gl/gl-main.c
+++ b/platform/gl/gl-main.c
@@ -16,6 +16,7 @@ void glutExit(void) {}
void glutMouseWheelFunc(void *fn) {}
void glutInitErrorFunc(void *fn) {}
void glutInitWarningFunc(void *fn) {}
+#define glutSetOption(X,Y)
#endif
enum
HAVE_X11 := $(shell pkg-config --exists x11 xext && echo yes)
ifeq ($(HAVE_X11),yes)
X11_CFLAGS := $(shell pkg-config --cflags x11 xext)

View File

@ -1,4 +1,4 @@
{ stdenv, lib, fetchurl, fetchpatch, pkgconfig, freetype, harfbuzz, openjpeg
{ stdenv, lib, fetchurl, pkgconfig, freetype, harfbuzz, openjpeg
, jbig2dec, libjpeg , darwin
, enableX11 ? true, libX11, libXext, libXi, libXrandr
, enableCurl ? true, curl, openssl
@ -14,23 +14,17 @@ let
in stdenv.mkDerivation rec {
version = "1.13.0";
version = "1.14.0";
name = "mupdf-${version}";
src = fetchurl {
url = "https://mupdf.com/downloads/archive/${name}-source.tar.gz";
sha256 = "02faww5bnjw76k6igrjzwf0lnw4xd9ckc8d6ilc3c4gfrdi6j707";
sha256 = "093p7lv6pgyymagn28n58fs0np928r0i5p2az9cc4gwccwx4hhy4";
};
patches = [
(fetchpatch {
name = "CVE-2018-10289.patch";
url = "https://bugs.ghostscript.com/attachment.cgi?id=15230";
sha256 = "0jmpacxd9930g6k57kda9jrcrbk75whdlv8xwmqg5jwn848qvy4q";
})
]
patches =
# Use shared libraries to decrease size
++ stdenv.lib.optional (!stdenv.isDarwin) ./mupdf-1.13-shared_libs-1.patch
stdenv.lib.optional (!stdenv.isDarwin) ./mupdf-1.14-shared_libs.patch
++ stdenv.lib.optional stdenv.isDarwin ./darwin.patch
;
@ -38,7 +32,7 @@ in stdenv.mkDerivation rec {
sed -i "s/__OPENJPEG__VERSION__/${openJpegVersion}/" source/fitz/load-jpx.c
'';
makeFlags = [ "prefix=$(out)" ];
makeFlags = [ "prefix=$(out) USE_SYSTEM_LIBS=yes" ];
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ freetype harfbuzz openjpeg jbig2dec libjpeg freeglut libGLU ]
++ lib.optionals enableX11 [ libX11 libXext libXi libXrandr ]

View File

@ -1,45 +0,0 @@
--- mupdf-1.12.0-source.orig/Makefile 2017-12-13 15:00:30.000000000 +0100
+++ mupdf-1.12.0-source/Makefile 2017-12-31 00:05:23.003277481 +0100
@@ -14,7 +14,7 @@
# Do not specify CFLAGS or LIBS on the make invocation line - specify
# XCFLAGS or XLIBS instead. Make ignores any lines in the makefile that
# set a variable that was set on the command line.
-CFLAGS += $(XCFLAGS) -Iinclude
+CFLAGS += $(XCFLAGS) -Iinclude -fPIC
LIBS += $(XLIBS) -lm
LIBS += $(FREETYPE_LIBS)
@@ -312,10 +312,10 @@
# --- Library ---
-MUPDF_LIB = $(OUT)/libmupdf.a
-THIRD_LIB = $(OUT)/libmupdfthird.a
-THREAD_LIB = $(OUT)/libmuthreads.a
-PKCS7_LIB = $(OUT)/libmupkcs7.a
+MUPDF_LIB = $(OUT)/libmupdf.so
+THIRD_LIB = $(OUT)/libmupdfthird.so
+THREAD_LIB = $(OUT)/libmuthreads.so
+PKCS7_LIB = $(OUT)/libmupkcs7.so
MUPDF_OBJ := \
$(FITZ_OBJ) \
@@ -343,13 +343,17 @@
$(ZLIB_OBJ) \
$(LCMS2_OBJ)
-$(MUPDF_LIB) : $(MUPDF_OBJ)
+$(MUPDF_LIB) : $(MUPDF_OBJ) $(THIRD_LIB) $(THREAD_LIB)
+ $(LINK_CMD) -shared -Wl,-soname -Wl,libmupdf.so -Wl,--no-undefined
$(THIRD_LIB) : $(THIRD_OBJ)
+ $(LINK_CMD) -shared -Wl,-soname -Wl,libmupdfthird.so -Wl,--no-undefined
$(THREAD_LIB) : $(THREAD_OBJ)
+ $(LINK_CMD) -shared -Wl,-soname -Wl,libmuthreads.so -Wl,--no-undefined -lpthread
$(PKCS7_LIB) : $(PKCS7_OBJ)
+ $(LINK_CMD) -shared -Wl,-soname -Wl,libmupkcs7.so
-INSTALL_LIBS := $(MUPDF_LIB) $(THIRD_LIB)
+INSTALL_LIBS := $(MUPDF_LIB) $(THIRD_LIB) $(THREAD_LIB) $(PKCS7_LIB)
# --- Tools and Apps ---

View File

@ -0,0 +1,39 @@
--- mupdf-1.14.0-source.orig/Makefile 2018-11-02 06:57:12.114012496 +0100
+++ mupdf-1.14.0-source/Makefile 2018-11-02 09:57:10.067945307 +0100
@@ -20,7 +20,7 @@
# Do not specify CFLAGS or LIBS on the make invocation line - specify
# XCFLAGS or XLIBS instead. Make ignores any lines in the makefile that
# set a variable that was set on the command line.
-CFLAGS += $(XCFLAGS) -Iinclude
+CFLAGS += $(XCFLAGS) -Iinclude -fPIC
LIBS += $(XLIBS) -lm
ifneq ($(threading),no)
@@ -190,17 +190,21 @@
# --- Library ---
-MUPDF_LIB = $(OUT)/libmupdf.a
-THIRD_LIB = $(OUT)/libmupdf-third.a
-THREAD_LIB = $(OUT)/libmupdf-threads.a
-PKCS7_LIB = $(OUT)/libmupdf-pkcs7.a
+MUPDF_LIB = $(OUT)/libmupdf.so
+THIRD_LIB = $(OUT)/libmupdf-third.so
+THREAD_LIB = $(OUT)/libmupdf-threads.so
+PKCS7_LIB = $(OUT)/libmupdf-pkcs7.so
-$(MUPDF_LIB) : $(MUPDF_OBJ)
+$(MUPDF_LIB) : $(MUPDF_OBJ) $(THIRD_LIB) $(THREAD_LIB)
+ $(LINK_CMD) $(THIRD_LIBS) -shared -Wl,-soname -Wl,libmupdf.so -Wl,--no-undefined
$(THIRD_LIB) : $(THIRD_OBJ)
+ $(LINK_CMD) -shared -Wl,-soname -Wl,libmupdf-third.so -Wl,--no-undefined
$(THREAD_LIB) : $(THREAD_OBJ)
+ $(LINK_CMD) -shared -Wl,-soname -Wl,libmupdf-threads.so -Wl,--no-undefined -lpthread
$(PKCS7_LIB) : $(PKCS7_OBJ)
+ $(LINK_CMD) -shared -Wl,-soname -Wl,libmupdf-pkcs7.so
-INSTALL_LIBS := $(MUPDF_LIB) $(THIRD_LIB)
+INSTALL_LIBS := $(MUPDF_LIB) $(THIRD_LIB) $(THREAD_LIB) $(PKCS7_LIB)
# --- Main tools and viewers ---