summaryrefslogtreecommitdiffstats
path: root/graphics/imv
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/imv')
-rw-r--r--graphics/imv/README30
-rw-r--r--graphics/imv/imv.SlackBuild142
-rw-r--r--graphics/imv/imv.info12
-rw-r--r--graphics/imv/slack-desc2
-rw-r--r--graphics/imv/squelch_libtiff_warnings.diff44
5 files changed, 93 insertions, 137 deletions
diff --git a/graphics/imv/README b/graphics/imv/README
index 30357235ef..a1d5c75fb0 100644
--- a/graphics/imv/README
+++ b/graphics/imv/README
@@ -3,32 +3,26 @@ 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
+* Native Wayland and X11 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]
+ * PNG
+ * JPEG
+ * Animated GIFs (requires FreeImage or libnsgif)
+ * SVG
+ * TIFF
+ * Various RAW formats (requires FreeImage)
+ * Photoshop PSD files (requires FreeImage)
+ * WEBP
+ * HEIF/AVIF (requires libheif)
* 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)
+- libheif (support for HEIF/AVIF)
+- libjxl (support for JXL aka JPEG XL)
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/imv.SlackBuild b/graphics/imv/imv.SlackBuild
index a453bf317f..51a2f1d939 100644
--- a/graphics/imv/imv.SlackBuild
+++ b/graphics/imv/imv.SlackBuild
@@ -1,15 +1,39 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for imv
-# Written by B. Watson (yalhcru@gmail.com)
+# Written by B. Watson (urchlay@slackware.uk)
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+# 20240318 bkw:
+# - update for v4.5.0.
+# - upstream now has tagged releases, no more commit hash filenames.
+# - libjxl is now supported, add to README and slack-desc.
+# - note: libnsgif < 1.0.0 is required for build. no problem we have
+# 0.2.1, but if libnsgif ever gets updated to 1.0.0, this will need
+# fixing.
+
+# 20230901 bkw:
+# - update for v4.4.0.
+# - new homepage and git repo, fugly tarball filename.
+
+# 20210909 bkw:
+# - update for v4.3.0.
+# - upstream switched to meson, can't build old versions with this script.
+# - meson autodetects all the optional libs properly, get rid of the
+# messy shell script code that used to do it.
+# - add new optional dep libheif.
+# - get rid of squelch_libtiff_warnings.diff (upstream fixed it).
+# - rework README.
+
+cd $(dirname $0) ; CWD=$(pwd)
+
PRGNAM=imv
-VERSION=${VERSION:-4.1.0}
+VERSION=${VERSION:-4.5.0}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@@ -19,7 +43,11 @@ if [ -z "$ARCH" ]; then
esac
fi
-CWD=$(pwd)
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
+ exit 0
+fi
+
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
@@ -43,74 +71,43 @@ 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
+rm -rf $PRGNAM-v$VERSION
+tar xvf $CWD/$PRGNAM-v$VERSION.tar.gz || tar xvf $CWD/v$VERSION.tar.gz
+cd $PRGNAM-v$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
+find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} + -o \
+ \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} +
-make install \
- DESTDIR=$PKG \
- PREFIX=/usr \
- CONFIGPREFIX=/etc/$PRGNAM \
- MANPREFIX=/usr/man \
- INSTALL_PROGRAM="install -s -m0755"
+# meson takes an option to say where to install the config file, but
+# it doesn't actually change where the binary looks for it.
+sed -i -e 's,/etc/imv_config,/etc/imv/imv_config,' \
+ -e '/\/usr\/local\/etc/d' \
+ src/imv.c doc/imv.1.txt
-gzip -9 $PKG/usr/man/man?/*.?
+mkdir build
+cd build
+ CFLAGS="$SLKCFLAGS" \
+ CXXFLAGS="$SLKCFLAGS" \
+ meson .. \
+ --buildtype=release \
+ --infodir=/usr/info \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --localstatedir=/var \
+ --mandir=/usr/man \
+ --prefix=/usr \
+ --sysconfdir=/etc/$PRGNAM \
+ -Dstrip=true
+ "${NINJA:=ninja}"
+ DESTDIR=$PKG $NINJA install
+cd ..
-( cd $PKG/etc/$PRGNAM; mv ${PRGNAM}_config ${PRGNAM}_config.new )
+gzip -9 $PKG/usr/man/man?/*.?
+mv $PKG/etc/$PRGNAM/${PRGNAM}_config $PKG/etc/$PRGNAM/${PRGNAM}_config.new
-# make install doesn't install the .desktop file. Also there's no icon
-# so we have to include one, below.
+# Slackware doesn't have an icon called multimedia-photo-viewer...
mkdir -p $PKG/usr/share/applications
-sed "s,multimedia-photo-viewer,$PRGNAM," files/$PRGNAM.desktop > \
- $PKG/usr/share/applications/$PRGNAM.desktop
+sed -i "s,multimedia-photo-viewer,$PRGNAM," \
+ $PKG/usr/share/applications/*.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
@@ -128,12 +125,21 @@ cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
+# update slack-desc to say which optional deps are included
+F=no; G=no; H=no; J=no
+ldd $PKG/usr/bin/$PRGNAM-x11 > lddtmp
+grep -q 'libfreeimage' lddtmp && F=yes
+grep -q 'libnsgif' lddtmp && G=yes
+grep -q 'libheif' lddtmp && H=yes
+grep -q 'libjxl' lddtmp && J=yes
+
sed -e "s,@F@,$F," \
-e "s,@G@,$G," \
- -e "s,@W@,$WS," \
+ -e "s,@H@,$H," \
+ -e "s,@J@,$J," \
$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}
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
diff --git a/graphics/imv/imv.info b/graphics/imv/imv.info
index 88d3b72278..1eb4aed8c8 100644
--- a/graphics/imv/imv.info
+++ b/graphics/imv/imv.info
@@ -1,10 +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"
+VERSION="4.5.0"
+HOMEPAGE="https://sr.ht/~exec64/imv/"
+DOWNLOAD="https://git.sr.ht/~exec64/imv/archive/v4.5.0.tar.gz"
+MD5SUM="854614e252c58588e0fbf4a9f75a6b0d"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
-REQUIRES="libxkbcommon"
+REQUIRES=""
MAINTAINER="B. Watson"
-EMAIL="yalhcru@gmail.com"
+EMAIL="urchlay@slackware.uk"
diff --git a/graphics/imv/slack-desc b/graphics/imv/slack-desc
index 286c5202c9..db04840f5a 100644
--- a/graphics/imv/slack-desc
+++ b/graphics/imv/slack-desc
@@ -13,7 +13,7 @@ imv: managers.
imv:
imv: Package built with support for:
imv:
-imv: FreeImage: @F@ libnsgif: @G@ wayland: @W@
+imv: FreeImage: @F@ libnsgif: @G@ libheif: @H@ libjxl: @J@
imv:
imv:
imv:
diff --git a/graphics/imv/squelch_libtiff_warnings.diff b/graphics/imv/squelch_libtiff_warnings.diff
deleted file mode 100644
index 9c66ba26f2..0000000000
--- a/graphics/imv/squelch_libtiff_warnings.diff
+++ /dev/null
@@ -1,44 +0,0 @@
-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;