From 1a4ddcd236d7813a9dca0fdf48b1fa4145d62b2d Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Sat, 24 Oct 2020 00:50:44 -0400 Subject: office/mupdf: Updated for version 1.18.0. Signed-off-by: B. Watson Signed-off-by: Willy Sudiarto Raharjo --- office/mupdf/README | 6 +- office/mupdf/README_shared.txt | 56 ------------------ office/mupdf/doinst.sh | 13 ++++ office/mupdf/mupdf.SlackBuild | 131 +++++++++++++++++++++++++++++++---------- office/mupdf/mupdf.info | 6 +- office/mupdf/mupdf.png | Bin 3285 -> 0 bytes office/mupdf/shared_libs.diff | 70 ---------------------- office/mupdf/slack-desc | 2 +- 8 files changed, 119 insertions(+), 165 deletions(-) delete mode 100644 office/mupdf/README_shared.txt create mode 100644 office/mupdf/doinst.sh delete mode 100644 office/mupdf/mupdf.png delete mode 100644 office/mupdf/shared_libs.diff (limited to 'office/mupdf') diff --git a/office/mupdf/README b/office/mupdf/README index c67d450b06..4d84fe11bb 100644 --- a/office/mupdf/README +++ b/office/mupdf/README @@ -19,6 +19,6 @@ regular PDF viewer, and mupdf-x11-curl has support for fetching remote resources from the network (which may be considered a security risk). mupdf-gl uses OpenGL for rendering (and doesn't support curl). -3. By default, mupdf is now built as shared libraries. If for some -reason you need static libs instead, build with STATIC=yes in the -script's environment. See README_shared.txt for more information. +3. mupdf's PDF digital signature verification and signing support is +disabled in this build, because Slackware 14.2's openssl is too old. +For most users, this is a rarely- or never-used feature anyway. diff --git a/office/mupdf/README_shared.txt b/office/mupdf/README_shared.txt deleted file mode 100644 index 227928d253..0000000000 --- a/office/mupdf/README_shared.txt +++ /dev/null @@ -1,56 +0,0 @@ - -Here is a hopefully informative mini-rant about shared library support -for mupdf. - -Upstream doesn't do shared libraries and doesn't recommend distro -packages use them. This build used to follow that advice. However, -mupdf is just too large to use as a static library. We end up with a -47MB libmupdf.a, plus 7 33MB binaries. *Every* distro I've looked at -ships mupdf as shared libs, despite upstream's policy. - -A long time ago (in 2013), I used to patch mupdf for shared lib support, -but I removed it when it stopped applying cleanly. Thomas Morper on the -slackbuilds-users mailing list recently (2018) asked if I could include -a patch (from LFS) that adds shared library support, so starting with -mupdf 1.13.0, BUILD 2, we have shared libraries again. - -In case someone *really* disagrees with this change, I added a STATIC=yes -environment setting. If you use this, you get static libs and no -shared ones, per upstream's policy. This has been tested and works for -1.13.0-2, but be aware that I probably won't be testing static builds -for every mupdf release. If you run into trouble, email me and/or the -slackbuilds-users list. - -The library versioning scheme I had to use is unfortunate. The major -soname version is supposed to only change when there's an incompatible ABI -change. The way I'm doing it, it changes for every mupdf release [*]. This -is because upstream doesn't tell us when the ABI changes, because it's -not relevant for them. They support only static libs specifically to -avoid the headache of having to track and minimize ABI changes. Whenever -they want to change the ABI, they just do it. Anything built against the -old version will keep working fine, because it's statically linked. With -shared libs, I have to invent my own library versioning scheme. - -The end result of this is, I (humble packager) can't easily tell when -the ABI has changed, so I treat every release [*] as an ABI change. Means -anything linked with libmupdf will fail with 'cannot open shared object -file' after a mupdf upgrade, so it'll have to be rebuilt. The alternative -would be to use unversioned shared libs, which would (seem to) avoid -the need to rebuild... but whenever the undocumented ABI changed, we'd -get weird behaviour and segfaults instead of a clean error message. - -The shared library patch used here is by me (B. Watson), based on a -patch from Linux From Scratch. The original LFS patch doesn't include -versioned libs, I suspect becase in LFS you tend to upgrade the entire -OS by rebuilding it, instead of upgrading just one library. - -Right now, the only SBo builds affected by mupdf upgrades will be -zathura-pdf-mupdf and possibly fbpdf (if built with optional mupdf -support). Both have been tested with shared mupdf, and both compile and -run cleanly. - -[*] Actually, not micro-version point releases (e.g. 1.13.0 => 1.13.1). - Hopefully this doesn't cause a problem later. Upstream has just - switched to a major.minor.micro version scheme starting with 1.13.0, - so I don't know how often there will be micro-version bumps, and - whether or not they'll have ABI changes. diff --git a/office/mupdf/doinst.sh b/office/mupdf/doinst.sh new file mode 100644 index 0000000000..9424ce43ff --- /dev/null +++ b/office/mupdf/doinst.sh @@ -0,0 +1,13 @@ +if [ -x /usr/bin/update-desktop-database ]; then + /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1 +fi + +if [ -x /usr/bin/update-mime-database ]; then + /usr/bin/update-mime-database usr/share/mime >/dev/null 2>&1 +fi + +if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then + if [ -x /usr/bin/gtk-update-icon-cache ]; then + /usr/bin/gtk-update-icon-cache usr/share/icons/hicolor >/dev/null 2>&1 + fi +fi diff --git a/office/mupdf/mupdf.SlackBuild b/office/mupdf/mupdf.SlackBuild index cf8e18afdc..bd6aad3948 100644 --- a/office/mupdf/mupdf.SlackBuild +++ b/office/mupdf/mupdf.SlackBuild @@ -7,6 +7,7 @@ # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. +# 20201020 bkw: update for 1.18.0. See notes, below. # 20200217 bkw: update for 1.16.1. # 20180623 bkw: BUILD=2, add patch for dynamic linking. Thanks # to Thomas Morper for pointing me in the right direction. @@ -16,8 +17,42 @@ # 20170621 bkw: fix build with -current's newer openjpeg, BUILD=2. # 20170122 bkw: update for 1.10a. +# Notes for 1.18.0: +# - This script can no longer build older versions, too many changes. +# - Upstream *finally* supports building as a shared library, so I and +# all other distro packagers can stop patching it... except the +# shared lib is unversioned, which means upgrades would cause more +# breakage than they should. So there's still some trickery here to +# build a versioned solib. +# - I've got rid of the STATIC=yes option and now only build shared libs. +# As a side effect, libmupdf-third is gone, but I've included a +# placeholder so stuff that links with it, will work without patching. +# - gumbo (HTML parser) is now a hard dep. The source is bundled, so +# there's no need to create a new gumbo SlackBuild, but it does mean +# the mupdf shared lib has grown in size. +# - mupdf-gl uses freeglut. The version we have in 14.2 is new enough to +# build with, but old enough that you can't copy text from mupdf-gl. +# So we build the bundled version here. +# - API docs are now included in the package. +# - Now using upstream's icons, including scalable SVG. +# - Add missing doinst.sh +# - There's now the option to build with tesseract and leptonica, +# but it's disabled in this script. I have yet to get it to +# actually *do* anything other than fail to build (when using +# upstream's tesseract/leptonica forks) or complain about being +# unable to load eng.traineddata (using SBo tesseract/leptonica, +# and yes eng.traineddata is fine). Until I work out what's wrong, +# or upstream releases a new version, this script doesn't support +# building with tesseract. Don't contact me about this before March +# 1, 2021, unless you actually have a patch that fixes it. After +# that, if this message is still here, feel free to remind me to +# revisit it. +# - Slackware 14.2's libcrypto (from openssl) is too old for mupdf, +# and there's no bundled souce for it. So currently mupdf is being +# built without libcrypto. Hope that's OK. + PRGNAM=mupdf -VERSION=${VERSION:-1.16.1} +VERSION=${VERSION:-1.18.0} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} @@ -49,6 +84,22 @@ else fi set -e +# Tesseract code left here for future reference. At some point upstream +# (or maybe I) will fix it. +if [ "${TESSERACT:-no}" = "yes" ]; then + TESSARGS="USE_SYSTEM_LEPTONICA=yes USE_SYSTEM_TESSERACT=yes" + cat < $PKG/usr/share/applications/$PRGNAM.desktop -# Icon converted from platform/x11/mupdf.ico, with icotool. -mkdir -p $PKG/usr/share/pixmaps -cat $CWD/$PRGNAM.png > $PKG/usr/share/pixmaps/$PRGNAM.png +# Use shipped PNG and SVG icons. +mkdir -p $PKG/usr/share/pixmaps $PKG/usr/share/icons/hicolor/scalable/apps +cat docs/logo/mupdf-icon.png > $PKG/usr/share/pixmaps/$PRGNAM.png +cat docs/logo/mupdf-logo.svg > $PKG/usr/share/icons/hicolor/scalable/apps/$PRGNAM.svg # .pc file taken from debian and parameterized. -PCLIBS="-l$PRGNAM -lfreetype -lharfbuzz -ljbig2dec -ljpeg -lcrypto -lopenjp2 -lz -lm" -PCLIBS="$PCLIBS -lmupdfthird" +# -lcrypto used to be in this list, will be again someday. +PCLIBS="-l$PRGNAM -lfreetype -lharfbuzz -ljbig2dec -ljpeg -lopenjp2 -lz -lm" mkdir -p $PKG/usr/lib$LIBDIRSUFFIX/pkgconfig/ sed -e "s,@LIB@,lib$LIBDIRSUFFIX,g" \ @@ -129,14 +198,12 @@ sed -e "s,@LIB@,lib$LIBDIRSUFFIX,g" \ $CWD/$PRGNAM.pc > $PKG/usr/lib$LIBDIRSUFFIX/pkgconfig/$PRGNAM.pc # 'make install' already installed most of the docs. -cp -a CONTRIBUTORS $PKG/usr/doc/$PRGNAM-$VERSION +cp -a CONTRIBUTORS docs/api $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild -# slack-desc will conveniently say whether javascript is built in, -# and whether libs are shared or static. mkdir -p $PKG/install -sed -e "s,@LIBTYPE@,$LIBTYPE," \ - $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/office/mupdf/mupdf.info b/office/mupdf/mupdf.info index a53a00deb2..5865c171ae 100644 --- a/office/mupdf/mupdf.info +++ b/office/mupdf/mupdf.info @@ -1,8 +1,8 @@ PRGNAM="mupdf" -VERSION="1.16.1" +VERSION="1.18.0" HOMEPAGE="https://www.mupdf.com/" -DOWNLOAD="https://www.mupdf.com/downloads/archive/mupdf-1.16.1-source.tar.xz" -MD5SUM="11075a1d882451b65c3739b588436d68" +DOWNLOAD="https://www.mupdf.com/downloads/archive/mupdf-1.18.0-source.tar.xz" +MD5SUM="3135391b027cdbedf915db1787b4ea05" DOWNLOAD_x86_64="" MD5SUM_x86_64="" REQUIRES="jbig2dec" diff --git a/office/mupdf/mupdf.png b/office/mupdf/mupdf.png deleted file mode 100644 index f7cf1a6e1b..0000000000 Binary files a/office/mupdf/mupdf.png and /dev/null differ diff --git a/office/mupdf/shared_libs.diff b/office/mupdf/shared_libs.diff deleted file mode 100644 index 8d8204b67b..0000000000 --- a/office/mupdf/shared_libs.diff +++ /dev/null @@ -1,70 +0,0 @@ -diff -Naur mupdf-1.16.1-source/Makefile mupdf-1.16.1-source.patched/Makefile ---- mupdf-1.16.1-source/Makefile 2019-08-02 10:49:26.000000000 -0400 -+++ mupdf-1.16.1-source.patched/Makefile 2020-02-17 22:15:13.596704068 -0500 -@@ -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) -@@ -189,17 +189,21 @@ - - # --- Library --- - --MUPDF_LIB = $(OUT)/libmupdf.a --THIRD_LIB = $(OUT)/libmupdf-third.a --THREAD_LIB = $(OUT)/libmupdf-threads.a --PKCS7_LIB = $(OUT)/libmupdf-pkcs7.a -+MUPDF_LIB = $(OUT)/libmupdf.so -+THIRD_LIB = $(OUT)/libmupdf-third.so -+THREAD_LIB = $(OUT)/libmupdf-threads.so -+PKCS7_LIB = $(OUT)/libmupdf-pkcs7.so - --$(MUPDF_LIB) : $(MUPDF_OBJ) -+$(MUPDF_LIB) : $(MUPDF_OBJ) $(THIRD_LIB) $(THREAD_LIB) -+ $(LINK_CMD) -shared -Wl,-soname -Wl,libmupdf.so.$(SOMAJOR) -Wl,--no-undefined $(THIRD_LIBS) - $(THIRD_LIB) : $(THIRD_OBJ) -+ $(LINK_CMD) -shared -Wl,-soname -Wl,libmupdf-third.so.$(SOMAJOR) -Wl,--no-undefined - $(THREAD_LIB) : $(THREAD_OBJ) -+ $(LINK_CMD) -shared -Wl,-soname -Wl,libmupdf-threads.so.$(SOMAJOR) -Wl,--no-undefined -lpthread - $(PKCS7_LIB) : $(PKCS7_OBJ) -+ $(LINK_CMD) -shared -Wl,-soname -Wl,libmupfs-pkcs7.so.$(SOMAJOR) - --INSTALL_LIBS := $(MUPDF_LIB) $(THIRD_LIB) -+INSTALL_LIBS := $(MUPDF_LIB) $(THIRD_LIB) $(THREAD_LIB) $(PKCS7_LIB) - - # --- Main tools and viewers --- - -@@ -294,6 +298,14 @@ - - VERSION = $(shell git describe --tags) - -+# 20180623 bkw: major/minor/micro versions for shared library. -+# SOMAJOR is the mupdf major/minor version jammed together (e.g. 113 -+# for 1.13.0). -+# SOMINOR is the mupdf micro version (e.g. 0 for 1.13.0). -+SOMAJOR = $(shell echo $(VERSION) | cut -d. -f1-2 | sed 's,\.,,g' ) -+SOMINOR = $(shell echo $(VERSION) | cut -d. -f3- | sed 's,\.,,g' ) -+SOVER = $(SOMAJOR).$(SOMINOR) -+ - version: - sed -i~ -e '/FZ_VERSION /s/".*"/"'$(VERSION)'"/' include/mupdf/fitz/version.h - -@@ -331,7 +343,13 @@ - install -m 644 include/mupdf/pdf/*.h $(DESTDIR)$(incdir)/mupdf/pdf - - install -d $(DESTDIR)$(libdir) -- install -m 644 $(INSTALL_LIBS) $(DESTDIR)$(libdir) -+ install -s -m0755 $(INSTALL_LIBS) $(DESTDIR)$(libdir) -+ ( cd $(DESTDIR)$(libdir) ; \ -+ for i in $(INSTALL_LIBS); do \ -+ j=$$( basename $$i) ; \ -+ mv $$j $$j.$(SOVER) ; \ -+ ln -s $$j.$(SOVER) $$j ; \ -+ done ) - - install -d $(DESTDIR)$(bindir) - install -m 755 $(TOOL_APPS) $(VIEW_APPS) $(DESTDIR)$(bindir) diff --git a/office/mupdf/slack-desc b/office/mupdf/slack-desc index eac6630b9e..b2765401f2 100644 --- a/office/mupdf/slack-desc +++ b/office/mupdf/slack-desc @@ -15,5 +15,5 @@ mupdf: the look of a printed page on screen. mupdf: mupdf: https://www.mupdf.com/ mupdf: -mupdf: This package installs @LIBTYPE@ libraries. +mupdf: mupdf: -- cgit v1.2.3