mupdf: update to 1.14.0.

This release doesn't provide shared libs anymore,
so removing libmupdf. Use mupdf-devel instead.
This commit is contained in:
Rasmus Thomsen 2019-01-05 18:56:32 +01:00 committed by maxice8
parent 8c608ddbba
commit 8988a5416f
8 changed files with 252 additions and 157 deletions

View file

@ -1 +0,0 @@
mupdf

View file

@ -1,82 +0,0 @@
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,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.$(VOID_VERSION)
+THIRD_LIB = $(OUT)/libmupdfthird.so.$(VOID_VERSION)
+THREAD_LIB = $(OUT)/libmuthreads.so.$(VOID_VERSION)
+PKCS7_LIB = $(OUT)/libmupkcs7.so.$(VOID_VERSION)
MUPDF_OBJ := \
$(FITZ_OBJ) \
@@ -343,12 +343,16 @@
THREAD_OBJ := $(THREAD_OBJ)
-$(MUPDF_LIB) : $(MUPDF_OBJ)
+$(MUPDF_LIB) : $(MUPDF_OBJ) $(THIRD_LIB) $(THREAD_LIB) $(PKCS7_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
$(PKCS7_LIB) : $(PKCS7_OBJ)
+ $(LINK_CMD) -shared -Wl,-soname -Wl,libmupkcs7.so.$(VOID_VERSION) -lssl -lcrypto
-INSTALL_LIBS := $(MUPDF_LIB) $(THIRD_LIB)
+INSTALL_LIBS := $(MUPDF_LIB) $(THIRD_LIB) $(THREAD_LIB) $(PKCS7_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,7 +445,7 @@
#else /* HAVE_LURATECH */
-#include <openjpeg.h>
+#include <openjpeg-2.3/openjpeg.h>
struct fz_jpxd_s
{
--- Makerules.orig
+++ Makerules
@@ -97,7 +97,7 @@
SYS_GLUT_CFLAGS :=
SYS_GLUT_LIBS := -lglut -lGL
-ifeq "$(shell pkg-config --exists 'libcrypto >= 1.1.0' && echo yes)" "yes"
+ifeq "$(shell pkg-config --exists 'libcrypto >= 1.1.0 && libcrypto <= 2.0' && echo yes)" "yes"
HAVE_LIBCRYPTO := yes
SYS_LIBCRYPTO_CFLAGS := -DHAVE_LIBCRYPTO $(shell pkg-config --cflags libcrypto)
SYS_LIBCRYPTO_LIBS := $(shell pkg-config --libs libcrypto)

View file

@ -0,0 +1,40 @@
Upstream: https://github.com/ArtifexSoftware/mupdf/pull/6
From 6f05eb97ffda80d43c3f2776cfc5a4348ddb7012 Mon Sep 17 00:00:00 2001
From: Pavel Vinogradov <public@sourcemage.org>
Date: Sun, 7 Oct 2018 14:52:56 -0400
Subject: [PATCH] Fixed handling of safebags in pkcs7-helper library
---
source/helpers/pkcs7/pkcs7-openssl.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/source/helpers/pkcs7/pkcs7-openssl.c b/source/helpers/pkcs7/pkcs7-openssl.c
index 58dbf65f1..7683b9796 100644
--- a/source/helpers/pkcs7/pkcs7-openssl.c
+++ b/source/helpers/pkcs7/pkcs7-openssl.c
@@ -517,11 +517,12 @@ static void add_from_bag(X509 **pX509, EVP_PKEY **pPkey, PKCS12_SAFEBAG *bag, co
{
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 @@ static void add_from_bag(X509 **pX509, EVP_PKEY **pPkey, PKCS12_SAFEBAG *bag, co
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;
}

View file

@ -1,25 +0,0 @@
From: Sebastian Rasmussen <sebras@gmail.com>
Date: Tue, 21 Aug 2018 11:07:57 +0000 (+0800)
Subject: Bug 699271: Fix eternal loop when skipping space before EOF.
X-Git-Tag: 1.14.0-rc1~81
X-Git-Url: http://git.ghostscript.com/?p=mupdf.git;a=commitdiff_plain;h=2e43685dc8a8a886fc9df9b3663cf199404f7637;hp=5606857245ed81253a4e06bed73eaa813e684070
Bug 699271: Fix eternal loop when skipping space before EOF.
Thanks to Michael J Gruber for providing this oneliner.
---
diff --git a/source/pdf/pdf-xref.c b/source/pdf/pdf-xref.c
index 682a3dd..431755d 100644
--- source/pdf/pdf-xref.c
+++ source/pdf/pdf-xref.c
@@ -649,7 +649,7 @@ fz_skip_space(fz_context *ctx, fz_stream *stm)
do
{
int c = fz_peek_byte(ctx, stm);
- if (c > 32 && c != EOF)
+ if (c == EOF || c > 32)
return;
(void)fz_read_byte(ctx, stm);
}

View file

@ -0,0 +1,77 @@
From 351c99d8ce23bbf7099dbd52771a095f67e45a2c Mon Sep 17 00:00:00 2001
Message-Id: <351c99d8ce23bbf7099dbd52771a095f67e45a2c.1542272011.git.mjg@fedoraproject.org>
From: Sebastian Rasmussen <sebras@gmail.com>
Date: Mon, 1 Oct 2018 15:13:13 +0800
Subject: [PATCH] Avoid being smart about keeping only a single reference to
the buffer.
When pdf_dev_pop() is called it will drop the reference to the buffer.
pdf_dev_push_new_buf() will either create a new buffer reference or take a reference to the existing buffer.
When pdf_dev_pop() is called unbalance this creates a problem as the
top level buffer will be unreferenced too many times.
fails-32.pdf
---
source/pdf/pdf-device.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/source/pdf/pdf-device.c b/source/pdf/pdf-device.c
index 31a7a10f..0103e9a7 100644
--- a/source/pdf/pdf-device.c
+++ b/source/pdf/pdf-device.c
@@ -66,7 +66,6 @@ struct pdf_device_s
pdf_document *doc;
pdf_obj *resources;
- fz_buffer *buffer;
int in_text;
@@ -1061,7 +1060,10 @@ pdf_dev_drop_device(fz_context *ctx, fz_device *dev)
int i;
for (i = pdev->num_gstates-1; i >= 0; i--)
+ {
+ fz_drop_buffer(ctx, pdev->gstates[i].buf);
fz_drop_stroke_state(ctx, pdev->gstates[i].stroke_state);
+ }
for (i = pdev->num_cid_fonts-1; i >= 0; i--)
fz_drop_font(ctx, pdev->cid_fonts[i]);
@@ -1069,7 +1071,6 @@ pdf_dev_drop_device(fz_context *ctx, fz_device *dev)
for (i = pdev->num_groups - 1; i >= 0; i--)
pdf_drop_obj(ctx, pdev->groups[i].ref);
- fz_drop_buffer(ctx, pdev->buffer);
pdf_drop_obj(ctx, pdev->resources);
fz_free(ctx, pdev->cid_fonts);
fz_free(ctx, pdev->image_indices);
@@ -1111,10 +1112,13 @@ fz_device *pdf_new_pdf_device(fz_context *ctx, pdf_document *doc, fz_matrix topc
dev->super.begin_tile = pdf_dev_begin_tile;
dev->super.end_tile = pdf_dev_end_tile;
+ fz_var(buf);
+
fz_try(ctx)
{
- dev->buffer = fz_keep_buffer(ctx, buf);
- if (!buf)
+ if (buf)
+ buf = fz_keep_buffer(ctx, buf);
+ else
buf = fz_new_buffer(ctx, 256);
dev->doc = doc;
dev->resources = pdf_keep_obj(ctx, resources);
@@ -1136,8 +1140,7 @@ fz_device *pdf_new_pdf_device(fz_context *ctx, pdf_document *doc, fz_matrix topc
}
fz_catch(ctx)
{
- if (dev->gstates && dev->buffer == NULL)
- fz_drop_buffer(ctx, dev->gstates[0].buf);
+ fz_drop_buffer(ctx, buf);
fz_free(ctx, dev);
fz_rethrow(ctx);
}
--
2.19.1.1238.g4b45f61cc0

View file

@ -0,0 +1,48 @@
From 38f883fe129a5e89306252a4676eaaf4bc968824 Mon Sep 17 00:00:00 2001
Message-Id: <38f883fe129a5e89306252a4676eaaf4bc968824.1542272532.git.mjg@fedoraproject.org>
From: Tor Andersson <tor.andersson@artifex.com>
Date: Mon, 22 Oct 2018 17:16:35 +0200
Subject: [PATCH] Fix text used as clip mask in pdfwrite device.
Push the clip state, and pass the correct text rendering mode state.
---
source/pdf/pdf-device.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/source/pdf/pdf-device.c b/source/pdf/pdf-device.c
index 4dd729b8..427e3b38 100644
--- a/source/pdf/pdf-device.c
+++ b/source/pdf/pdf-device.c
@@ -734,9 +734,13 @@ pdf_dev_clip_text(fz_context *ctx, fz_device *dev, const fz_text *text, fz_matri
{
pdf_device *pdev = (pdf_device*)dev;
fz_text_span *span;
+
+ pdf_dev_end_text(ctx, pdev);
+ pdf_dev_push(ctx, pdev);
+
for (span = text->head; span; span = span->next)
{
- pdf_dev_begin_text(ctx, pdev, span->trm, 0);
+ pdf_dev_begin_text(ctx, pdev, span->trm, 7);
pdf_dev_ctm(ctx, pdev, ctm);
pdf_dev_font(ctx, pdev, span->font);
pdf_dev_text_span(ctx, pdev, span);
@@ -748,9 +752,13 @@ pdf_dev_clip_stroke_text(fz_context *ctx, fz_device *dev, const fz_text *text, c
{
pdf_device *pdev = (pdf_device*)dev;
fz_text_span *span;
+
+ pdf_dev_end_text(ctx, pdev);
+ pdf_dev_push(ctx, pdev);
+
for (span = text->head; span; span = span->next)
{
- pdf_dev_begin_text(ctx, pdev, span->trm, 0);
+ pdf_dev_begin_text(ctx, pdev, span->trm, 7);
pdf_dev_font(ctx, pdev, span->font);
pdf_dev_ctm(ctx, pdev, ctm);
pdf_dev_text_span(ctx, pdev, span);
--
2.19.1.1238.g4b45f61cc0

View file

@ -0,0 +1,62 @@
From 164ddc22ee0d5b63a81d5148f44c37dd132a9356 Mon Sep 17 00:00:00 2001
Message-Id: <164ddc22ee0d5b63a81d5148f44c37dd132a9356.1542272812.git.mjg@fedoraproject.org>
From: Tor Andersson <tor.andersson@artifex.com>
Date: Mon, 5 Nov 2018 17:49:09 +0100
Subject: [PATCH] Fix 700043: Don't assume a font is t3 just because
fz_outline_glyph fails.
---
source/fitz/svg-device.c | 31 ++++++++++++++++---------------
1 file changed, 16 insertions(+), 15 deletions(-)
diff --git a/source/fitz/svg-device.c b/source/fitz/svg-device.c
index 2876a89b..aaf53b99 100644
--- a/source/fitz/svg-device.c
+++ b/source/fitz/svg-device.c
@@ -472,27 +472,28 @@ svg_dev_text_span_as_paths_defs(fz_context *ctx, fz_device *dev, fz_text_span *s
/* Need to send this one */
fz_rect rect;
fz_path *path;
- path = fz_outline_glyph(ctx, span->font, gid, fz_identity);
- if (path)
+ out = start_def(ctx, sdev);
+ fz_write_printf(ctx, out, "<symbol id=\"font_%x_%x\">\n", fnt->id, gid);
+ if (fz_font_ft_face(ctx, span->font))
{
- rect = fz_bound_path(ctx, path, NULL, fz_identity);
- shift.e = -rect.x0;
- shift.f = -rect.y0;
- fz_transform_path(ctx, path, shift);
- out = start_def(ctx, sdev);
- fz_write_printf(ctx, out, "<symbol id=\"font_%x_%x\">\n", fnt->id, gid);
- fz_write_printf(ctx, out, "<path");
- svg_dev_path(ctx, sdev, path);
- fz_write_printf(ctx, out, "/>\n");
- fz_drop_path(ctx, path);
+ path = fz_outline_glyph(ctx, span->font, gid, fz_identity);
+ if (path)
+ {
+ rect = fz_bound_path(ctx, path, NULL, fz_identity);
+ shift.e = -rect.x0;
+ shift.f = -rect.y0;
+ fz_transform_path(ctx, path, shift);
+ fz_write_printf(ctx, out, "<path");
+ svg_dev_path(ctx, sdev, path);
+ fz_write_printf(ctx, out, "/>\n");
+ fz_drop_path(ctx, path);
+ }
}
- else
+ else if (fz_font_t3_procs(ctx, span->font))
{
rect = fz_bound_glyph(ctx, span->font, gid, fz_identity);
shift.e = -rect.x0;
shift.f = -rect.y0;
- out = start_def(ctx, sdev);
- fz_write_printf(ctx, out, "<symbol id=\"font_%x_%x\">\n", fnt->id, gid);
fz_run_t3_glyph(ctx, span->font, gid, shift, dev);
}
fz_write_printf(ctx, out, "</symbol>\n");
--
2.19.1.1238.g4b45f61cc0

View file

@ -1,59 +1,48 @@
# Template file for 'mupdf'
pkgname=mupdf
version=1.13.0
revision=3
version=1.14.0
revision=1
wrksrc="${pkgname}-${version}-source"
hostmakedepends="pkg-config zlib-devel libcurl-devel freetype-devel
libjpeg-turbo-devel jbig2dec-devel libXext-devel libXcursor-devel
libXrandr-devel libXinerama-devel harfbuzz-devel
MesaLib-devel libopenjpeg2-devel glu-devel libXi-devel"
libXrandr-devel libXinerama-devel harfbuzz-devel readline-devel
MesaLib-devel libopenjpeg2-devel glu-devel libXi-devel libfreeglut-devel"
makedepends="$hostmakedepends"
depends="desktop-file-utils"
short_desc="Lightweight PDF and XPS viewer"
maintainer="Juan RP <xtraeme@voidlinux.org>"
license="AGPL-3"
homepage="http://mupdf.com"
distfiles="http://mupdf.com/downloads/archive/${pkgname}-${version}-source.tar.gz"
checksum=071c6962cbee1136188da62136596a9d704b81e35fe617cd34874bbb0ae7ca09
export VOID_VERSION="${version}"
maintainer="Rasmus Thomsen <rasmus.thomsen@protonmail.com>"
license="AGPL-3.0-only"
homepage="https://mupdf.com"
distfiles="https://mupdf.com/downloads/archive/${pkgname}-${version}-source.tar.gz"
checksum=c443483a678c3fc258fa4adc124146225d0bb443c522619faadebf6b363d7724
patch_args="-Np1"
pre_configure() {
rm -rf thirdparty/{curl,freetype,harfbuzz,libjpeg,zlib,jbig2dec,openjpeg}
}
pre_build() {
# libmupdf-{threads,pkcs7}.a are required by fbpdf
sed 's/INSTALL_LIBS :=/& $(THREAD_LIB) $(PKCS7_LIB)/' -i Makefile
# Also install EXTRA_APPS for mupdf-tools package
sed '/Generated depe/i INSTALL_APPS += $(EXTRA_APPS)' -i Makefile
do_configure() {
if [ "$CROSS_BUILD" ]; then
export CFLAGS="-fPIC"
unset LDFLAGS
make CC=cc LD=ld AR=ar build=release generate
make CC=cc LD=ld AR=ar CFLAGS="-fPIC" LDFLAGS='' build=release generate
fi
}
do_build() {
CFLAGS+=" -fPIC"
CFLAGS+=" $(pkg-config --cflags libopenjp2)"
CXXFLAGS+=" -fPIC"
if [ "$CROSS_BUILD" ]; then
make CURL_LIBS='-lcurl -lpthread' build=release CROSSCOMPILE=yes all extra-apps
make CFLAGS="$CFLAGS" build=release -C thirdparty/mujs CROSSCOMPILE=yes
make USE_SYSTEM_LIBS=yes CURL_LIBS='-lcurl -lpthread' build=release CROSSCOMPILE=yes all extra-apps
make CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" build=release CROSSCOMPILE=yes -C thirdparty/mujs
else
make CURL_LIBS='-lcurl -lpthread' build=release all extra-apps
make CFLAGS="$CFLAGS" build=release -C thirdparty/mujs
make USE_SYSTEM_LIBS=yes CURL_LIBS='-lcurl -lpthread' build=release all extra-apps
make V=1 CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" build=release -C thirdparty/mujs
fi
}
do_install() {
make build=release prefix=${DESTDIR}/usr install
ln -s mupdf-x11-curl ${DESTDIR}/usr/bin/mupdf
vbin build/release/mupdf-x11-curl
vbin build/release/mujstest
vbin build/release/muraster
vinstall build/release/libmupdf.so.${version} 644 usr/lib
vinstall build/release/libmupdfthird.so.${version} 644 usr/lib
vinstall build/release/libmuthreads.so.${version} 644 usr/lib
vinstall build/release/libmupkcs7.so.${version} 644 usr/lib
vinstall thirdparty/mujs/build/release/libmujs.a 644 usr/lib
make USE_SYSTEM_LIBS=yes build=release prefix=${DESTDIR}/usr install third extra-apps
vinstall ${FILESDIR}/mupdf.xpm 644 usr/share/pixmaps
vinstall ${FILESDIR}/mupdf.desktop 644 usr/share/applications
@ -63,25 +52,12 @@ post_install() {
vlicense COPYING LICENSE
}
libmupdf_package() {
short_desc+=" - shared libraries"
pkg_install() {
vmove usr/lib/libmupdf.so.${version}
vmove usr/lib/libmupdfthird.so.${version}
vmove usr/lib/libmuthreads.so.${version}
vmove usr/lib/libmupkcs7.so.${version}
}
}
mupdf-devel_package() {
short_desc+=" - development files"
depends="libmupdf libjpeg-turbo-devel jbig2dec-devel libopenjpeg2-devel"
depends="libjpeg-turbo-devel jbig2dec-devel libopenjpeg2-devel"
pkg_install() {
vmove usr/include
vmove usr/lib/libmujs.a
ln -s libmupdf.so.${version} ${PKGDESTDIR}/usr/lib/libmupdf.so
ln -s libmupdfthird.so.${version} ${PKGDESTDIR}/usr/lib/libmupdfthird.so
ln -s libmuthreads.so.${version} ${PKGDESTDIR}/usr/lib/libmuthreads.so
vmove "usr/lib/*.a"
}
}