From 1c5e1bac6b4f3aa7a54bbf27df9b7bdddd6dd093 Mon Sep 17 00:00:00 2001 From: B. Watson Date: Wed, 19 Feb 2020 17:54:40 +0700 Subject: office/mupdf-legacy: Added (a lightweight PDF, CBZ, and XPS viewer). Signed-off-by: Willy Sudiarto Raharjo --- office/mupdf-legacy/README | 19 ++++ office/mupdf-legacy/mupdf-legacy.SlackBuild | 141 ++++++++++++++++++++++++++++ office/mupdf-legacy/mupdf-legacy.info | 10 ++ office/mupdf-legacy/mupdf.pc | 11 +++ office/mupdf-legacy/slack-desc | 19 ++++ 5 files changed, 200 insertions(+) create mode 100644 office/mupdf-legacy/README create mode 100644 office/mupdf-legacy/mupdf-legacy.SlackBuild create mode 100644 office/mupdf-legacy/mupdf-legacy.info create mode 100644 office/mupdf-legacy/mupdf.pc create mode 100644 office/mupdf-legacy/slack-desc (limited to 'office') diff --git a/office/mupdf-legacy/README b/office/mupdf-legacy/README new file mode 100644 index 0000000000..316ee5ca37 --- /dev/null +++ b/office/mupdf-legacy/README @@ -0,0 +1,19 @@ +mupdf-legacy (older version of mupdf) + +mupdf is a lightweight PDF, CBZ, and XPS viewer and toolkit. mupdf-legacy +is an older version of mupdf that gets installed to /opt/mupdf-legacy, +for use with zathura-pdf-mupdf and fbpdf2. + +Notes: + +1. Since this gets installed to /opt, the binaries (mupdf-x11, etc) will + not be in your $PATH. This is by design: for standalone use, it's + better to install the regular mupdf package, which is the latest + version. + +2. JavaScript support and shared libraries are disabled. Again, you want + the regular mupdf package for these. + +3. Any build that links with this needs to be modified so it looks for + headers and libraries in /opt/mupdf-legacy. See zathura-pdf-mupdf for + an example. diff --git a/office/mupdf-legacy/mupdf-legacy.SlackBuild b/office/mupdf-legacy/mupdf-legacy.SlackBuild new file mode 100644 index 0000000000..a3ca9bd611 --- /dev/null +++ b/office/mupdf-legacy/mupdf-legacy.SlackBuild @@ -0,0 +1,141 @@ +#!/bin/sh + +# Slackware build script for mupdf-legacy + +# Originally written by Hubert Hesse (email removed). +# Heavily modified by B. Watson (yalhcru@gmail.com). + +# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. + +# 20200218 bkw: rename this build to -legacy, remove dynamic linking +# and JavaScript support, install to /opt. Also get rid +# of .desktop and icon. +# 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 +# 20180101 bkw: update for 1.12.0. +# 20170711 bkw: update for 1.11. +# 20170621 bkw: fix build with -current's newer openjpeg, BUILD=2. +# 20170122 bkw: update for 1.10a. + +PRGNAM=mupdf-legacy +VERSION=${VERSION:-1.13.0} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +SRCNAM=mupdf + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $SRCNAM-$VERSION-source +tar xvf $CWD/$SRCNAM-$VERSION-source.tar.gz +cd $SRCNAM-$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 fine for use with +# zathura-pdf-mupdf and fbpdf use. + +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 + +chown -R root:root . +find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \ + \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+ + +# ref https://bugs.ghostscript.com/show_bug.cgi?id=697175 +sed -i '/#define *OPJ_STATIC/d' source/fitz/load-jpx.c + +# 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 + +make verbose=yes \ + XCFLAGS="$SLKCFLAGS -DJBIG_NO_MEMENTO" \ + HAVE_MUJS="no" \ + build=release \ + prefix=/opt/$PRGNAM \ + libdir=/opt/$PRGNAM/lib$LIBDIRSUFFIX \ + mandir=/opt/$PRGNAM/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/opt/$PRGNAM/bin +done + +strip $PKG/opt/$PRGNAM/bin/* +gzip -9 $PKG/opt/$PRGNAM/man/man1/*.1 + +# Compatibility symlinks. Older versions, the binary is just "mupdf". +# Separate -curl binary exists in 1.5 but not 1.4. +ln -s $SRCNAM-x11 $PKG/opt/$PRGNAM/bin/$SRCNAM +ln -s $SRCNAM.1.gz $PKG/opt/$PRGNAM/man/man1/$SRCNAM-x11.1.gz +[ -e $PKG/opt/$PRGNAM/bin/$SRCNAM-x11-curl ] && \ + ln -s $SRCNAM.1.gz $PKG/opt/$PRGNAM/man/man1/$SRCNAM-x11-curl.1.gz + +# mujstest is useless if we don't have JS support. +rm -f $PKG/opt/$PRGNAM/bin/mujstest + +# Installed permissions are atrocious (everything 755). +find $PKG -type f | xargs chmod 644 +chmod 755 $PKG/opt/$PRGNAM/bin/* + +# .pc file taken from debian and parameterized. +PCLIBS="-l$SRCNAM -lfreetype -lharfbuzz -ljbig2dec -ljpeg -lcrypto -lopenjp2 -lz -lm" +PCLIBS="$PCLIBS -lmupdfthird" + +mkdir -p $PKG/opt/$PRGNAM/lib$LIBDIRSUFFIX/pkgconfig/ +sed -e "s,@LIB@,lib$LIBDIRSUFFIX,g" \ + -e "s,@VERSION@,$VERSION,g" \ + -e "s,@PCLIBS@,$PCLIBS,g" \ + $CWD/$SRCNAM.pc > $PKG/opt/$PRGNAM/lib$LIBDIRSUFFIX/pkgconfig/$SRCNAM.pc + +# 'make install' already installed most of the docs. +cp -a CONTRIBUTORS $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/office/mupdf-legacy/mupdf-legacy.info b/office/mupdf-legacy/mupdf-legacy.info new file mode 100644 index 0000000000..ec48712348 --- /dev/null +++ b/office/mupdf-legacy/mupdf-legacy.info @@ -0,0 +1,10 @@ +PRGNAM="mupdf-legacy" +VERSION="1.13.0" +HOMEPAGE="https://www.mupdf.com/" +DOWNLOAD="https://www.mupdf.com/downloads/archive/mupdf-1.13.0-source.tar.gz" +MD5SUM="447bc5c3305efe9645e12fce759e0198" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="jbig2dec" +MAINTAINER="B. Watson" +EMAIL="yalhcru@gmail.com" diff --git a/office/mupdf-legacy/mupdf.pc b/office/mupdf-legacy/mupdf.pc new file mode 100644 index 0000000000..62fa58267f --- /dev/null +++ b/office/mupdf-legacy/mupdf.pc @@ -0,0 +1,11 @@ +prefix=/opt/mupdf-legacy +exec_prefix=${prefix} +libdir=${exec_prefix}/@LIB@ +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-legacy/slack-desc b/office/mupdf-legacy/slack-desc new file mode 100644 index 0000000000..8cb115f27c --- /dev/null +++ b/office/mupdf-legacy/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +mupdf-legacy: mupdf-legacy (a lightweight PDF, CBZ, and XPS viewer and toolkit) +mupdf-legacy: +mupdf-legacy: This is an older version of mupdf. +mupdf-legacy: +mupdf-legacy: The renderer in MuPDF is tailored for high quality anti-aliased +mupdf-legacy: graphics. MuPDF renders text with metrics and spacing accurate to +mupdf-legacy: within fractions of a pixel for the highest fidelity in reproducing +mupdf-legacy: the look of a printed page on screen. +mupdf-legacy: +mupdf-legacy: https://www.mupdf.com/ +mupdf-legacy: -- cgit v1.2.3