diff options
Diffstat (limited to 'graphics/viewnior')
-rw-r--r-- | graphics/viewnior/README | 2 | ||||
-rw-r--r-- | graphics/viewnior/doinst.sh | 8 | ||||
-rw-r--r-- | graphics/viewnior/exiv2-0.28.patch | 145 | ||||
-rw-r--r-- | graphics/viewnior/viewnior.SlackBuild | 70 | ||||
-rw-r--r-- | graphics/viewnior/viewnior.info | 12 |
5 files changed, 203 insertions, 34 deletions
diff --git a/graphics/viewnior/README b/graphics/viewnior/README index d333058e6b..93e5afc8e2 100644 --- a/graphics/viewnior/README +++ b/graphics/viewnior/README @@ -6,5 +6,5 @@ your images. Viewnior is inspired by big projects like Eye of Gnome, because of its usability and richness, and by GPicView, because of its lightweight design and minimal interface. -Viewnior is written in C (GTK+) and uses modified version of the +Viewnior is written in C (GTK+) and uses a modified version of the GtkImageView library by Bjourn Lindqvist. diff --git a/graphics/viewnior/doinst.sh b/graphics/viewnior/doinst.sh index 65c7e2eeb9..625ced33d1 100644 --- a/graphics/viewnior/doinst.sh +++ b/graphics/viewnior/doinst.sh @@ -1,9 +1,9 @@ -if [ -x /usr/bin/update-desktop-database ]; then - /usr/bin/update-desktop-database -q usr/share/applications >/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 -f usr/share/icons/hicolor >/dev/null 2>&1 fi fi + +if [ -x /usr/bin/update-desktop-database ]; then + /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1 +fi diff --git a/graphics/viewnior/exiv2-0.28.patch b/graphics/viewnior/exiv2-0.28.patch new file mode 100644 index 0000000000..73d5f44493 --- /dev/null +++ b/graphics/viewnior/exiv2-0.28.patch @@ -0,0 +1,145 @@ +From b6bb81a1b46e911d15bbf9a730972523de177705 Mon Sep 17 00:00:00 2001 +From: tastytea <tastytea@tastytea.de> +Date: Tue, 16 May 2023 10:54:40 +0200 +Subject: [PATCH 1/2] change exiv2 AutoPtr to unique_ptr + +exiv2-0.28.0 removed Exiv2::Image::AutoPtr and added +Exiv2::Image::UniquePtr instead. since it's a typedef for +std::unique_ptr<Image>, i'm using that directly instead of adding a +condition on the exiv2 version. +--- + src/uni-exiv2.cpp | 21 +++++++++++---------- + 1 file changed, 11 insertions(+), 10 deletions(-) + +diff --git a/src/uni-exiv2.cpp b/src/uni-exiv2.cpp +index 0d14b9f..77064c2 100644 +--- a/src/uni-exiv2.cpp ++++ b/src/uni-exiv2.cpp +@@ -22,12 +22,13 @@ + + #include <exiv2/exiv2.hpp> + #include <iostream> ++#include <memory> + + #include "uni-exiv2.hpp" + + #define ARRAY_SIZE(array) (sizeof array/sizeof(array[0])) + +-static Exiv2::Image::AutoPtr cached_image; ++static std::unique_ptr<Exiv2::Image> cached_image; + + extern "C" + void +@@ -35,8 +36,8 @@ uni_read_exiv2_map(const char *uri, void (*callback)(const char*, const char*, v + { + Exiv2::LogMsg::setLevel(Exiv2::LogMsg::mute); + try { +- Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(uri); +- if ( image.get() == 0 ) { ++ std::unique_ptr<Exiv2::Image> image = Exiv2::ImageFactory::open(uri); ++ if (image == nullptr) { + return; + } + +@@ -91,14 +92,14 @@ uni_read_exiv2_to_cache(const char *uri) + { + Exiv2::LogMsg::setLevel(Exiv2::LogMsg::mute); + +- if ( cached_image.get() != NULL ) { ++ if (cached_image != nullptr) { + cached_image->clearMetadata(); +- cached_image.reset(NULL); ++ cached_image.reset(nullptr); + } + + try { + cached_image = Exiv2::ImageFactory::open(uri); +- if ( cached_image.get() == 0 ) { ++ if (cached_image == nullptr) { + return 1; + } + +@@ -116,13 +117,13 @@ uni_write_exiv2_from_cache(const char *uri) + { + Exiv2::LogMsg::setLevel(Exiv2::LogMsg::mute); + +- if ( cached_image.get() == NULL ) { ++ if (cached_image == nullptr) { + return 1; + } + + try { +- Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(uri); +- if ( image.get() == 0 ) { ++ std::unique_ptr<Exiv2::Image> image = Exiv2::ImageFactory::open(uri); ++ if (image == nullptr) { + return 2; + } + +@@ -130,7 +131,7 @@ uni_write_exiv2_from_cache(const char *uri) + image->writeMetadata(); + + cached_image->clearMetadata(); +- cached_image.reset(NULL); ++ cached_image.reset(nullptr); + + return 0; + } catch (Exiv2::AnyError& e) { + +From 47d0b98cb46526aa8aa035bebcabc14a11fa57ee Mon Sep 17 00:00:00 2001 +From: tastytea <tastytea@tastytea.de> +Date: Tue, 16 May 2023 11:17:00 +0200 +Subject: [PATCH 2/2] add support for exiv-0.28.0 errors + +exiv2-0.28.0 changed Exiv2::AnyError to Exiv2::Error. +--- + src/uni-exiv2.cpp | 15 ++++++++++++--- + 1 file changed, 12 insertions(+), 3 deletions(-) + +diff --git a/src/uni-exiv2.cpp b/src/uni-exiv2.cpp +index 77064c2..567a50f 100644 +--- a/src/uni-exiv2.cpp ++++ b/src/uni-exiv2.cpp +@@ -28,6 +28,15 @@ + + #define ARRAY_SIZE(array) (sizeof array/sizeof(array[0])) + ++#define EXIV_ERROR Exiv2::AnyError ++#ifdef EXIV2_VERSION ++ #ifdef EXIV2_TEST_VERSION ++ #if EXIV2_TEST_VERSION(0,28,0) ++ #define EXIV_ERROR Exiv2::Error ++ #endif ++ #endif ++#endif ++ + static std::unique_ptr<Exiv2::Image> cached_image; + + extern "C" +@@ -81,7 +90,7 @@ uni_read_exiv2_map(const char *uri, void (*callback)(const char*, const char*, v + } + } + } +- } catch (Exiv2::AnyError& e) { ++ } catch (EXIV_ERROR& e) { + std::cerr << "Exiv2: '" << e << "'\n"; + } + } +@@ -104,7 +113,7 @@ uni_read_exiv2_to_cache(const char *uri) + } + + cached_image->readMetadata(); +- } catch (Exiv2::AnyError& e) { ++ } catch (EXIV_ERROR& e) { + std::cerr << "Exiv2: '" << e << "'\n"; + } + +@@ -134,7 +143,7 @@ uni_write_exiv2_from_cache(const char *uri) + cached_image.reset(nullptr); + + return 0; +- } catch (Exiv2::AnyError& e) { ++ } catch (EXIV_ERROR& e) { + std::cerr << "Exiv2: '" << e << "'\n"; + } + diff --git a/graphics/viewnior/viewnior.SlackBuild b/graphics/viewnior/viewnior.SlackBuild index 0fea2c8991..63a9fc8669 100644 --- a/graphics/viewnior/viewnior.SlackBuild +++ b/graphics/viewnior/viewnior.SlackBuild @@ -1,9 +1,10 @@ -#!/bin/sh +#!/bin/bash # # Slackware build script for viewnior. # -# Written by Šime Ramov <s@ramov.com> +# Written by Šime Ramov <email removed> # Copyright 2016-2018 Edinaldo P. Silva, Rio de Janeiro, Brazil. +# Copyright 2020-2023 B. Watson # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -23,10 +24,27 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# 20231030 bkw: add patch for -current. doesn't break 15.0. +# Not updating BUILD for this (it's still 1). + +# 20220610 bkw: update for v1.8. + +# 20200304 bkw: +# - take over maintenance +# - use proper github URL +# - fix typos (It's => Its), BUILD=2 +# - fix permissions (svg icon in package was +x) +# - tighten up script a bit + +cd $(dirname $0) ; CWD=$(pwd) + PRGNAM=viewnior -VERSION=${VERSION:-1.7} +VERSION=${VERSION:-1.8} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} + +SRCNAM=Viewnior-$PRGNAM if [ -z "$ARCH" ]; then case "$( uname -m )" in @@ -36,7 +54,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} @@ -60,16 +82,21 @@ set -e rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP -rm -rf $PRGNAM-$VERSION -tar xzvf $CWD/$PRGNAM-$VERSION.tar.gz || tar xzvf $CWD/Viewnior-$PRGNAM-$VERSION.tar.gz -mv Viewnior-$PRGNAM-$VERSION $PRGNAM-$VERSION -cd $PRGNAM-$VERSION +rm -rf $SRCNAM-$VERSION +tar xvf $CWD/$SRCNAM-$VERSION.tar.gz +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 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ - -exec chmod 644 {} \; +# 20200304 bkw: upstream perms suck, do not revert to template: +find -L . -type d -a -exec chmod 755 {} + -o \ + -type f -a -exec chmod 644 {} + + +# 20231030 bkw: this patch comes from arch (their extra/, not AUR). +# only apply it if needed: slackware 15.0 has exiv2-0.27.5 and doesn't +# need it. +pkg-config exiv2 --atleast-version=0.28 && \ + patch -p1 < $CWD/exiv2-0.28.patch + +sed -i "s,It's,Its," man/$PRGNAM.1 CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ @@ -80,17 +107,14 @@ meson \ --mandir=/usr/man \ build -ninja -C build -DESTDIR=$PKG ninja -C build install - -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 +NINJA=${NINJA:-ninja} +$NINJA -C build +DESTDIR=$PKG $NINJA -C build install +strip $PKG/usr/bin/$PRGNAM +gzip -9 $PKG/usr/man/man1/$PRGNAM.1 mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION -cp AUTHORS COPYING NEWS README.md TODO $PKG/usr/doc/$PRGNAM-$VERSION +cp -a AUTHORS COPYING NEWS README.md TODO $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild mkdir -p $PKG/install @@ -98,4 +122,4 @@ cat $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/viewnior/viewnior.info b/graphics/viewnior/viewnior.info index 986a6fa577..824679aae5 100644 --- a/graphics/viewnior/viewnior.info +++ b/graphics/viewnior/viewnior.info @@ -1,10 +1,10 @@ PRGNAM="viewnior" -VERSION="1.7" +VERSION="1.8" HOMEPAGE="https://github.com/hellosiyan/Viewnior" -DOWNLOAD="https://github.com/hellosiyan/Viewnior/archive/viewnior-1.7.tar.gz" -MD5SUM="b09587081077b50f9cc51bb4b0223ffe" +DOWNLOAD="https://github.com/hellosiyan/Viewnior/archive/viewnior-1.8/Viewnior-viewnior-1.8.tar.gz" +MD5SUM="29d773910df2d120c193ff2e2bc971f3" DOWNLOAD_x86_64="" MD5SUM_x86_64="" -REQUIRES="meson" -MAINTAINER="Edinaldo P. Silva" -EMAIL="edps.mundognu@gmail.com" +REQUIRES="" +MAINTAINER="B. Watson" +EMAIL="urchlay@slackware.uk" |