Commit 010d7fa4 authored by Milan P. Stanić's avatar Milan P. Stanić Committed by Natanael Copa

main/mupdf: upgrade to 1.14.0

remove 0001-fix-build-on-big-endian.patch
fixed shared-lib.patch
add note about linking problem of /usr/lib/libmupdf.so.0
parent 381bf6b1
From 5fb79e6ccb805b3d94c8bb8eb0990d9944ae7602 Mon Sep 17 00:00:00 2001
Message-Id: <5fb79e6ccb805b3d94c8bb8eb0990d9944ae7602.1528041417.git.mjg@fedoraproject.org>
From: Michael J Gruber <mjg@fedoraproject.org>
Date: Sun, 3 Jun 2018 17:55:46 +0200
Subject: [PATCH] fix build on big endian
0dc1153 ("Spread of context into all procedures and removal from
structures", 2017-04-26) missed a few spots that are relevant on big
endian only.
Add the missing ContextIDs in the call chain so that the build succeeds
again.
Signed-off-by: Michael J Gruber <mjg@fedoraproject.org>
---
src/cmsmd5.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/src/cmsmd5.c b/src/cmsmd5.c
index 4b8f7f9..dd0925a 100644
--- a/src/cmsmd5.c
+++ b/thirdparty/lcms2/src/cmsmd5.c
@@ -29,7 +29,7 @@
#ifdef CMS_USE_BIG_ENDIAN
static
-void byteReverse(cmsUInt8Number * buf, cmsUInt32Number longs)
+void byteReverse(cmsContext ContextID, cmsUInt8Number * buf, cmsUInt32Number longs)
{
do {
@@ -42,7 +42,7 @@ void byteReverse(cmsUInt8Number * buf, cmsUInt32Number longs)
}
#else
-#define byteReverse(buf, len)
+#define byteReverse(ContextID, buf, len)
#endif
@@ -172,7 +172,7 @@ cmsHANDLE MD5alloc(cmsContext ContextID)
static
-void MD5add(cmsHANDLE Handle, cmsUInt8Number* buf, cmsUInt32Number len)
+void MD5add(cmsContext ContextID, cmsHANDLE Handle, cmsUInt8Number* buf, cmsUInt32Number len)
{
_cmsMD5* ctx = (_cmsMD5*) Handle;
cmsUInt32Number t;
@@ -196,7 +196,7 @@ void MD5add(cmsHANDLE Handle, cmsUInt8Number* buf, cmsUInt32Number len)
}
memmove(p, buf, t);
- byteReverse(ctx->in, 16);
+ byteReverse(ContextID, ctx->in, 16);
MD5_Transform(ctx->buf, (cmsUInt32Number *) ctx->in);
buf += t;
@@ -205,7 +205,7 @@ void MD5add(cmsHANDLE Handle, cmsUInt8Number* buf, cmsUInt32Number len)
while (len >= 64) {
memmove(ctx->in, buf, 64);
- byteReverse(ctx->in, 16);
+ byteReverse(ContextID, ctx->in, 16);
MD5_Transform(ctx->buf, (cmsUInt32Number *) ctx->in);
buf += 64;
len -= 64;
@@ -216,7 +216,7 @@ void MD5add(cmsHANDLE Handle, cmsUInt8Number* buf, cmsUInt32Number len)
// Destroy the object and return the checksum
static
-void MD5finish(cmsProfileID* ProfileID, cmsHANDLE Handle)
+void MD5finish(cmsContext ContextID, cmsProfileID* ProfileID, cmsHANDLE Handle)
{
_cmsMD5* ctx = (_cmsMD5*) Handle;
cmsUInt32Number count;
@@ -232,21 +232,21 @@ void MD5finish(cmsProfileID* ProfileID, cmsHANDLE Handle)
if (count < 8) {
memset(p, 0, count);
- byteReverse(ctx->in, 16);
+ byteReverse(ContextID, ctx->in, 16);
MD5_Transform(ctx->buf, (cmsUInt32Number *) ctx->in);
memset(ctx->in, 0, 56);
} else {
memset(p, 0, count - 8);
}
- byteReverse(ctx->in, 14);
+ byteReverse(ContextID, ctx->in, 14);
((cmsUInt32Number *) ctx->in)[14] = ctx->bits[0];
((cmsUInt32Number *) ctx->in)[15] = ctx->bits[1];
MD5_Transform(ctx->buf, (cmsUInt32Number *) ctx->in);
- byteReverse((cmsUInt8Number *) ctx->buf, 4);
+ byteReverse(ContextID, (cmsUInt8Number *) ctx->buf, 4);
memmove(ProfileID ->ID8, ctx->buf, 16);
_cmsFree(ctx ->ContextID, ctx);
@@ -291,7 +291,7 @@ cmsBool CMSEXPORT cmsMD5computeID(cmsContext ContextID, cmsHPROFILE hProfile)
if (MD5 == NULL) goto Error;
// Add all bytes
- MD5add(MD5, Mem, BytesNeeded);
+ MD5add(ContextID,MD5, Mem, BytesNeeded);
// Temp storage is no longer needed
_cmsFree(ContextID, Mem);
@@ -300,7 +300,7 @@ cmsBool CMSEXPORT cmsMD5computeID(cmsContext ContextID, cmsHPROFILE hProfile)
memmove(Icc, &Keep, sizeof(_cmsICCPROFILE));
// And store the ID
- MD5finish(&Icc ->ProfileID, MD5);
+ MD5finish(ContextID, &Icc ->ProfileID, MD5);
return TRUE;
Error:
--
2.18.0.rc0.294.g786209a621
......@@ -2,8 +2,8 @@
# Contributor: Michael Zhou <zhoumichaely@gmail.com>
# Maintainer: Daniel Sabogal <dsabogalcc@gmail.com>
pkgname=mupdf
pkgver=1.13.0
pkgrel=2
pkgver=1.14.0
pkgrel=0
pkgdesc="Lightweight PDF and XPS viewer"
url="https://mupdf.com"
arch="all"
......@@ -14,6 +14,8 @@ makedepends="freetype-dev
jbig2dec-dev
jpeg-dev
openjpeg-dev
readline-dev
freeglut-dev
zlib-dev
libx11-dev
libxext-dev
......@@ -26,8 +28,8 @@ subpackages="$pkgname-doc $pkgname-dev $pkgname-x11:_x11
options="!check"
source="https://mupdf.com/downloads/archive/$pkgname-$pkgver-source.tar.xz
shared-lib.patch
0001-fix-build-on-big-endian.patch
"
# FIXME: shared linking of /usr/lib/libmupdf.so.0
# secfixes:
# 1.13-r0:
......@@ -47,25 +49,17 @@ source="https://mupdf.com/downloads/archive/$pkgname-$pkgver-source.tar.xz
builddir="$srcdir/$pkgname-$pkgver-source"
prepare() {
default_prepare
# freeglut and lcms2 are mupdf-specific forks:
# https://src.fedoraproject.org/rpms/mupdf/blob/master/f/mupdf.spec#_15
local file; for file in thirdparty/*; do
[ "${file##*/}" != "freeglut" ] && \
[ "${file##*/}" != "lcms2" ] && \
[ "${file##*/}" != "mujs" ] && \
rm -rf "$file"
done
rm -rf thirdparty/{curl,freeglut,freetype,harfbuzz,jbig2dec,libjpeg,openjpeg,zlib}
}
build() {
cd "$builddir"
make prefix=/usr build=release all extra-apps
make USE_SYSTEM_LIBS=yes prefix=/usr CURL_LIBS='-lcurl -lpthread' build=release all extra-apps
}
package() {
cd "$builddir"
make prefix=/usr DESTDIR="$pkgdir" install
make USE_SYSTEM_LIBS=yes prefix=/usr DESTDIR="$pkgdir" install
cd build/release
local app; for app in mjsgen mujstest muraster; do
......@@ -107,6 +101,5 @@ _tools() {
"$subpkgdir"/usr/bin/
}
sha512sums="c40694d907bb44f18ccf276b3014867f5e0031259064d6f5f4c2bb17bcf1c6773ea0b12b5b99bc3d88bbe69b574e323c490e387e8199f796b44b76bae01f8924 mupdf-1.13.0-source.tar.xz
8d3f22908060351e8bb171c7c8248662dd6ac3fb5c765ad0ce33f33c418f6bcfb1982ea8e97b4fefee067c675cac03f76e8b715640dfd3689e8d7738384b6536 shared-lib.patch
420057d091ac810e077ebe77c631670c4a21ad7a817ffabe9a453192b3165d86dcb52f23fa8b36e98dfea6ea895db85cb5049557de89decb94b466311c417430 0001-fix-build-on-big-endian.patch"
sha512sums="bd41125dac1a81b7dbbfbb5f5e06e70bb601854731e0945983688da5d8d7c0bca9771fff2e4b6d9c36dbead6146f0a866ed7427d58e13d02ed6dfd94dcfe54bf mupdf-1.14.0-source.tar.xz
886371860d5fd35001b436051173f4cf991656d5920bbc60c032d98f45539d20c23ed5ff358bf968f578e16b21fced09349ac5cb6c7a738946430ded3fb644fa shared-lib.patch"
--- mupdf-1.12.0-source/Makefile.orig
+++ mupdf-1.12.0-source/Makefile
@@ -14,7 +14,7 @@
--- a/Makefile 2018-10-04 09:19:28.000000000 +0000
+++ b/Makefile 2018-10-04 09:19:28.000000000 +0000
@@ -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.
......@@ -8,33 +8,33 @@
+CFLAGS += $(XCFLAGS) -Iinclude -fPIC
LIBS += $(XLIBS) -lm
LIBS += $(FREETYPE_LIBS)
@@ -75,6 +75,7 @@
CXX_CMD = $(QUIET_CXX) $(CXX) $(CFLAGS) -o $@ -c $<
AR_CMD = $(QUIET_AR) $(AR) cr $@ $^
LINK_CMD = $(QUIET_LINK) $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
ifneq ($(threading),no)
@@ -58,6 +58,7 @@
RANLIB_CMD = $(QUIET_RANLIB) $(RANLIB) $@
endif
LINK_CMD = $(QUIET_LINK) $(MKTGTDIR) ; $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
+LINK_SHARED_CMD = $(QUIET_LINK) $(CC) $(LDFLAGS) -shared -Wl,-soname,$(notdir $@) -o $@ $^ $(LIBS)
MKDIR_CMD = $(QUIET_MKDIR) mkdir -p $@
RM_CMD = $(QUIET_RM) rm -f $@
TAGS_CMD = $(QUIET_TAGS) ctags $^
@@ -90,6 +91,9 @@
WINDRES_CMD = $(QUIET_WINDRES) $(MKTGTDIR) ; $(WINDRES) $< $@
OBJCOPY_CMD = $(QUIET_OBJCOPY) $(MKTGTDIR) ; $(LD) -r -b binary -o $@ $<
@@ -68,6 +69,9 @@
$(AR_CMD)
$(RANLIB_CMD)
+$(OUT)/%.so.0: $(OUT)/%.a
+ $(LINK_SHARED_CMD)
+
$(OUT)/%.exe: $(OUT)/%.o | $(ALL_DIR)
$(OUT)/%.exe: %.c
$(LINK_CMD)
@@ -312,8 +316,8 @@
@@ -190,8 +194,8 @@
# --- Library ---
-MUPDF_LIB = $(OUT)/libmupdf.a
-THIRD_LIB = $(OUT)/libmupdfthird.a
-THIRD_LIB = $(OUT)/libmupdf-third.a
+MUPDF_LIB = $(OUT)/libmupdf.so.0
+THIRD_LIB = $(OUT)/libmupdfthird.so.0
THREAD_LIB = $(OUT)/libmuthreads.a
THREAD_LIB = $(OUT)/libmupdf-threads.a
PKCS7_LIB = $(OUT)/libmupdf-pkcs7.a
MUPDF_OBJ := \
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment