sm-commit AT lists.ibiblio.org
Subject: Source Mage code commit list
List archive
[SM-Commit] GIT changes to master grimoire by Pavel Vinogradov (62ee0108036146901a7df8875d32c9aa2d93ed9b)
- From: Pavel Vinogradov <scm AT sourcemage.org>
- To: sm-commit AT lists.ibiblio.org
- Subject: [SM-Commit] GIT changes to master grimoire by Pavel Vinogradov (62ee0108036146901a7df8875d32c9aa2d93ed9b)
- Date: Sun, 7 Oct 2018 18:32:43 +0000
GIT changes to master grimoire by Pavel Vinogradov <public AT sourcemage.org>:
doc/mupdf/BUILD | 2
doc/mupdf/DEPENDS | 1
doc/mupdf/DETAILS | 8 -
doc/mupdf/HISTORY | 9 +
doc/mupdf/INSTALL | 2
doc/mupdf/PRE_BUILD | 4
doc/mupdf/mupdf-1.13.0-shared_libs-1.patch | 43 -------
doc/mupdf/patches-1.14/pkcs7.patch | 29 +++++
doc/mupdf/patches-1.14/shared_libs.patch | 40 +++++++
doc/zathura-pdf-mupdf/HISTORY | 4
doc/zathura-pdf-mupdf/PRE_BUILD | 7 +
doc/zathura-pdf-mupdf/patches/mupdf-1.14.0.patch | 130
+++++++++++++++++++++++
12 files changed, 227 insertions(+), 52 deletions(-)
New commits:
commit 62ee0108036146901a7df8875d32c9aa2d93ed9b
Author: Pavel Vinogradov <public AT sourcemage.org>
Commit: Pavel Vinogradov <public AT sourcemage.org>
doc/zathura-pdf-mupdf: adapted to mupdf 1.14.x
commit b3642e64f4e7e77d120259d51ee722b21d55172e
Author: Pavel Vinogradov <public AT sourcemage.org>
Commit: Pavel Vinogradov <public AT sourcemage.org>
doc/mupdf: version 1.14.0
diff --git a/doc/mupdf/BUILD b/doc/mupdf/BUILD
index f29510f..62b08f6 100755
--- a/doc/mupdf/BUILD
+++ b/doc/mupdf/BUILD
@@ -1 +1 @@
-CFLAGS= LIBS= make XCFLAGS="$CFLAGS" XLIBS="$LDFLAGS" ${OPTS} build=release
verbose=yes
+CFLAGS= LIBS= make XCFLAGS="$CFLAGS" XLIBS="$LDFLAGS" ${OPTS} build=release
verbose=yes USE_SYSTEM_LIBS=yes
diff --git a/doc/mupdf/DEPENDS b/doc/mupdf/DEPENDS
index c545e4d..ff00fcd 100755
--- a/doc/mupdf/DEPENDS
+++ b/doc/mupdf/DEPENDS
@@ -4,7 +4,6 @@ depends freetype2 &&
depends GLUT &&
depends harfbuzz &&
depends jbig2dec &&
-depends lcms2 &&
depends zlib &&
depends libxext &&
depends libx11 &&
diff --git a/doc/mupdf/DETAILS b/doc/mupdf/DETAILS
index 0b7bd31..5e17839 100755
--- a/doc/mupdf/DETAILS
+++ b/doc/mupdf/DETAILS
@@ -1,10 +1,10 @@
SPELL=mupdf
if [[ "${MUPDF_BRANCH}" == "rc" ]]; then
- VERSION=1.13.0
-
SOURCE_HASH=sha512:c40694d907bb44f18ccf276b3014867f5e0031259064d6f5f4c2bb17bcf1c6773ea0b12b5b99bc3d88bbe69b574e323c490e387e8199f796b44b76bae01f8924
+ VERSION=1.14.0
+ SOURCE_HASH=sha1:b682828373fb1ff9911de08a2b2af7178eb78dc1:UPSTREAM_HASH
else
- VERSION=1.13.0
-
SOURCE_HASH=sha512:c40694d907bb44f18ccf276b3014867f5e0031259064d6f5f4c2bb17bcf1c6773ea0b12b5b99bc3d88bbe69b574e323c490e387e8199f796b44b76bae01f8924
+ VERSION=1.14.0
+ SOURCE_HASH=sha1:b682828373fb1ff9911de08a2b2af7178eb78dc1:UPSTREAM_HASH
fi
SECURITY_PATCH=1
SOURCE=$SPELL-$VERSION-source.tar.xz
diff --git a/doc/mupdf/HISTORY b/doc/mupdf/HISTORY
index 3b17ffa..a6656ee 100644
--- a/doc/mupdf/HISTORY
+++ b/doc/mupdf/HISTORY
@@ -1,3 +1,12 @@
+2018-10-07 Pavel Vinogradov <public AT sourcemage.org>
+ * DETAILS: version 1.14.0, switched to sha1 UPSTREAM_HASH
+ * BUILD, INSTALL: added flag to use system libraries
+ * DEPENDS, PRE_BUILD: removed lcms2, mupdf now uses its own fork,
+ reoorganized version dependent patching
+ * mupdf-1.13.0-shared_libs-1.patch: removed obsolete patch
+ * patches-1.14/shared_libs.patch: added, inherited from the above
+ * patches-1.14/pkcs7.patch: added to adapt to system libcrypto
+
2018-04-20 Pavel Vinogradov <public AT sourcemage.org>
* DETAILS: version 1.13.0
* mupdf-1.12.0-shared_libs-1.patch,
diff --git a/doc/mupdf/INSTALL b/doc/mupdf/INSTALL
index 4b8fac4..08b80f5 100755
--- a/doc/mupdf/INSTALL
+++ b/doc/mupdf/INSTALL
@@ -1 +1 @@
-make build=release prefix="$INSTAL_ROOT/usr" ${OPTS} install
+make build=release prefix="$INSTAL_ROOT/usr" ${OPTS} USE_SYSTEM_LIBS=yes
install
diff --git a/doc/mupdf/PRE_BUILD b/doc/mupdf/PRE_BUILD
index 134f85e..9dea187 100755
--- a/doc/mupdf/PRE_BUILD
+++ b/doc/mupdf/PRE_BUILD
@@ -3,9 +3,9 @@ cd "${SOURCE_DIRECTORY}" &&
sedit "/OPJ_STATIC$/d" source/fitz/load-jpx.c &&
sedit "s:-DOPJ_STATIC::" Makethird &&
-patch -p1 < "${SPELL_DIRECTORY}/mupdf-${VERSION}-shared_libs-1.patch" &&
+apply_patch_dir "patches-${VERSION%.*}" &&
-rm -rf
thirdparty/{curl,freeglut,freetype,harfbuzz,glfw,jbig2dec,jpeg,lcms2,libjpeg,zlib}
&&
+rm -rf
thirdparty/{curl,freeglut,freetype,harfbuzz,glfw,jbig2dec,jpeg,libjpeg,zlib}
&&
# building against older system OpenJPEG library is unsupported
if spell_ok openjpeg && ! is_version_less $(installed_version openjpeg) 2.0;
then
diff --git a/doc/mupdf/mupdf-1.13.0-shared_libs-1.patch
b/doc/mupdf/mupdf-1.13.0-shared_libs-1.patch
deleted file mode 100644
index e9fd8f5..0000000
--- a/doc/mupdf/mupdf-1.13.0-shared_libs-1.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-diff --git a/Makefile b/Makefile
---- a/Makefile
-+++ b/Makefile
-@@ -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)
-@@ -325,9 +325,9 @@
-
- # --- Library ---
-
--MUPDF_LIB = $(OUT)/libmupdf.a
--THIRD_LIB = $(OUT)/libmupdfthird.a
--THREAD_LIB = $(OUT)/libmuthreads.a
-+MUPDF_LIB = $(OUT)/libmupdf.so
-+THIRD_LIB = $(OUT)/libmupdfthird.so
-+THREAD_LIB = $(OUT)/libmuthreads.so
- PKCS7_LIB = $(OUT)/libmupkcs7.a
-
- MUPDF_OBJ := \
-@@ -355,12 +355,15 @@
- $(ZLIB_OBJ) \
- $(LCMS2_OBJ)
-
--$(MUPDF_LIB) : $(MUPDF_OBJ)
-+$(MUPDF_LIB) : $(MUPDF_OBJ) $(THIRD_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) -pthread -shared -Wl,-soname -Wl,libmuthreads.so
-Wl,--no-undefined
- $(PKCS7_LIB) : $(PKCS7_OBJ)
-
--INSTALL_LIBS := $(MUPDF_LIB) $(THIRD_LIB)
-+INSTALL_LIBS := $(MUPDF_LIB) $(THIRD_LIB) $(THREAD_LIB)
-
- # --- Tools and Apps ---
-
diff --git a/doc/mupdf/patches-1.14/pkcs7.patch
b/doc/mupdf/patches-1.14/pkcs7.patch
new file mode 100644
index 0000000..342da08
--- /dev/null
+++ b/doc/mupdf/patches-1.14/pkcs7.patch
@@ -0,0 +1,29 @@
+diff --git a/source/helpers/pkcs7/pkcs7-openssl.c
b/source/helpers/pkcs7/pkcs7-openssl.c
+--- a/source/helpers/pkcs7/pkcs7-openssl.c
++++ b/source/helpers/pkcs7/pkcs7-openssl.c
+@@ -517,11 +517,12 @@
+ {
+ EVP_PKEY *pkey = NULL;
+ X509 *x509 = NULL;
++ STACK_OF(PKCS12_SAFEBAG) *bags;
+ switch (M_PKCS12_bag_type(bag))
+ {
+ case NID_keyBag:
+ {
+- const PKCS8_PRIV_KEY_INFO *p8 =
PKCS12_SAFEBAG_get0_p8inf(bag);
++ const PKCS8_PRIV_KEY_INFO *p8 =
PKCS12_decrypt_skey(bag, pw, (int)strlen(pw));
+ pkey = EVP_PKCS82PKEY(p8);
+ }
+ break;
+@@ -543,7 +544,10 @@
+ break;
+
+ case NID_safeContentsBag:
+- add_from_bags(pX509, pPkey, PKCS12_SAFEBAG_get0_safes(bag),
pw);
++ bags = sk_PKCS12_SAFEBAG_new_null();
++ sk_PKCS12_SAFEBAG_push(bags, bag);
++ add_from_bags(pX509, pPkey, bags, pw);
++ sk_PKCS12_SAFEBAG_free(bags);
+ break;
+ }
+
diff --git a/doc/mupdf/patches-1.14/shared_libs.patch
b/doc/mupdf/patches-1.14/shared_libs.patch
new file mode 100644
index 0000000..4905964
--- /dev/null
+++ b/doc/mupdf/patches-1.14/shared_libs.patch
@@ -0,0 +1,40 @@
+diff --git a/Makefile b/Makefile
+--- a/Makefile
++++ b/Makefile
+@@ -20,8 +20,8 @@
+ # 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
+-LIBS += $(XLIBS) -lm
++CFLAGS += $(XCFLAGS) -Iinclude -fPIC
++LIBS += $(XLIBS) $(THIRD_LIBS) -lm
+
+ ifneq ($(threading),no)
+ ifeq ($(HAVE_PTHREAD),yes)
+@@ -190,17 +190,20 @@
+
+ # --- Library ---
+
+-MUPDF_LIB = $(OUT)/libmupdf.a
+-THIRD_LIB = $(OUT)/libmupdf-third.a
+-THREAD_LIB = $(OUT)/libmupdf-threads.a
++MUPDF_LIB = $(OUT)/libmupdf.so
++THIRD_LIB = $(OUT)/libmupdf-third.so
++THREAD_LIB = $(OUT)/libmupdf-threads.so
+ PKCS7_LIB = $(OUT)/libmupdf-pkcs7.a
+
+-$(MUPDF_LIB) : $(MUPDF_OBJ)
++$(MUPDF_LIB) : $(MUPDF_OBJ) $(THIRD_LIB)
++ $(LINK_CMD) -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) -pthread -shared -Wl,-soname -Wl,libmupdf-threads.so
-Wl,--no-undefined
+ $(PKCS7_LIB) : $(PKCS7_OBJ)
+
+-INSTALL_LIBS := $(MUPDF_LIB) $(THIRD_LIB)
++INSTALL_LIBS := $(MUPDF_LIB) $(THIRD_LIB) $(THREAD_LIB)
+
+ # --- Main tools and viewers ---
+
diff --git a/doc/zathura-pdf-mupdf/HISTORY b/doc/zathura-pdf-mupdf/HISTORY
index 37dd7f8..190cf40 100644
--- a/doc/zathura-pdf-mupdf/HISTORY
+++ b/doc/zathura-pdf-mupdf/HISTORY
@@ -1,3 +1,7 @@
+2018-10-07 Pavel Vinogradov <public AT sourcemage.org>
+ * PRE_BUILD, patches/mupdf-1.14.0.patch: added to adapt for
+ mupdf 1.14.x
+
2018-05-31 Pavel Vinogradov <public AT sourcemage.org>
* DETAILS: version 0.3.3, converted to meson build system,
.gz -> .xz, sha1 -> sha256
diff --git a/doc/zathura-pdf-mupdf/PRE_BUILD b/doc/zathura-pdf-mupdf/PRE_BUILD
new file mode 100755
index 0000000..e0f8c22
--- /dev/null
+++ b/doc/zathura-pdf-mupdf/PRE_BUILD
@@ -0,0 +1,7 @@
+default_pre_build &&
+cd "${SOURCE_DIRECTORY}" &&
+
+# patch if mupdf >= 1.14.x
+if spell_ok mupdf && is_version_less "1.13.0" "$(installed_version mupdf)";
then
+ apply_patch_dir patches
+fi
diff --git a/doc/zathura-pdf-mupdf/patches/mupdf-1.14.0.patch
b/doc/zathura-pdf-mupdf/patches/mupdf-1.14.0.patch
new file mode 100644
index 0000000..cf34b63
--- /dev/null
+++ b/doc/zathura-pdf-mupdf/patches/mupdf-1.14.0.patch
@@ -0,0 +1,130 @@
+diff --git a/meson.build b/meson.build
+--- a/meson.build
++++ b/meson.build
+@@ -20,7 +20,7 @@
+ glib = dependency('glib-2.0')
+ cairo = dependency('cairo')
+ mupdf = cc.find_library('mupdf')
+-mupdfthird = cc.find_library('mupdfthird')
++mupdfthird = cc.find_library('mupdf-third')
+
+ build_dependencies = [zathura, girara, glib, cairo, mupdf, mupdfthird]
+
+diff --git a/zathura-pdf-mupdf/document.c b/zathura-pdf-mupdf/document.c
+--- a/zathura-pdf-mupdf/document.c
++++ b/zathura-pdf-mupdf/document.c
+@@ -138,7 +138,8 @@
+
+ fz_try (mupdf_document->ctx) {
+ pdf_obj* trailer = pdf_trailer(mupdf_document->ctx, (pdf_document*)
mupdf_document->document);
+- pdf_obj* info_dict = pdf_dict_get(mupdf_document->ctx, trailer,
PDF_NAME_Info);
++ pdf_obj* info_dict = pdf_dict_get(mupdf_document->ctx, trailer,
++ pdf_dict_get_key(mupdf_document->ctx,
trailer, PDF_ENUM_NAME_Info));
+
+ /* get string values */
+ typedef struct info_value_s {
+diff --git a/zathura-pdf-mupdf/page.c b/zathura-pdf-mupdf/page.c
+--- a/zathura-pdf-mupdf/page.c
++++ b/zathura-pdf-mupdf/page.c
+@@ -30,14 +30,13 @@
+ goto error_free;
+ }
+
+- fz_bound_page(mupdf_document->ctx, (fz_page*) mupdf_page->page,
&mupdf_page->bbox);
++ mupdf_page->bbox = fz_bound_page(mupdf_document->ctx, (fz_page*)
mupdf_page->page);
+
+ /* setup text */
+ mupdf_page->extracted_text = false;
+
+- fz_rect mediabox;
+- mupdf_page->text = fz_new_stext_page(mupdf_page->ctx,
+- fz_bound_page(mupdf_page->ctx, mupdf_page->page, &mediabox));
++ fz_rect mediabox = fz_bound_page(mupdf_page->ctx, mupdf_page->page);
++ mupdf_page->text = fz_new_stext_page(mupdf_page->ctx, mediabox);
+ if (mupdf_page->text == NULL) {
+ goto error_free;
+ }
+diff --git a/zathura-pdf-mupdf/render.c b/zathura-pdf-mupdf/render.c
+--- a/zathura-pdf-mupdf/render.c
++++ b/zathura-pdf-mupdf/render.c
+@@ -18,13 +18,15 @@
+ return ZATHURA_ERROR_UNKNOWN;
+ }
+
+- fz_display_list* display_list = fz_new_display_list(mupdf_page->ctx,
NULL);
++ fz_irect irect = { .x1 = page_width, .y1 = page_height };
++ fz_rect rect = { .x1 = page_width, .y1 = page_height };
++
++ fz_display_list* display_list = fz_new_display_list(mupdf_page->ctx,
rect);
+ fz_device* device = fz_new_list_device(mupdf_page->ctx,
display_list);
+
+ fz_try (mupdf_document->ctx) {
+- fz_matrix m;
+- fz_scale(&m, scalex, scaley);
+- fz_run_page(mupdf_document->ctx, mupdf_page->page, device, &m, NULL);
++ fz_matrix m = fz_scale(scalex, scaley);
++ fz_run_page(mupdf_document->ctx, mupdf_page->page, device, m, NULL);
+ } fz_catch (mupdf_document->ctx) {
+ return ZATHURA_ERROR_UNKNOWN;
+ }
+@@ -32,16 +34,14 @@
+ fz_close_device(mupdf_page->ctx, device);
+ fz_drop_device(mupdf_page->ctx, device);
+
+- fz_irect irect = { .x1 = page_width, .y1 = page_height };
+- fz_rect rect = { .x1 = page_width, .y1 = page_height };
+
+ fz_colorspace* colorspace = fz_device_bgr(mupdf_document->ctx);
+ fz_separations* seps= fz_page_separations(mupdf_page->ctx,
mupdf_page->page);
+- fz_pixmap* pixmap = fz_new_pixmap_with_bbox_and_data(mupdf_page->ctx,
colorspace, &irect, seps, 1, image);
++ fz_pixmap* pixmap = fz_new_pixmap_with_bbox_and_data(mupdf_page->ctx,
colorspace, irect, seps, 1, image);
+ fz_clear_pixmap_with_value(mupdf_page->ctx, pixmap, 0xFF);
+
+- device = fz_new_draw_device(mupdf_page->ctx, NULL, pixmap);
+- fz_run_display_list(mupdf_page->ctx, display_list, device, &fz_identity,
&rect, NULL);
++ device = fz_new_draw_device(mupdf_page->ctx, fz_identity, pixmap);
++ fz_run_display_list(mupdf_page->ctx, display_list, device, fz_identity,
rect, NULL);
+ fz_close_device(mupdf_page->ctx, device);
+ fz_drop_device(mupdf_page->ctx, device);
+
+diff --git a/zathura-pdf-mupdf/search.c b/zathura-pdf-mupdf/search.c
+--- a/zathura-pdf-mupdf/search.c
++++ b/zathura-pdf-mupdf/search.c
+@@ -39,17 +39,17 @@
+ mupdf_page_extract_text(mupdf_document, mupdf_page);
+ }
+
+- fz_rect* hit_bbox = fz_malloc_array(mupdf_page->ctx, N_SEARCH_RESULTS,
sizeof(fz_rect));
++ fz_quad* hit_bbox = fz_malloc_array(mupdf_page->ctx, N_SEARCH_RESULTS,
sizeof(fz_quad));
+ int num_results = fz_search_stext_page(mupdf_page->ctx, mupdf_page->text,
+ text, hit_bbox, N_SEARCH_RESULTS);
+
+ for (int i = 0; i < num_results; i++) {
+ zathura_rectangle_t* rectangle = g_malloc0(sizeof(zathura_rectangle_t));
+
+- rectangle->x1 = hit_bbox[i].x0;
+- rectangle->x2 = hit_bbox[i].x1;
+- rectangle->y1 = hit_bbox[i].y0;
+- rectangle->y2 = hit_bbox[i].y1;
++ rectangle->x1 = hit_bbox[i].ul.x;
++ rectangle->x2 = hit_bbox[i].lr.x;
++ rectangle->y1 = hit_bbox[i].ul.y;
++ rectangle->y2 = hit_bbox[i].lr.y;
+
+ girara_list_append(list, rectangle);
+ }
+diff --git a/zathura-pdf-mupdf/utils.c b/zathura-pdf-mupdf/utils.c
+--- a/zathura-pdf-mupdf/utils.c
++++ b/zathura-pdf-mupdf/utils.c
+@@ -17,9 +17,8 @@
+ /* Disable FZ_DONT_INTERPOLATE_IMAGES to collect image blocks */
+ fz_disable_device_hints(mupdf_page->ctx, text_device,
FZ_DONT_INTERPOLATE_IMAGES);
+
+- fz_matrix ctm;
+- fz_scale(&ctm, 1.0, 1.0);
+- fz_run_page(mupdf_page->ctx, mupdf_page->page, text_device, &ctm, NULL);
++ fz_matrix ctm = fz_scale(1.0, 1.0);
++ fz_run_page(mupdf_page->ctx, mupdf_page->page, text_device, ctm, NULL);
+ } fz_always (mupdf_document->ctx) {
+ fz_close_device(mupdf_page->ctx, text_device);
+ fz_drop_device(mupdf_page->ctx, text_device);
- [SM-Commit] GIT changes to master grimoire by Pavel Vinogradov (62ee0108036146901a7df8875d32c9aa2d93ed9b), Pavel Vinogradov, 10/07/2018
Archive powered by MHonArc 2.6.24.