diff options
author | B. Watson <yalhcru@gmail.com> | 2014-08-22 17:40:23 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2014-08-22 17:40:23 +0700 |
commit | 303e0f3ac8ede80e1e2fd1f3dddfdaea876f1d8f (patch) | |
tree | 801ab39150dda42909f41b8d70451fa63701098d /office | |
parent | 21f9117729e7eaea0ec7b33b9271d20d390a155a (diff) |
office/zathura: Updated for version 0.2.7.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'office')
-rw-r--r-- | office/zathura/README | 12 | ||||
-rw-r--r-- | office/zathura/dlopen_hack.diff | 19 | ||||
-rw-r--r-- | office/zathura/zathura.SlackBuild | 37 | ||||
-rw-r--r-- | office/zathura/zathura.info | 10 |
4 files changed, 68 insertions, 10 deletions
diff --git a/office/zathura/README b/office/zathura/README index b2adeee3229e..54666e620044 100644 --- a/office/zathura/README +++ b/office/zathura/README @@ -3,5 +3,13 @@ poppler rendering library and the gtk+ toolkit. The idea behind zathura is an application that provides a minimalistic and space saving interface as well as an easy usage that mainly focuses on keyboard interaction. -This package includes the zathura core and the zathura-pdf-poppler plugin. -If you need PostScript support, see the zathura-ps package. +This build includes the zathura core and the zathura-pdf-poppler plugin. + +Other plugins exist to support other file types: + +zathura-pdf-mupdf - Alternate PDF renderer (faster, maybe more accurate) +zathura-ps - PostScript +zathura-cb - Comic book archives (cbz/cbr/cb7/cbt) +zathura-djvu - DjVu + +When upgrading diff --git a/office/zathura/dlopen_hack.diff b/office/zathura/dlopen_hack.diff new file mode 100644 index 000000000000..6f4ef64c1f37 --- /dev/null +++ b/office/zathura/dlopen_hack.diff @@ -0,0 +1,19 @@ +diff -Naur zathura-0.2.7/zathura.c zathura-0.2.7.patched/zathura.c +--- zathura-0.2.7/zathura.c 2014-02-17 11:16:57.000000000 -0500 ++++ zathura-0.2.7.patched/zathura.c 2014-08-22 02:39:14.000000000 -0400 +@@ -3,6 +3,7 @@ + #define _BSD_SOURCE + #define _XOPEN_SOURCE 700 + ++#include <dlfcn.h> + #include <errno.h> + #include <stdlib.h> + #include <unistd.h> +@@ -101,6 +102,7 @@ + } + + /* load plugins */ ++ dlopen("libjpeg.so", RTLD_NOW | RTLD_GLOBAL); /* dirty hack! */ + zathura_plugin_manager_load(zathura->plugins.manager); + + /* configuration */ diff --git a/office/zathura/zathura.SlackBuild b/office/zathura/zathura.SlackBuild index e9692133eff2..60fe4cfc83e2 100644 --- a/office/zathura/zathura.SlackBuild +++ b/office/zathura/zathura.SlackBuild @@ -37,7 +37,7 @@ # - fix homepage URL PRGNAM=zathura -VERSION=${VERSION:-0.2.3} +VERSION=${VERSION:-0.2.7} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} @@ -74,7 +74,8 @@ set -eu # plugins. This build includes the default PDF plugin, without which zathura # is completely useless. PLUGIN=$PRGNAM-pdf-poppler -PLUGINVER=${PLUGINVER:-$VERSION} +#PLUGINVER=${PLUGINVER:-$VERSION} +PLUGINVER=${PLUGINVER-0.2.5} rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT @@ -89,6 +90,34 @@ find -L . \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \; +# Work around a bug in Slackware's ghostscript. +# http://bugs.ghostscript.com/show_bug.cgi?id=692891 +# +# Supposedly this was fixed, but I'm getting stack traces that look just +# like those. The trouble is, if any of the plugins depends on libgs.so, +# that library gets loaded during zathura's "scan for plugins" phase. +# If libjpeg.so wasn't already loaded, it gets loaded and mangled by +# libgs. This happens *before* zathura knows which plugin matches the file +# we're trying to view. Now, the plugin is chosen based on the file's +# mime type. If said plugin *isn't* the one using libgs, but it *does* +# use libjpeg, *boom* segfault. +# +# What I found is that the postscript plugin uses libsceptre, which uses +# libgs... and the mupdf and comicbook plugins use libjpeg. The end result +# is that the mupdf and cb plugins crash the first time they try to load +# a jpeg from the pdf/cbr, *but* only if the ps plugin is installed! +# Both plugins work fine if the ps plugin is removed. +# +# I found that 'export LD_PRELOAD=/usr/lib/libjpeg.so' stops the +# segfaulting, while not affecting the ps plugin. The patch below is +# basically just the C equivalent: use dlopen() to load libjpeg.so before +# scanning for plugins. Yes, it's a hack, that depends on implementation +# specific details, but the alternative would be to try and talk Pat V +# into patching and rebuilding his ghostscript and/or libsceptre packages, +# which he won't be doing this late in the release cycle (I wouldn't either). + +patch -p1 < $CWD/dlopen_hack.diff + sed -i "s/-pedantic/$SLKCFLAGS/" config.mk make LIBDIR=/usr/lib$LIBDIRSUFFIX @@ -101,6 +130,7 @@ cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild # Now build the plugin. cd $TMP + # Hack, lets #include <zathura/document.h> in pdf.h work with an uninstalled # copy of zathura by saying "-I.." rm -f $PRGNAM @@ -116,13 +146,14 @@ find -L . \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \; -# ZATHURA_VERSION_CHECK=0 shouldn't be required :( +# ZATHURA_VERSION_CHECK=0 is required because zathura.pc isn't installed. sed -i "s/-fPIC/$SLKCFLAGS/" config.mk make install \ ZATHURA_INC=-I.. \ PLUGINDIR=/usr/lib$LIBDIRSUFFIX/$PRGNAM \ DESTDIR=$PKG \ + ZATHURA_GTK_VERSION=3 \ ZATHURA_VERSION_CHECK=0 strip $PKG/usr/lib$LIBDIRSUFFIX/$PRGNAM/*.so diff --git a/office/zathura/zathura.info b/office/zathura/zathura.info index b21adc1d1bde..73154ba96cb2 100644 --- a/office/zathura/zathura.info +++ b/office/zathura/zathura.info @@ -1,10 +1,10 @@ PRGNAM="zathura" -VERSION="0.2.3" +VERSION="0.2.7" HOMEPAGE="http://www.pwmt.org/projects/zathura" -DOWNLOAD="http://www.pwmt.org/projects/zathura/download/zathura-0.2.3.tar.gz \ - http://www.pwmt.org/projects/zathura/plugins/download/zathura-pdf-poppler-0.2.3.tar.gz" -MD5SUM="c0265fd9fa64a37b01d729efb75a7c32 \ - 1d8deb2d2ee5a6847267f977b8f2e542" +DOWNLOAD="http://www.pwmt.org/projects/zathura/download/zathura-0.2.7.tar.gz \ + http://www.pwmt.org/projects/zathura-pdf-poppler/download/zathura-pdf-poppler-0.2.5.tar.gz" +MD5SUM="53124af80e974283a6678319a62e6666 \ + e314b8b136e71aa4925a864141f12d15" DOWNLOAD_x86_64="" MD5SUM_x86_64="" REQUIRES="girara" |