void-packages/srcpkgs/mupdf/patches/0001-consolidated_fixes-1.p...

90 lines
2.5 KiB
Diff

Submitted By: Bruce Dubbs <bdubbs at linuxfromscratch dot org>
Date: 2017-12-17
Initial Package Version: 1.12.0
Upstream Status: Not submitted
Origin: Arch Linux, rolled forward for openjpeg-2.3
Description: Fixes for openjpeg-2.2
Update: 2017-10-15 Change include directory to openjpeg-2.3
Consolidated patch for installing shared libraries.
Original patch by Ken Moffat
With minor changes for Void by svenper
diff -Naur mupdf-1.12.0-source.orig/Makefile mupdf-1.12.0-source/Makefile
--- Makefile 2017-12-13 08:00:30.000000000 -0600
+++ Makefile 2017-12-17 18:07:39.809057239 -0600
@@ -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,9 +312,9 @@
# --- Library ---
-MUPDF_LIB = $(OUT)/libmupdf.a
-THIRD_LIB = $(OUT)/libmupdfthird.a
-THREAD_LIB = $(OUT)/libmuthreads.a
+MUPDF_LIB = $(OUT)/libmupdf.so.$(VOID_VERSION)
+THIRD_LIB = $(OUT)/libmupdfthird.so.$(VOID_VERSION)
+THREAD_LIB = $(OUT)/libmuthreads.so.$(VOID_VERSION)
MUPDF_OBJ := \
$(FITZ_OBJ) \
@@ -343,11 +343,14 @@
THREAD_OBJ := $(THREAD_OBJ)
-$(MUPDF_LIB) : $(MUPDF_OBJ)
+$(MUPDF_LIB) : $(MUPDF_OBJ) $(THIRD_LIB) $(THREAD_LIB)
+ $(LINK_CMD) -shared -Wl,-soname -Wl,libmupdf.so.$(VOID_VERSION) -Wl,--no-undefined
$(THIRD_LIB) : $(THIRD_OBJ)
+ $(LINK_CMD) -shared -Wl,-soname -Wl,libmupdfthird.so.$(VOID_VERSION) -Wl,--no-undefined
$(THREAD_LIB) : $(THREAD_OBJ)
+ $(LINK_CMD) -shared -Wl,-soname -Wl,libmuthreads.so.$(VOID_VERSION) -Wl,--no-undefined -lpthread
-INSTALL_LIBS := $(MUPDF_LIB) $(THIRD_LIB)
+INSTALL_LIBS := $(MUPDF_LIB) $(THIRD_LIB) $(THREAD_LIB)
# --- Tools and Apps ---
diff -Naur mupdf-1.12.0-source.orig/source/fitz/load-jpx.c mupdf-1.12.0-source/source/fitz/load-jpx.c
--- source/fitz/load-jpx.c 2017-12-13 08:00:30.000000000 -0600
+++ source/fitz/load-jpx.c 2017-12-17 18:03:03.259071255 -0600
@@ -445,14 +445,18 @@
#else /* HAVE_LURATECH */
+#ifdef __cplusplus
+extern "C"
+{
#define OPJ_STATIC
#define OPJ_HAVE_INTTYPES_H
#if !defined(_MSC_VER) || _MSC_VER >= 1600
#define OPJ_HAVE_STDINT_H
#endif
+#endif
#define USE_JPIP
-#include <openjpeg.h>
+#include <openjpeg-2.3/openjpeg.h>
struct fz_jpxd_s
{
@@ -930,6 +934,10 @@
*yresp = state.yres;
}
+#ifdef __cplusplus
+}
+#endif
+
#endif /* HAVE_LURATECH */
#else /* FZ_ENABLE_JPX */