aboutsummaryrefslogtreecommitdiff
path: root/office/mupdf/mupdf.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'office/mupdf/mupdf.SlackBuild')
-rw-r--r--office/mupdf/mupdf.SlackBuild34
1 files changed, 28 insertions, 6 deletions
diff --git a/office/mupdf/mupdf.SlackBuild b/office/mupdf/mupdf.SlackBuild
index 1deac8ab105a5..bccd04f5cbfb5 100644
--- a/office/mupdf/mupdf.SlackBuild
+++ b/office/mupdf/mupdf.SlackBuild
@@ -5,6 +5,10 @@
# 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.
+
+# 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.
@@ -13,7 +17,7 @@
PRGNAM=mupdf
VERSION=${VERSION:-1.13.0}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
@@ -54,7 +58,7 @@ 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.a would be useless for building anything else.
+# 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
@@ -80,9 +84,9 @@ 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 \
+ -exec chmod 755 {} \+ -o \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
- -exec chmod 644 {} \;
+ -exec chmod 644 {} \+
# ref https://bugs.ghostscript.com/show_bug.cgi?id=697175
sed -i '/#define *OPJ_STATIC/d' source/fitz/load-jpx.c
@@ -91,6 +95,18 @@ sed -i '/#define *OPJ_STATIC/d' source/fitz/load-jpx.c
# 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
+
make verbose=yes \
XCFLAGS="$SLKCFLAGS -DJBIG_NO_MEMENTO" \
HAVE_MUJS="$MUJS" \
@@ -128,6 +144,9 @@ ln -s $PRGNAM.1.gz $PKG/usr/man/man1/$PRGNAM-x11.1.gz
# 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
# .desktop taken from debian and modified:
# - make it validate.
@@ -153,9 +172,12 @@ sed -e "s,@LIB@,lib$LIBDIRSUFFIX,g" \
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.
+# slack-desc will conveniently say whether javascript is built in,
+# and whether libs are shared or static.
mkdir -p $PKG/install
-sed "s,@WITH@,$WITH," < $CWD/slack-desc > $PKG/install/slack-desc
+sed -e "s,@WITH@,$WITH," \
+ -e "s,@LIBTYPE@,$LIBTYPE," \
+ $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}