summaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2020-11-27 23:35:47 +0000
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2020-11-29 01:02:55 +0700
commit1e651dc4b6fbfc5a48e8bd8c909db145c24444e0 (patch)
treeacb1b517e8927dde03689468e8970300340fa83c /graphics
parentd89094de010bbeae0646e3fb75f770a6b80e98e7 (diff)
downloadslackbuilds-1e651dc4b6fbfc5a48e8bd8c909db145c24444e0.tar.gz
graphics/imv: Added (image viewer for X and/or Wayland)
Signed-off-by: Dave Woodfall <dave@slackbuilds.org> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'graphics')
-rw-r--r--graphics/imv/README34
-rw-r--r--graphics/imv/doinst.sh25
-rw-r--r--graphics/imv/icons/16.pngbin0 -> 628 bytes
-rw-r--r--graphics/imv/icons/22.pngbin0 -> 896 bytes
-rw-r--r--graphics/imv/icons/24.pngbin0 -> 914 bytes
-rw-r--r--graphics/imv/icons/48.pngbin0 -> 1648 bytes
-rw-r--r--graphics/imv/icons/64.pngbin0 -> 2117 bytes
-rw-r--r--graphics/imv/icons/96.pngbin0 -> 2981 bytes
-rw-r--r--graphics/imv/imv.SlackBuild139
-rw-r--r--graphics/imv/imv.info10
-rw-r--r--graphics/imv/slack-desc19
-rw-r--r--graphics/imv/squelch_libtiff_warnings.diff44
12 files changed, 271 insertions, 0 deletions
diff --git a/graphics/imv/README b/graphics/imv/README
new file mode 100644
index 0000000000..30357235ef
--- /dev/null
+++ b/graphics/imv/README
@@ -0,0 +1,34 @@
+imv (image viewer for X and/or Wayland)
+
+imv is a command line image viewer intended for use with tiling window
+managers. Features:
+
+* Native Wayland [2] and X11 [1] support
+* Support for dozens of image formats including:
+ * PNG [1]
+ * JPEG [1]
+ * Animated GIFs [3]
+ * SVG [4]
+ * TIFF [1]
+ * Various RAW formats [5]
+ * Photoshop PSD files [5]
+* Configurable key bindings and behaviour
+* Highly scriptable with IPC via imv-msg
+
+Optional dependencies (autodetected):
+
+- wayland
+- FreeImage (support for GIF, RAW, PSD formats)
+- libnsgif (support for GIF)
+
+If you don't have at least one of FreeImage or libnsgif, imv won't
+support GIF images at all.
+
+Notes:
+
+[1] - uses a library from core Slackware, so always enabled.
+[2] - requires wayland.
+[3] - requires either FreeImage or libnsgif.
+[4] - imv supports SVG images, but the librsvg in Slackware 14.2 is too
+ old for imv to use, so SVG support is disabled. Sorry.
+[5] - requires FreeImage.
diff --git a/graphics/imv/doinst.sh b/graphics/imv/doinst.sh
new file mode 100644
index 0000000000..7a6eafcfff
--- /dev/null
+++ b/graphics/imv/doinst.sh
@@ -0,0 +1,25 @@
+config() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ if [ ! -r $OLD ]; then
+ mv $NEW $OLD
+ elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
+ rm $NEW
+ fi
+}
+
+config etc/imv/imv_config.new
+
+if [ -x /usr/bin/update-desktop-database ]; then
+ /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
+fi
+
+if [ -x /usr/bin/update-mime-database ]; then
+ /usr/bin/update-mime-database usr/share/mime >/dev/null 2>&1
+fi
+
+if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
+ if [ -x /usr/bin/gtk-update-icon-cache ]; then
+ /usr/bin/gtk-update-icon-cache usr/share/icons/hicolor >/dev/null 2>&1
+ fi
+fi
diff --git a/graphics/imv/icons/16.png b/graphics/imv/icons/16.png
new file mode 100644
index 0000000000..8da696a803
--- /dev/null
+++ b/graphics/imv/icons/16.png
Binary files differ
diff --git a/graphics/imv/icons/22.png b/graphics/imv/icons/22.png
new file mode 100644
index 0000000000..3a766591f7
--- /dev/null
+++ b/graphics/imv/icons/22.png
Binary files differ
diff --git a/graphics/imv/icons/24.png b/graphics/imv/icons/24.png
new file mode 100644
index 0000000000..69549b70a2
--- /dev/null
+++ b/graphics/imv/icons/24.png
Binary files differ
diff --git a/graphics/imv/icons/48.png b/graphics/imv/icons/48.png
new file mode 100644
index 0000000000..31bb9ee702
--- /dev/null
+++ b/graphics/imv/icons/48.png
Binary files differ
diff --git a/graphics/imv/icons/64.png b/graphics/imv/icons/64.png
new file mode 100644
index 0000000000..ed5c510e32
--- /dev/null
+++ b/graphics/imv/icons/64.png
Binary files differ
diff --git a/graphics/imv/icons/96.png b/graphics/imv/icons/96.png
new file mode 100644
index 0000000000..89c3510dd1
--- /dev/null
+++ b/graphics/imv/icons/96.png
Binary files differ
diff --git a/graphics/imv/imv.SlackBuild b/graphics/imv/imv.SlackBuild
new file mode 100644
index 0000000000..a453bf317f
--- /dev/null
+++ b/graphics/imv/imv.SlackBuild
@@ -0,0 +1,139 @@
+#!/bin/sh
+
+# Slackware build script for imv
+
+# Written by B. Watson (yalhcru@gmail.com)
+
+# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+
+PRGNAM=imv
+VERSION=${VERSION:-4.1.0}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+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 $PRGNAM-$VERSION
+tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
+cd $PRGNAM-$VERSION
+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 {} \+
+
+# libtiff complains "not a TIFF image" for every non-TIFF image imv
+# loads. patch disables libtiff warnings, and also moves libtiff to
+# the end of the backend list, so it'll get tried last (after all the
+# other backends have decided they can't handle the file).
+patch -p1 < $CWD/squelch_libtiff_warnings.diff
+
+# missing an include...
+sed -i '1i#include <string.h>' src/backend_freeimage.c
+
+# look in the right place for the config file.
+sed -i 's,/usr/local/etc/,/etc/imv/,' src/imv.c
+
+# No autodetection for optional deps. Help it out a little.
+# libpng, libtiff, libjpeg-turbo are always included.
+# librsvg never included, 14.2's is too old, and the minimum supported
+# version requires rust, meaning I don't love it enough to include a
+# static build here. I'm not just assuming it's too old because the
+# docs say so, I actually tried it. Sigh.
+W=x11; F=no; G=no; WS=no
+pkg-config --exists wayland-client && W=all && WS=yes
+[ -e /usr/include/FreeImage.h ] && F=yes
+pkg-config --exists libnsgif && G=yes
+
+cat >config.mk <<EOF
+# Core Slackware stuff:
+BACKEND_LIBTIFF=yes
+BACKEND_LIBPNG=yes
+BACKEND_LIBJPEG=yes
+
+# Core Slackware 14.2, but too old to use, sorry.
+BACKEND_LIBRSVG=no
+
+# Optional SBo packages (FreeImage, libnsgif):
+BACKEND_FREEIMAGE=$F
+BACKEND_LIBNSGIF=$G
+
+# Optional: window system (x11, wayland, or 'all' for both)
+WINDOWS=$W
+EOF
+
+make \
+ CFLAGS="$SLKCFLAGS" \
+ PREFIX=/usr \
+ CONFIGPREFIX=/etc/$PRGNAM
+
+make install \
+ DESTDIR=$PKG \
+ PREFIX=/usr \
+ CONFIGPREFIX=/etc/$PRGNAM \
+ MANPREFIX=/usr/man \
+ INSTALL_PROGRAM="install -s -m0755"
+
+gzip -9 $PKG/usr/man/man?/*.?
+
+( cd $PKG/etc/$PRGNAM; mv ${PRGNAM}_config ${PRGNAM}_config.new )
+
+# make install doesn't install the .desktop file. Also there's no icon
+# so we have to include one, below.
+mkdir -p $PKG/usr/share/applications
+sed "s,multimedia-photo-viewer,$PRGNAM," files/$PRGNAM.desktop > \
+ $PKG/usr/share/applications/$PRGNAM.desktop
+
+# Icon came from Debian moka-icon-theme package. I have no idea
+# what the default icon theme is in Debian (equivalent of hicolor in
+# Slackware). Don't care, either. So I picked one at random.
+for i in 16 22 24 48 64 96; do
+ mkdir -p $PKG/usr/share/icons/hicolor/${i}x${i}/apps
+ cat $CWD/icons/$i.png > $PKG/usr/share/icons/hicolor/${i}x${i}/apps/$PRGNAM.png
+done
+mkdir -p $PKG/usr/share/pixmaps
+ln -s ../icons/hicolor/48x48/apps/$PRGNAM.png $PKG/usr/share/pixmaps/$PRGNAM.png
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a AUTHORS* CHANGE* CONTRIB* LICENSE* README* $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
+mkdir -p $PKG/install
+
+sed -e "s,@F@,$F," \
+ -e "s,@G@,$G," \
+ -e "s,@W@,$WS," \
+ $CWD/slack-desc > $PKG/install/slack-desc
+
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
diff --git a/graphics/imv/imv.info b/graphics/imv/imv.info
new file mode 100644
index 0000000000..88d3b72278
--- /dev/null
+++ b/graphics/imv/imv.info
@@ -0,0 +1,10 @@
+PRGNAM="imv"
+VERSION="4.1.0"
+HOMEPAGE="https://github.com/eXeC64/imv"
+DOWNLOAD="https://github.com/eXeC64/imv/archive/v4.1.0/imv-4.1.0.tar.gz"
+MD5SUM="325bac66149dfa3f6e7688b1f4ab5f67"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES="libxkbcommon"
+MAINTAINER="B. Watson"
+EMAIL="yalhcru@gmail.com"
diff --git a/graphics/imv/slack-desc b/graphics/imv/slack-desc
new file mode 100644
index 0000000000..286c5202c9
--- /dev/null
+++ b/graphics/imv/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------------------------------------------------------|
+imv: imv (image viewer for X and/or Wayland)
+imv:
+imv: imv is a command line image viewer intended for use with tiling window
+imv: managers.
+imv:
+imv: Package built with support for:
+imv:
+imv: FreeImage: @F@ libnsgif: @G@ wayland: @W@
+imv:
+imv:
+imv:
diff --git a/graphics/imv/squelch_libtiff_warnings.diff b/graphics/imv/squelch_libtiff_warnings.diff
new file mode 100644
index 0000000000..9c66ba26f2
--- /dev/null
+++ b/graphics/imv/squelch_libtiff_warnings.diff
@@ -0,0 +1,44 @@
+diff -Naur imv-4.1.0/src/backend_libtiff.c imv-4.1.0.patched/src/backend_libtiff.c
+--- imv-4.1.0/src/backend_libtiff.c 2019-12-21 17:54:26.000000000 -0500
++++ imv-4.1.0.patched/src/backend_libtiff.c 2020-11-21 16:40:37.971589947 -0500
+@@ -110,6 +110,7 @@
+ {
+ struct private private;
+
++ TIFFSetErrorHandler(NULL);
+ private.tiff = TIFFOpen(path, "r");
+ if (!private.tiff) {
+ /* Header is read, so no BAD_PATH check here */
+@@ -129,6 +130,7 @@
+ static enum backend_result open_memory(void *data, size_t len, struct imv_source **src)
+ {
+ struct private *private = malloc(sizeof *private);
++ TIFFSetErrorHandler(NULL);
+ private->data = data;
+ private->len = len;
+ private->pos = 0;
+diff -Naur imv-4.1.0/src/main.c imv-4.1.0.patched/src/main.c
+--- imv-4.1.0/src/main.c 2019-12-21 17:54:26.000000000 -0500
++++ imv-4.1.0.patched/src/main.c 2020-11-21 16:40:46.483589173 -0500
+@@ -17,10 +17,6 @@
+ return 1;
+ }
+
+-#ifdef IMV_BACKEND_LIBTIFF
+- imv_install_backend(imv, &imv_backend_libtiff);
+-#endif
+-
+ #ifdef IMV_BACKEND_LIBPNG
+ imv_install_backend(imv, &imv_backend_libpng);
+ #endif
+@@ -41,6 +37,10 @@
+ imv_install_backend(imv, &imv_backend_freeimage);
+ #endif
+
++#ifdef IMV_BACKEND_LIBTIFF
++ imv_install_backend(imv, &imv_backend_libtiff);
++#endif
++
+ if (!imv_load_config(imv)) {
+ imv_free(imv);
+ return 1;