diff options
Diffstat (limited to 'office/mupdf')
-rw-r--r-- | office/mupdf/README | 32 | ||||
-rw-r--r-- | office/mupdf/README_shared.txt | 56 | ||||
-rw-r--r-- | office/mupdf/doinst.sh | 13 | ||||
-rw-r--r-- | office/mupdf/mupdf.SlackBuild | 268 | ||||
-rw-r--r-- | office/mupdf/mupdf.info | 10 | ||||
-rw-r--r-- | office/mupdf/mupdf.pc | 1 | ||||
-rw-r--r-- | office/mupdf/mupdf.png | bin | 3285 -> 0 bytes | |||
-rw-r--r-- | office/mupdf/shared_libs.diff | 76 | ||||
-rw-r--r-- | office/mupdf/slack-desc | 6 |
9 files changed, 204 insertions, 258 deletions
diff --git a/office/mupdf/README b/office/mupdf/README index 9c57e36921..82512e4acd 100644 --- a/office/mupdf/README +++ b/office/mupdf/README @@ -1,25 +1,25 @@ mupdf is a lightweight PDF, CBZ, and XPS viewer and toolkit. -The renderer in MuPDF is tailored for high quality anti-aliased graphics. -MuPDF renders text with metrics and spacing accurate to within fractions of -a pixel for the highest fidelity in reproducing the look of a printed page -on screen. +The renderer in MuPDF is tailored for high quality anti-aliased +graphics. MuPDF renders text with metrics and spacing accurate to +within fractions of a pixel for the highest fidelity in reproducing +the look of a printed page on screen. -MuPDF is also small, fast, and yet complete. It supports PDF 1.7 with -transparency, encryption, hyperlinks, annotations, searching and more. It -also reads XPS and OpenXPS documents. MuPDF is written modularly, so -features can be added on by integrators if they so desire. +MuPDF is also small, fast, and yet complete. It supports PDF 1.7 +with transparency, encryption, hyperlinks, annotations, searching +and more. It also reads XPS and OpenXPS documents. MuPDF is written +modularly, so features can be added on by integrators if they so +desire. + +Optional dependency: tesseract. If this is installed, mupdf will be +built with OCR support. If it's installed but you don't want to build +mupdf with it, export TESSERACT=no in the environment. Notes: -1. By default, mupdf is built without JavaScript support. If you want -to try mupdf's experimental JavaScript support, build with MUJS=yes in -the script's environment. +1. It's no longer possible to build mupdf without JavaScript support. -2. Two mupdf executables are installed in /usr/bin. mupdf-x11 is the +2. Three mupdf executables are installed in /usr/bin. mupdf-x11 is the regular PDF viewer, and mupdf-x11-curl has support for fetching remote resources from the network (which may be considered a security risk). - -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. +mupdf-gl uses OpenGL for rendering (and doesn't support curl). 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 bccd04f5cb..81d5742501 100644 --- a/office/mupdf/mupdf.SlackBuild +++ b/office/mupdf/mupdf.SlackBuild @@ -1,12 +1,23 @@ -#!/bin/sh +#!/bin/bash # Slackware build script for mupdf # Originally written by Hubert Hesse (email removed). -# Heavily modified by B. Watson (yalhcru@gmail.com). +# Heavily modified by B. Watson (urchlay@slackware.uk). # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. +# 20240314 bkw: update for 1.23.11. +# 20230531 bkw: BUILD=2, actually use SLKCFLAGS. +# 20230117 bkw: update for 1.21.1. +# - Again, this script can't build older versions. +# - There's a gumbo-parser SlackBuild now, so build with it instead of +# upstream's bundled version. +# - tesseract builds work, so make that an option. +# - Include pre-scaled PNG icons. + +# 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. # 20180615 bkw: update for 1.13.0, move old change comments to ChangeLog.old @@ -15,10 +26,47 @@ # 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. + +cd $(dirname $0) ; CWD=$(pwd) + PRGNAM=mupdf -VERSION=${VERSION:-1.13.0} -BUILD=${BUILD:-2} +VERSION=${VERSION:-1.23.11} +BUILD=${BUILD:-1} TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} if [ -z "$ARCH" ]; then case "$( uname -m )" in @@ -28,7 +76,11 @@ if [ -z "$ARCH" ]; then esac fi -CWD=$(pwd) +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} @@ -48,105 +100,123 @@ else fi set -e +# Building mupdf seems to work OK if an older version is installed, +# but I only tested 1.21.1 when 1.18.0 was installed (doesn't mean +# it works for all versions). +print_failed_message() { + if pkg-config --exists mupdf; then + cat 1>&2 <<EOF + +************************************************************************** +* The build failed. This might have happened because you had an existing * +* (older) mupdf package installed. Run "removepkg mupdf" and try again. * +************************************************************************** +EOF + fi + exit 1 +} + +# 20230117 bkw: tesseract builds work fine in 1.21.1, but tesseract +# doesn't get autodetected. Help it out a little. +TESS=no +[ "${TESSERACT:-yes}" = "yes" ] && pkg-config --exists tesseract && TESS=yes + rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP rm -rf $PRGNAM-$VERSION-source -tar xvf $CWD/$PRGNAM-$VERSION-source.tar.gz +tar xvf $CWD/$PRGNAM-$VERSION-source.tar.lz cd $PRGNAM-$VERSION-source -# don't find/chown/chmod until after the thirdparty junk is removed. - -# Build against system libs instead of bundled ones. If we didn't do this, -# libmupdf would be useless for building anything else. - -# Everything removed from thirdparty/ has to be installed systemwide, and must -# either be a Slackware core pkg, or mentioned in REQUIRES= in the .info -# file... except mujs, which is mupdf's javascript support lib. If missing, -# we end up with a mupdf with no JS support, which is probably a good idea -# for the default build. If you want javascript, MUJS=yes in the env. - -MUJS="${MUJS:-no}" - -if [ "$MUJS" = "yes" ]; then - mv thirdparty/mujs .keep - rm -rf thirdparty/* - mv .keep thirdparty/mujs - WITH=with -else - rm -rf thirdparty/* - sed -i 's,murun\.o,,' Makefile - sed -i 's,pdf_drop_js.*,;,' source/pdf/pdf-xref.c - sed -i '/murun_main/d' source/tools/mutool.c - WITH=without -fi - chown -R root:root . -find -L . \ - \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \ - -exec chmod 755 {} \+ -o \ - \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ - -exec chmod 644 {} \+ - -# ref https://bugs.ghostscript.com/show_bug.cgi?id=697175 -sed -i '/#define *OPJ_STATIC/d' source/fitz/load-jpx.c +find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \ + \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+ # Hard-code the version number so it'll stop trying to use git to retrieve # it and spewing harmless but scary 'fatal: Not a git repository' errors. sed -i "/^VERSION/s,=.*,= $VERSION," Makefile -# 20180623 bkw: Finally, dynamic linking again. Patch is based on -# http://www.linuxfromscratch.org/patches/blfs/svn/mupdf-1.13.0-shared_libs-1.patch -# but I added versioned sonames. See README_shared.txt for the gory details. -STATIC=${STATIC:-no} - -if [ "$STATIC" != "yes" ]; then - patch -p1 < $CWD/shared_libs.diff - LIBTYPE=shared -else - LIBTYPE=static -fi - +# 20230531 bkw: derp. Never did apply the flags... +sed -i "s,-O2,$SLKCFLAGS," Makerules + +# As of 1.18.0, we don't actually have to patch the Makefile +# to do a versioned shared lib, but we do have to override some +# variables. SOMAJOR is the mupdf major and zero-padded minor version +# jammed together (e.g. 113 for 1.13.0, 203 for 2.3.0). SOMINOR is the +# mupdf micro version (e.g. 0 for 1.13.0). +SOMAJOR=$(echo $VERSION | cut -d. -f1-2 | sed -e 's,\.[0-9]$,0&,' -e 's,\.,,g') +SOMINOR=$(echo $VERSION | cut -d. -f3- | sed 's,\.,,g' ) +SOVER=$SOMAJOR.$SOMINOR + +# Build against system libs instead of bundled ones, where possible. +# Upstream recommends using their bundled lcms2 and mujs, I'll go with that. +# Also, we *still* (in Slack 15.0) have to use the bundled freeglut +# to get copy/paste working in mupdf-gl. +# C++ (XCXXFLAGS) is only actually used if building with tesseract. make verbose=yes \ - XCFLAGS="$SLKCFLAGS -DJBIG_NO_MEMENTO" \ - HAVE_MUJS="$MUJS" \ + shared=yes \ + LIB_LDFLAGS="-shared -Wl,-soname -Wl,libmupdf.so.$SOMAJOR" \ + USE_SYSTEM_LIBS=yes \ + USE_SYSTEM_GLUT=no \ + tesseract=$TESS \ build=release \ prefix=/usr \ libdir=/usr/lib$LIBDIRSUFFIX \ mandir=/usr/man \ docdir=/usr/doc/$PRGNAM-$VERSION \ DESTDIR=$PKG \ - all extra-apps install - -# 1.12.0 used to install this stuff with 'make install', 1.13.0 doesn't: -for i in mjsgen muraster mupdf-x11-curl; do - [ -e build/release/$i ] && install -s -m0755 build/release/$i $PKG/usr/bin -done - -strip $PKG/usr/bin/* - -find $PKG/usr/man -type f -exec gzip -9 {} \; -for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done + all install || print_failed_message + +# bins and libs are already stripped. +gzip -9 $PKG/usr/man/man1/*.1 + +# 20230117 bkw: fix up the lib dir. +cd $PKG/usr/lib$LIBDIRSUFFIX + # 20230117 bkw: AFAIK, we have to list every shared lib this one + # depends on in the .pc file. This rather odd-looking bit of code + # creates the list. + PCLIBS="-lmupdf $( + objdump -p libmupdf.so | \ + perl -ne 'next unless /NEEDED/; + chomp; + s,.* lib([^.]*)\.so.*,\1,; + print "-l$_ " unless /^(c|gcc_s)$/;' + )" + WITHTESS=WITHOUT + echo "$PCLIBS" | grep -q ltesseract && WITHTESS=WITH + echo "==> PCLIBS='$PCLIBS'" + + # 20230117 bkw: the library is versioned, but the filename isn't... + chmod 755 libmupdf.so + mv libmupdf.so libmupdf.so.$SOVER + ln -s libmupdf.so.$SOVER libmupdf.so + ln -s libmupdf.so.$SOVER libmupdf.so.$SOMAJOR + + # .pc file taken from debian and parameterized. + mkdir -p pkgconfig/ + sed -e "s,@LIB@,lib$LIBDIRSUFFIX,g" \ + -e "s,@VERSION@,$VERSION,g" \ + -e "s,@PCLIBS@,$PCLIBS,g" \ + $CWD/$PRGNAM.pc > pkgconfig/$PRGNAM.pc + + # Historically, mupdf has included two libraries: libmupdf itself, + # and libmupdf-third, containing all the bundled third party code + # included with the source. In version >=1.18.0, when building a + # shared lib, no libmupdf-third gets created (all the code ends up in + # libmupdf.so). However, most projects that link with libmupdf expect + # this library to exist. This will probably change in the future as + # those projects get updated for the changes in mupdf, but for now, + # to be compatible with older mupdf versions, we include an empty + # libmupdf-third for stuff to link with. + ar crs libmupdf-third.a +cd - # Compatibility symlinks. Older versions, the binary is just "mupdf". -# Separate -curl binary exists in 1.5 but not 1.4. ln -s $PRGNAM-x11 $PKG/usr/bin/$PRGNAM -ln -s $PRGNAM.1.gz $PKG/usr/man/man1/$PRGNAM-x11.1.gz -[ -e $PKG/usr/bin/$PRGNAM-x11-curl ] && \ - ln -s $PRGNAM.1.gz $PKG/usr/man/man1/$PRGNAM-x11-curl.1.gz - -# mujstest is useless if we don't have JS support. Also libmupdfthird.a -# ends up 8 bytes long & has no object code in it. -[ "$MUJS" = "yes" ] || \ - rm -f $PKG/usr/bin/mujstest \ - $PKG/usr/lib$LIBDIRSUFFIX/libmupdfthird.a - -# Installed permissions are atrocious (everything 755). -find $PKG -type f | xargs chmod 644 -chmod 755 $PKG/usr/bin/* -if [ "$STATIC" != "yes" ]; then - chmod 755 $PKG/usr/lib$LIBDIRSUFFIX/lib*.so.*.* -fi +for i in x11 x11-curl gl; do + [ -e $PKG/usr/bin/$PRGNAM-$i ] && \ + ln -s $PRGNAM.1.gz $PKG/usr/man/man1/$PRGNAM-$i.1.gz +done # .desktop taken from debian and modified: # - make it validate. @@ -154,30 +224,26 @@ fi mkdir -p $PKG/usr/share/applications cat $CWD/$PRGNAM.desktop > $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 - -# .pc file taken from debian and parameterized. -PCLIBS="-l$PRGNAM -lfreetype -lharfbuzz -ljbig2dec -ljpeg -lcrypto -lopenjp2 -lz -lm" -[ "$MUJS" = "yes" ] && PCLIBS="$PCLIBS -lmupdfthird" - -mkdir -p $PKG/usr/lib$LIBDIRSUFFIX/pkgconfig/ -sed -e "s,@LIB@,lib$LIBDIRSUFFIX,g" \ - -e "s,@VERSION@,$VERSION,g" \ - -e "s,@PCLIBS@,$PCLIBS,g" \ - $CWD/$PRGNAM.pc > $PKG/usr/lib$LIBDIRSUFFIX/pkgconfig/$PRGNAM.pc +# Use shipped SVG icon, make PNGs at various sizes. +mkdir -p $PKG/usr/share/pixmaps $PKG/usr/share/icons/hicolor/scalable/apps +svg=docs/logo/mupdf-logo.svg +for i in 16 22 32 48 64 128; do + px=${i}x${i} + dir=$PKG/usr/share/icons/hicolor/$px/apps + mkdir -p $dir + rsvg-convert --width=$i --height=$i -o $dir/$PRGNAM.png $svg +done +cat $svg > $PKG/usr/share/icons/hicolor/scalable/apps/$PRGNAM.svg +ln -s ../icons/hicolor/48x48/apps/$PRGNAM.png $PKG/usr/share/pixmaps/$PRGNAM.png # 'make install' already installed most of the docs. +# 20240314 bkw: docs/api removed from upstream source. cp -a CONTRIBUTORS $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,@WITH@,$WITH," \ - -e "s,@LIBTYPE@,$LIBTYPE," \ - $CWD/slack-desc > $PKG/install/slack-desc +sed "s,@WITHTESS@,$WITHTESS," < $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} +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/office/mupdf/mupdf.info b/office/mupdf/mupdf.info index 1baf451ab3..8c3e38516c 100644 --- a/office/mupdf/mupdf.info +++ b/office/mupdf/mupdf.info @@ -1,10 +1,10 @@ PRGNAM="mupdf" -VERSION="1.13.0" +VERSION="1.23.11" HOMEPAGE="https://www.mupdf.com/" -DOWNLOAD="https://www.mupdf.com/downloads/archive/mupdf-1.13.0-source.tar.gz" -MD5SUM="447bc5c3305efe9645e12fce759e0198" +DOWNLOAD="https://www.mupdf.com/downloads/archive/mupdf-1.23.11-source.tar.lz" +MD5SUM="2a1afc01ba949a383ac3a308058b063b" DOWNLOAD_x86_64="" MD5SUM_x86_64="" -REQUIRES="jbig2dec" +REQUIRES="jbig2dec gumbo-parser" MAINTAINER="B. Watson" -EMAIL="yalhcru@gmail.com" +EMAIL="urchlay@slackware.uk" diff --git a/office/mupdf/mupdf.pc b/office/mupdf/mupdf.pc index 50cb195d72..2f8aa9afcf 100644 --- a/office/mupdf/mupdf.pc +++ b/office/mupdf/mupdf.pc @@ -5,7 +5,6 @@ includedir=${prefix}/include Name: mupdf Description: Library for rendering PDF documents -Requires.private: freetype2 Version: @VERSION@ Libs: -L${libdir} @PCLIBS@ Cflags: -I${includedir} diff --git a/office/mupdf/mupdf.png b/office/mupdf/mupdf.png Binary files differdeleted file mode 100644 index f7cf1a6e1b..0000000000 --- a/office/mupdf/mupdf.png +++ /dev/null diff --git a/office/mupdf/shared_libs.diff b/office/mupdf/shared_libs.diff deleted file mode 100644 index 465028f632..0000000000 --- a/office/mupdf/shared_libs.diff +++ /dev/null @@ -1,76 +0,0 @@ -diff -Naur mupdf-1.13.0-source/Makefile mupdf-1.13.0-source.patched/Makefile ---- mupdf-1.13.0-source/Makefile 2018-04-12 09:14:06.000000000 -0400 -+++ mupdf-1.13.0-source.patched/Makefile 2018-06-23 15:24:50.242018433 -0400 -@@ -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) -@@ -325,10 +325,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 -+THIRD_LIB = $(OUT)/libmupdfthird.so -+THREAD_LIB = $(OUT)/libmuthreads.so -+PKCS7_LIB = $(OUT)/libmupkcs7.so - - MUPDF_OBJ := \ - $(FITZ_OBJ) \ -@@ -355,12 +355,16 @@ - $(ZLIB_OBJ) \ - $(LCMS2_OBJ) - --$(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_LIB) : $(THIRD_OBJ) -+ $(LINK_CMD) -shared -Wl,-soname -Wl,libmupdfthird.so.$(SOMAJOR) -Wl,--no-undefined - $(THREAD_LIB) : $(THREAD_OBJ) -+ $(LINK_CMD) -shared -Wl,-soname -Wl,libmuthreads.so.$(SOMAJOR) -Wl,--no-undefined -lpthread - $(PKCS7_LIB) : $(PKCS7_OBJ) -+ $(LINK_CMD) -shared -Wl,-soname -Wl,libmupkcs7.so.$(SOMAJOR) - --INSTALL_LIBS := $(MUPDF_LIB) $(THIRD_LIB) -+INSTALL_LIBS := $(MUPDF_LIB) $(THIRD_LIB) $(THREAD_LIB) $(PKCS7_LIB) - - # --- Tools and Apps --- - -@@ -444,6 +448,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 - -@@ -482,7 +494,13 @@ - install include/mupdf/pdf/*.h $(DESTDIR)$(incdir)/mupdf/pdf - - install -d $(DESTDIR)$(libdir) -- install $(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 $(INSTALL_APPS) $(DESTDIR)$(bindir) diff --git a/office/mupdf/slack-desc b/office/mupdf/slack-desc index c04023860d..8110a7fe4f 100644 --- a/office/mupdf/slack-desc +++ b/office/mupdf/slack-desc @@ -9,11 +9,11 @@ mupdf: mupdf (a lightweight PDF, CBZ, and XPS viewer and toolkit) mupdf: mupdf: The renderer in MuPDF is tailored for high quality anti-aliased -mupdf: graphics. MuPDF renders text with metrics and spacing accurate to +mupdf: graphics. MuPDF renders text with metrics and spacing accurate to mupdf: within fractions of a pixel for the highest fidelity in reproducing mupdf: the look of a printed page on screen. mupdf: mupdf: https://www.mupdf.com/ mupdf: -mupdf: This package was built @WITH@ JavaSscript support, and installs -mupdf: @LIBTYPE@ libraries. +mupdf: This package was built @WITHTESS@ tesseract support. +mupdf: |