office/evince-gtk2: New maintainer, fix comic book support.

Signed-off-by: B. Watson <urchlay@slackware.uk>

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
B. Watson 2024-08-19 23:48:15 -04:00 committed by Willy Sudiarto Raharjo
parent 8e7cbadb97
commit 1ae74a6dcc
No known key found for this signature in database
GPG key ID: 3F617144D7238786
5 changed files with 121 additions and 70 deletions

View file

@ -1,16 +1,29 @@
This is the last GTK2 version of evince. It will conflict with the
latest one, so don't install both.
evince-gtk2 (a simple gnome-based document viewer)
Evince is a document viewer for multiple document formats. It currently
supports pdf, postscript, djvu, tiff and dvi. The goal of evince is to
replace the multiple document viewers that exist on the GNOME Desktop
with a single simple application.
This is the last GTK2 version of evince. It will conflict with the
latest one (the 'evince' build), so don't install both.
Evince is a document viewer for multiple document formats. It
currently supports PDF, PostScript, DjVu, TIFF, comic book archives,
and DVI. The goal of evince is to replace the multiple document
viewers that exist on the GNOME Desktop with a single simple
application.
Evince is specifically designed to support the following file formats:
* PDF
* Postscript
* DjVu
* TIFF
* CBR/CBZ (comic books)
* DVI (requires optional dependency texlive)
* XPS (requires optional dependency libgxps)
* CBZ/CBR/CB7/CBT (comic books)
* DVI
Optional runtime dependencies:
- unrar or unrar-free. Required for CBR support.
- p7zip. Required for CB7 support.
By default, the package is built with NLS (Native Language Support)
disabled, so the user interface will only support English. This
doesn't have anything to do with the language a PDF/DjVu/etc file is
written in, only the text in the application itself (e.g. "File",
"Edit", "Previous", "Next"). If you require NLS support, run this
script with NLS=yes exported in the environemnt.

View file

