From 303e0f3ac8ede80e1e2fd1f3dddfdaea876f1d8f Mon Sep 17 00:00:00 2001 From: B. Watson Date: Fri, 22 Aug 2014 17:40:23 +0700 Subject: office/zathura: Updated for version 0.2.7. Signed-off-by: Willy Sudiarto Raharjo --- office/zathura/README | 12 ++++++++++-- office/zathura/dlopen_hack.diff | 19 +++++++++++++++++++ office/zathura/zathura.SlackBuild | 37 ++++++++++++++++++++++++++++++++++--- office/zathura/zathura.info | 10 +++++----- 4 files changed, 68 insertions(+), 10 deletions(-) create mode 100644 office/zathura/dlopen_hack.diff (limited to 'office') diff --git a/office/zathura/README b/office/zathura/README index b2adeee322..54666e6200 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 0000000000..6f4ef64c1f --- /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 + #include + #include + #include +@@ -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 e9692133ef..60fe4cfc83 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 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 b21adc1d1b..73154ba96c 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" -- cgit v1.2.3