aboutsummaryrefslogtreecommitdiffstats
path: root/main/mupdf
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2019-05-06 19:52:46 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2019-05-06 19:53:43 +0000
commit7903fcb145557053a224b14efed92516d3a78c58 (patch)
tree366fa1f1e394ad8dc10379ba00b16c10ddb901e3 /main/mupdf
parent2757235ef94f59233d2dc36eff13adabb4b91306 (diff)
downloadaports-7903fcb145557053a224b14efed92516d3a78c58.tar.bz2
aports-7903fcb145557053a224b14efed92516d3a78c58.tar.xz
main/mupdf: build fix for s390x (big endian)
Diffstat (limited to 'main/mupdf')
-rw-r--r--main/mupdf/APKBUILD6
-rw-r--r--main/mupdf/fix-big-endian.patch122
2 files changed, 126 insertions, 2 deletions
diff --git a/main/mupdf/APKBUILD b/main/mupdf/APKBUILD
index ef560c80d8..419a952743 100644
--- a/main/mupdf/APKBUILD
+++ b/main/mupdf/APKBUILD
@@ -3,7 +3,7 @@
# Maintainer: Daniel Sabogal <dsabogalcc@gmail.com>
pkgname=mupdf
pkgver=1.14.0
-pkgrel=0
+pkgrel=1
pkgdesc="Lightweight PDF and XPS viewer"
url="https://mupdf.com"
arch="all"
@@ -28,6 +28,7 @@ subpackages="$pkgname-doc $pkgname-dev $pkgname-x11:_x11
options="!check"
source="https://mupdf.com/downloads/archive/$pkgname-$pkgver-source.tar.xz
shared-lib.patch
+ fix-big-endian.patch
"
# FIXME: shared linking of /usr/lib/libmupdf.so.0
@@ -102,4 +103,5 @@ _tools() {
}
sha512sums="bd41125dac1a81b7dbbfbb5f5e06e70bb601854731e0945983688da5d8d7c0bca9771fff2e4b6d9c36dbead6146f0a866ed7427d58e13d02ed6dfd94dcfe54bf mupdf-1.14.0-source.tar.xz
-886371860d5fd35001b436051173f4cf991656d5920bbc60c032d98f45539d20c23ed5ff358bf968f578e16b21fced09349ac5cb6c7a738946430ded3fb644fa shared-lib.patch"
+886371860d5fd35001b436051173f4cf991656d5920bbc60c032d98f45539d20c23ed5ff358bf968f578e16b21fced09349ac5cb6c7a738946430ded3fb644fa shared-lib.patch
+9b38fcaad43a3369f660c7fcce71ffe83da19c92589edd1e20787f8f4a1767f88be49fd7c30027e9d2e75df0eb10834cac924385a32408d7f6444adbed537d3f fix-big-endian.patch"
diff --git a/main/mupdf/fix-big-endian.patch b/main/mupdf/fix-big-endian.patch
new file mode 100644
index 0000000000..a363beaf3e
--- /dev/null
+++ b/main/mupdf/fix-big-endian.patch
@@ -0,0 +1,122 @@
+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/thirdparty/lcms2/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
+