@ -0,0 +1,44 @@
diff -Naur evince-2.32.0/backend/comics/comics-document.c evince-2.32.0.patched/backend/comics/comics-document.c
--- evince-2.32.0/backend/comics/comics-document.c 2010-09-27 12:54:34.000000000 -0400
+++ evince-2.32.0.patched/backend/comics/comics-document.c 2024-08-19 23:35:22.539062511 -0400
@@ -320,7 +320,8 @@
* included in shared-mime-info */
if (!strcmp (mime_type, "application/x-cbr") ||
- !strcmp (mime_type, "application/x-rar")) {
+ !strcmp (mime_type, "application/x-rar") ||
+ !strcmp (mime_type, "application/vnd.rar")) {
/* The RARLAB provides a no-charge proprietary (freeware)
* decompress-only client for Linux called unrar. Another
* option is a GPLv2-licensed command-line tool developed by
@@ -405,7 +406,8 @@
return TRUE;
}
} else if (!strcmp (mime_type, "application/x-cbt") ||
- !strcmp (mime_type, "application/x-tar")) {
+ !strcmp (mime_type, "application/x-tar") ||
+ !strcmp (mime_type, "application/gzip")) {
/* tar utility (Tape ARchive) */
comics_document->selected_command =
g_find_program_in_path ("tar");
diff -Naur evince-2.32.0/backend/comics/comicsdocument.evince-backend.in evince-2.32.0.patched/backend/comics/comicsdocument.evince-backend.in
--- evince-2.32.0/backend/comics/comicsdocument.evince-backend.in 2010-07-14 03:54:39.000000000 -0400
+++ evince-2.32.0.patched/backend/comics/comicsdocument.evince-backend.in 2024-08-19 23:33:18.180074214 -0400
@@ -1,4 +1,4 @@
[Evince Backend]
Module=comicsdocument
_TypeDescription=Comic Books
-MimeType=application/x-cbr;application/x-cbz;application/x-cb7;application/x-cbt;
+MimeType=application/x-cbr;application/x-cbz;application/x-cb7;application/x-cbt;application/zip;application/vnd.rar;application/x-7z-compressed;application/x-tar;application/gzip;
diff -Naur evince-2.32.0/configure evince-2.32.0.patched/configure
--- evince-2.32.0/configure 2010-09-27 15:02:20.000000000 -0400
+++ evince-2.32.0.patched/configure 2024-08-19 23:33:23.710073694 -0400
@@ -21439,7 +21439,7 @@
EVINCE_MIME_TYPES="${EVINCE_MIME_TYPES}image/tiff;"
fi
if test "x$enable_comics" = "xyes"; then
- EVINCE_MIME_TYPES="${EVINCE_MIME_TYPES}application/x-cbr;application/x-cbz;application/x-cb7;application/x-cbt;"
+ EVINCE_MIME_TYPES="${EVINCE_MIME_TYPES}application/x-cbr;application/x-cbz;application/x-cb7;application/x-cbt;application/zip;application/vnd.rar;application/x-7z-compressed;application/x-tar;application/gzip;"
fi
if test "x$enable_pixbuf" = "xyes"; then
EVINCE_MIME_TYPES="${EVINCE_MIME_TYPES}image/*;"

View file

@ -2,34 +2,26 @@
# Slackware build script for evince-gtk2
# Copyright 2023 Petar Petrov slackalaxy@gmail.com
# Copyright 2009 Andrew Brouwers <abrouwers@gmail.com>
# Copyright 2009, Michiel van Wessem, Manchester, United Kingdom.
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Originally written by Petar Petrov.
# Modified and now maintained by B. Watson <urchlay@slackware.uk>
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
# 20240819 bkw, BUILD=2:
# - new maintainer.
# - relicense as WTFPL.
# - disable NLS by default, mention NLS=yes in the README.
# - enable DVI backend, since Slackware 15.0 has texlive.
# - remove mention of XPS from README, since this older version
# of evince doesn't actually support it.
# - make comic book support (CBZ/CBR/CB7/CBT) actually *work*.
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=evince-gtk2
SRCNAM=evince
VERSION=${VERSION:-2.32.0}
BUILD=${BUILD:-1}
BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@ -41,7 +33,7 @@ if [ -z "$ARCH" ]; then
esac
fi
NLS=${NLS:-YES}
NLS=${NLS:-no}
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
@ -75,19 +67,27 @@ rm -rf $SRCNAM-$VERSION
tar xvf $CWD/$SRCNAM-$VERSION.tar.bz2
cd $SRCNAM-$VERSION
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 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} + -o \
\! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} +
if [ "$NLS" != "YES" ]; then
# disable NLS - we're going for a small package here.
rm po/*.po
sed -i -e 's/USE_NLS=yes/USE_NLS=no/g' \
-e 's/ENABLE_NLS 1/ENABLE_NLS 0/g' configure
NLSOPT="--disable-nls"
if [ "$NLS" != "yes" ]; then
# disable NLS - we're going for a small package here.
# 20240819 bkw: --disable-nls by itself *should* be enough, but this
# stuff really is necessary.
rm po/*.po
sed -i -e 's/USE_NLS=yes/USE_NLS=no/g' \
-e 's/ENABLE_NLS 1/ENABLE_NLS 0/g' \
configure
NLSOPT="--enable-nls"
fi
# 20240819 bkw: add the correct MIME types for CBZ/CBR/CB7/CBT to actually
# work. This patch might not be needed when Slackware 15.1/16.0 comes out,
# if shared-mime-info and friends detect e.g. a .cbr file as application/x-cbr
# instead of application/vnd.rar as 15.0's does.
patch -p1 < $CWD/comicbookfix.diff
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
@ -108,17 +108,18 @@ CXXFLAGS="$SLKCFLAGS" \
--enable-pixbuf \
--enable-comics \
--enable-impress \
--disable-dvi \
--disable-static \
--disable-schemas-install \
--disable-scrollkeeper \
--disable-nautilus \
--disable-introspection \
--disable-maintainer-mode \
$NLSOPT \
--build=$ARCH-slackware-linux
make LDFLAGS=-lICE
make install DESTDIR=$PKG
make install-strip DESTDIR=$PKG
gzip -9 $PKG/usr/man/man*/*
rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la
@ -127,19 +128,12 @@ sed -i "/NoDisplay=true/d" $PKG/usr/share/applications/evince.desktop
# Remove these
rm -rf $PKG/*.schemas
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
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
rm -rf $PKG/{usr/share/gtk-doc,etc}
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a \
AUTHORS COPYING NEWS README \
$PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
mkdir -p $PKGDOC
cp -a AUTHORS COPYING NEWS README $PKGDOC
cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc

View file

@ -6,5 +6,5 @@ MD5SUM="ebc3ce6df8dcbf29cb9492f8dd031319"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES="gnome-icon-theme"
MAINTAINER="Petar Petrov"
EMAIL="slackalaxy@gmail.com"
MAINTAINER="B. Watson"
EMAIL="urchlay@slackware.uk"

View file

@ -1,19 +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 ':'.
# 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------------------------------------------------------|
evince-gtk2: evince-gtk2 (a simple gnome-based document viewer)
evince-gtk2:
evince-gtk2: Evince is a document viewer for multiple document formats.
evince-gtk2: It currently supports pdf, postscript, djvu, tiff, and dvi.
evince-gtk2:
evince-gtk2: The goal of evince is to replace the multiple document viewers
evince-gtk2: that exist on the GNOME Desktop with a single simple application.
evince-gtk2:
evince-gtk2: homepage: http://projects.gnome.org/evince/
evince-gtk2: Evince is a document viewer for multiple document formats. It
evince-gtk2: currently supports PDF, PostScript, DjVu, TIFF, comic book archives,
evince-gtk2: and DVI. The goal of evince is to replace the multiple document
evince-gtk2: viewers that exist on the GNOME Desktop with a single simple
evince-gtk2: application.
evince-gtk2:
evince-gtk2:
evince-gtk2:
evince-gtk2: