diff options
author | Leo <thinkabit.ukim@gmail.com> | 2020-02-24 19:46:22 -0300 |
---|---|---|
committer | Leo <thinkabit.ukim@gmail.com> | 2020-02-25 08:25:48 -0300 |
commit | f75a65c0de02f4c4ea09f4f04263bb4a35f9d393 (patch) | |
tree | 7495d10aad6443d8e558c09ccf82831f1c7ee961 /community/mupdf | |
parent | a1205484a3854c10d80f57e29526fbb8f73bd6f7 (diff) | |
download | aports-f75a65c0de02f4c4ea09f4f04263bb4a35f9d393.tar.bz2 aports-f75a65c0de02f4c4ea09f4f04263bb4a35f9d393.tar.xz |
community/mupdf: move from main
Diffstat (limited to 'community/mupdf')
-rw-r--r-- | community/mupdf/APKBUILD | 106 | ||||
-rw-r--r-- | community/mupdf/fix-big-endian.patch | 104 | ||||
-rw-r--r-- | community/mupdf/shared-lib.patch | 40 |
3 files changed, 250 insertions, 0 deletions
diff --git a/community/mupdf/APKBUILD b/community/mupdf/APKBUILD new file mode 100644 index 0000000000..af99e9f762 --- /dev/null +++ b/community/mupdf/APKBUILD @@ -0,0 +1,106 @@ +# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net> +# Contributor: Michael Zhou <zhoumichaely@gmail.com> +# Maintainer: Daniel Sabogal <dsabogalcc@gmail.com> +pkgname=mupdf +pkgver=1.16.1 +pkgrel=1 +pkgdesc="Lightweight PDF and XPS viewer" +url="https://mupdf.com" +arch="all" +license="AGPL-3.0-or-later" +makedepends="freetype-dev + harfbuzz-dev + jbig2dec-dev + jpeg-dev + openjpeg-dev + readline-dev + freeglut-dev + zlib-dev + libx11-dev + libxext-dev + libxrandr-dev + libxi-dev + mesa-dev + glu-dev" + +subpackages="$pkgname-doc $pkgname-dev $pkgname-x11:_x11 + $pkgname-gl:_gl $pkgname-tools:_tools" +options="!check" +source="https://mupdf.com/downloads/archive/mupdf-$pkgver-source.tar.xz + shared-lib.patch + fix-big-endian.patch + " + +# FIXME: shared linking of /usr/lib/libmupdf.so.0 + +# secfixes: +# 1.13-r0: +# - CVE-2018-1000051 +# - CVE-2018-6544 +# - CVE-2018-6192 +# - CVE-2018-6187 +# - CVE-2018-5686 +# - CVE-2017-17858 +# 1.11-r1: +# - CVE-2017-6060 +# 1.10a-r2: +# - CVE-2017-5991 +# 1.10a-r1: +# - CVE-2017-5896 + +builddir="$srcdir/$pkgname-$pkgver-source" +prepare() { + default_prepare + rm -rf thirdparty/{curl,freeglut,freetype,harfbuzz,jbig2dec,libjpeg,openjpeg,zlib} +} + +build() { + cd "$builddir" + make USE_SYSTEM_LIBS=yes prefix=/usr CURL_LIBS='-lcurl -lpthread' build=release libs apps +} + +package() { + cd "$builddir" + make USE_SYSTEM_LIBS=yes prefix=/usr DESTDIR="$pkgdir" install + + cd build/release + local app; for app in muraster; do + install -Dm755 $app "$pkgdir"/usr/bin/$app + done + + ln -s libmupdf.so.0 "$pkgdir"/usr/lib/libmupdf.so + ln -s libmupdfthird.so.0 "$pkgdir"/usr/lib/libmupdfthird.so +} + +_x11() { + pkgdesc="$pkgdesc with X11 backend" + depends="" + + mkdir -p "$subpkgdir"/usr/bin + mv "$pkgdir"/usr/bin/mupdf-x11 \ + "$subpkgdir"/usr/bin/ + ln -s /usr/bin/mupdf-x11 "$subpkgdir"/usr/bin/mupdf +} + +_gl() { + pkgdesc="$pkgdesc with OpenGL backend" + depends="" + + mkdir -p "$subpkgdir"/usr/bin + mv "$pkgdir"/usr/bin/mupdf-gl \ + "$subpkgdir"/usr/bin/ +} + +_tools() { + pkgdesc="Tools for a lightweight PDF and XPS viewer" + depends="" + + mkdir -p "$subpkgdir"/usr/bin + mv "$pkgdir"/usr/bin/mutool \ + "$pkgdir"/usr/bin/muraster \ + "$subpkgdir"/usr/bin/ +} + +sha512sums="fa657e6b9251aff91c25e91b335ea829b797dd91a759505bfd7259f8236613f590a044bc741e9b0587da55817a1ab8c1499c067d65d683d099259d06d91a8f50 mupdf-1.16.1-source.tar.xz +5f1448005c2126c16f9e05a77486d63991110d343a4094e92d6877b11babb30b2a4c3a07580658e1e6caa805a53caf31595309c9f5203ed0a269e4d9e38af3d1 shared-lib.patch +486d09df319050ddb33dbd1e2e0638a7bc6a3e188032a35b81119c45b0de911629b827b21aa47cde6669b66d73fb22cff54d190a8449151fdc27eace71beefbd fix-big-endian.patch" diff --git a/community/mupdf/fix-big-endian.patch b/community/mupdf/fix-big-endian.patch new file mode 100644 index 0000000000..c1931626bd --- /dev/null +++ b/community/mupdf/fix-big-endian.patch @@ -0,0 +1,104 @@ +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; +@@ -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); +-- +2.18.0.rc0.294.g786209a621 + diff --git a/community/mupdf/shared-lib.patch b/community/mupdf/shared-lib.patch new file mode 100644 index 0000000000..3b758a3f37 --- /dev/null +++ b/community/mupdf/shared-lib.patch @@ -0,0 +1,40 @@ +--- 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. +-CFLAGS += $(XCFLAGS) -Iinclude ++CFLAGS += $(XCFLAGS) -Iinclude -fPIC + LIBS += $(XLIBS) -lm + + 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) + TAGS_CMD = $(QUIET_TAGS) ctags -R + 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: %.c + $(LINK_CMD) + +@@ -190,8 +194,8 @@ + + # --- Library --- + +-MUPDF_LIB = $(OUT)/libmupdf.a +-THIRD_LIB = $(OUT)/libmupdf-third.a ++MUPDF_LIB = $(OUT)/libmupdf.so.0 ++THIRD_LIB = $(OUT)/libmupdfthird.so.0 + THREAD_LIB = $(OUT)/libmupdf-threads.a + PKCS7_LIB = $(OUT)/libmupdf-pkcs7.a + |