t* My OpenBSD ports
       
   URI git clone git://git.codevoid.de/mystuff.git
   DIR Log
   DIR Files
   DIR Refs
       ---
   DIR commit 436b5314e81393d53883b44689a2aea0eb8fb921
   DIR parent 13db020dbcbc6197bb2928e359711fe4a60c0340
   URI Author: c0dev0id <sh+github[at]codevoid[dot]de>
       Date:   Sat, 28 Nov 2020 18:11:29 +0100
       
       adding custom sxiv
       
       Diffstat:
         A graphics/sxiv/Makefile              |      45 +++++++++++++++++++++++++++++++
         A graphics/sxiv/distinfo              |       2 ++
         A graphics/sxiv/patches/patch-config… |      29 +++++++++++++++++++++++++++++
         A graphics/sxiv/patches/patch-exec_k… |      14 ++++++++++++++
         A graphics/sxiv/patches/patch-sxiv_1  |      29 +++++++++++++++++++++++++++++
         A graphics/sxiv/pkg/DESCR             |       5 +++++
         A graphics/sxiv/pkg/PLIST             |      15 +++++++++++++++
       
       7 files changed, 139 insertions(+), 0 deletions(-)
       ---
   DIR diff --git a/graphics/sxiv/Makefile b/graphics/sxiv/Makefile
       t@@ -0,0 +1,45 @@
       +# $OpenBSD: Makefile,v 1.17 2020/02/12 22:04:32 kn Exp $
       +
       +COMMENT =        simple X Image Viewer
       +
       +GH_PROJECT =        sxiv
       +GH_ACCOUNT =        muennich
       +GH_TAGNAME =        v26
       +
       +EPOCH =                1
       +
       +CATEGORIES =        graphics x11
       +
       +MAINTAINER =        Klemens Nanni <kn@openbsd.org>
       +
       +# GPLv2+
       +PERMIT_PACKAGE =                Yes
       +
       +WANTLIB +=        Imlib2 X11 Xft c exif fontconfig gif lib/inotify/inotify
       +
       +RUN_DEPENDS =        devel/desktop-file-utils \
       +                x11/gtk+3,-guic
       +
       +LIB_DEPENDS =        devel/libinotify \
       +                graphics/imlib2 \
       +                graphics/libexif
       +
       +MAKE_FLAGS =        CC="${CC}" \
       +                V=1 \
       +                PREFIX=${PREFIX} \
       +                MANPREFIX=${PREFIX}/man \
       +                CFLAGS="${CFLAGS} -I${X11BASE}/include -I${X11BASE}/include/freetype2 -I${LOCALBASE}/include -I${LOCALBASE}/include/inotify" \
       +                LDFLAGS="-L${X11BASE}/lib -L${LOCALBASE}/lib -L${LOCALBASE}/lib/inotify -linotify -Wl,-rpath ${LOCALBASE}/lib/inotify"
       +
       +NO_TEST =        Yes
       +
       +# Git errors break version.h build; this makes it fall back to a hardcoded value
       +pre-build:
       +        ln -sf /usr/bin/true ${WRKDIR}/bin/git
       +
       +post-install:
       +        ${MAKE_PROGRAM} -C ${WRKSRC}/icon/ DESTDIR='' ${FAKE_TARGET}
       +        ${INSTALL_DATA_DIR} ${PREFIX}/share/applications
       +        ${INSTALL_DATA} ${WRKSRC}/sxiv.desktop ${PREFIX}/share/applications
       +
       +.include <bsd.port.mk>
   DIR diff --git a/graphics/sxiv/distinfo b/graphics/sxiv/distinfo
       t@@ -0,0 +1,2 @@
       +SHA256 (sxiv-26.tar.gz) = o4KtV3NCQ4GOgouhYfwDV7SNjzp/jCnKwYNJK0a1iUk=
       +SIZE (sxiv-26.tar.gz) = 48569
   DIR diff --git a/graphics/sxiv/patches/patch-config_def_h b/graphics/sxiv/patches/patch-config_def_h
       t@@ -0,0 +1,29 @@
       +$OpenBSD$
       +
       +Index: config.def.h
       +--- config.def.h.orig
       ++++ config.def.h
       +@@ -18,8 +18,8 @@ enum {
       +  * (first/last value is used as min/max zoom level)
       +  */
       + static const float zoom_levels[] = {
       +-         12.5,  25.0,  50.0,  75.0,
       +-        100.0, 150.0, 200.0, 400.0, 800.0
       ++        25.0, 50.0, 100.0, 150.0, 200.0,
       ++        400.0, 800.0, 1024.0, 1280.0
       + };
       + 
       + /* default slideshow delay (in sec, overwritten via -S option): */
       +@@ -48,10 +48,10 @@ static const bool ALPHA_LAYER = false;
       + #ifdef _THUMBS_CONFIG
       + 
       + /* thumbnail sizes in pixels (width == height): */
       +-static const int thumb_sizes[] = { 32, 64, 96, 128, 160 };
       ++static const int thumb_sizes[] = { 128, 160, 240, 360, 480, 640, 800 };
       + 
       + /* thumbnail size at startup, index into thumb_sizes[]: */
       +-static const int THUMB_SIZE = 3;
       ++static const int THUMB_SIZE = 4;
       + 
       + #endif
       + #ifdef _MAPPINGS_CONFIG
   DIR diff --git a/graphics/sxiv/patches/patch-exec_key-handler b/graphics/sxiv/patches/patch-exec_key-handler
       t@@ -0,0 +1,14 @@
       +$OpenBSD: patch-exec_key-handler,v 1.1 2019/10/03 10:29:32 kn Exp $
       +
       +Index: exec/key-handler
       +--- exec/key-handler.orig
       ++++ exec/key-handler
       +@@ -14,7 +14,7 @@
       + 
       + rotate() {
       +         degree="$1"
       +-        tr '\n' '\0' | xargs -0 realpath | sort | uniq | while read file; do
       ++        tr '\n' '\0' | xargs -0 readlink -f | sort | uniq | while read file; do
       +                 case "$(file -b -i "$file")" in
       +                 image/jpeg*) jpegtran -rotate "$degree" -copy all -outfile "$file" "$file" ;;
       +                 *)           mogrify  -rotate "$degree" "$file" ;;
   DIR diff --git a/graphics/sxiv/patches/patch-sxiv_1 b/graphics/sxiv/patches/patch-sxiv_1
       t@@ -0,0 +1,29 @@
       +$OpenBSD: patch-sxiv_1,v 1.4 2020/02/12 22:04:32 kn Exp $
       +
       +Substitute paths.
       +
       +Index: sxiv.1
       +--- sxiv.1.orig
       ++++ sxiv.1
       +@@ -397,7 +397,7 @@ and the arguments given to it are: 1) path to image fi
       + 3) image height.
       + .P
       + There is also an example script installed together with sxiv as
       +-.IR PREFIX/share/sxiv/exec/image-info .
       ++.IR ${PREFIX}/share/sxiv/exec/image-info .
       + .SH EXTERNAL KEY HANDLER
       + Additional external keyboard commands can be defined using a handler program
       + located in
       +@@ -412,10 +412,10 @@ have been modified and reloads them.
       + 
       + The key combo argument has the following form: "[C-][M-][S-]KEY",
       + where C/M/S indicate Ctrl/Meta(Alt)/Shift modifier states and KEY is the X
       +-keysym as listed in /usr/include/X11/keysymdef.h without the "XK_" prefix.
       ++keysym as listed in ${X11BASE}/include/X11/keysymdef.h without the "XK_" prefix.
       + 
       + There is also an example script installed together with sxiv as
       +-.IR PREFIX/share/sxiv/exec/key-handler .
       ++.IR {PREFIX}/share/sxiv/exec/key-handler .
       + .SH THUMBNAIL CACHING
       + sxiv stores all thumbnails under
       + .IR $XDG_CACHE_HOME/sxiv/ .
   DIR diff --git a/graphics/sxiv/pkg/DESCR b/graphics/sxiv/pkg/DESCR
       t@@ -0,0 +1,5 @@
       +The primary goal of sxiv is to create an image viewer which only has the most
       +basic features required for fast image viewing (the ones I want). It has vi key
       +bindings and works nicely with tiling window managers.  Its code base should be
       +kept small and clean to make it easy for you to dig into it and customize it for
       +your needs.
   DIR diff --git a/graphics/sxiv/pkg/PLIST b/graphics/sxiv/pkg/PLIST
       t@@ -0,0 +1,15 @@
       +@comment $OpenBSD: PLIST,v 1.7 2019/10/03 10:29:32 kn Exp $
       +@bin bin/sxiv
       +@man man/man1/sxiv.1
       +share/applications/sxiv.desktop
       +share/icons/hicolor/128x128/apps/sxiv.png
       +share/icons/hicolor/16x16/apps/sxiv.png
       +share/icons/hicolor/32x32/apps/sxiv.png
       +share/icons/hicolor/48x48/apps/sxiv.png
       +share/icons/hicolor/64x64/apps/sxiv.png
       +@tag update-desktop-database
       +@tag gtk-update-icon-cache %D/share/icons/hicolor
       +share/sxiv/
       +share/sxiv/exec/
       +share/sxiv/exec/image-info
       +share/sxiv/exec/key-handler