From 6a8076144b1f023c2721b9328487b5b7109032e1 Mon Sep 17 00:00:00 2001 From: mhsn Date: Tue, 30 Dec 2025 11:39:45 +0000 Subject: add ctpv ebuild --- app-misc/ctpv/ctpv-9999.ebuild | 26 ++++++++++++++++++++++++++ app-misc/ctpv/files/thumbnail-grid.diff | 17 +++++++++++++++++ app-misc/ctpv/metadata.xml | 7 +++++++ 3 files changed, 50 insertions(+) create mode 100644 app-misc/ctpv/ctpv-9999.ebuild create mode 100644 app-misc/ctpv/files/thumbnail-grid.diff create mode 100644 app-misc/ctpv/metadata.xml (limited to 'app-misc') diff --git a/app-misc/ctpv/ctpv-9999.ebuild b/app-misc/ctpv/ctpv-9999.ebuild new file mode 100644 index 0000000..f20824f --- /dev/null +++ b/app-misc/ctpv/ctpv-9999.ebuild @@ -0,0 +1,26 @@ +EAPI=8 +inherit git-r3 + +DESCRIPTION="Image previews for lf file manager" +HOMEPAGE="https://github.com/NikitaIvanovV/ctpv" +EGIT_REPO_URI="https://github.com/NikitaIvanovV/ctpv" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="amd64" + +RDEPEND="media-gfx/imagemagick + app-misc/lf + dev-libs/openssl" + +PATCHES=( + "$FILESDIR"/thumbnail-grid.diff +) + +src_install() { + emake DESTDIR="${D}" PREFIX="${EPREFIX}"/usr install +} + +pkg_postinst() { + elog "Check homepage for optional programs to allow greater file preview support." +} diff --git a/app-misc/ctpv/files/thumbnail-grid.diff b/app-misc/ctpv/files/thumbnail-grid.diff new file mode 100644 index 0000000..8645b37 --- /dev/null +++ b/app-misc/ctpv/files/thumbnail-grid.diff @@ -0,0 +1,17 @@ +diff --git i/sh/prev/video.sh w/sh/prev/video.sh +index 3e85e4f..d3d9f74 100644 +--- i/sh/prev/video.sh ++++ w/sh/prev/video.sh +@@ -1,7 +1,11 @@ + # video: ffmpegthumbnailer + + video() { +- ffmpegthumbnailer -i "$f" -o "$cache_f" -s 0 -t 50% 2>/dev/null ++ _wh=$(ffprobe -v error -select_streams v -show_entries stream=width,height -of csv=p=0:s=x "$f") ++ _w=$(echo "${_wh%%x*}/4" | bc) ++ _h=$(echo "${_wh##*x}/4" | bc) ++ thumbnail-grid -r 4 -c 4 -q 100 -w $_w -h $_h "$f" "$cache_f" 2>/dev/null ++ magick "$cache_f" "JPG:$cache_f" + } + + convert_and_show_image video diff --git a/app-misc/ctpv/metadata.xml b/app-misc/ctpv/metadata.xml new file mode 100644 index 0000000..20ab0b4 --- /dev/null +++ b/app-misc/ctpv/metadata.xml @@ -0,0 +1,7 @@ + + + + + mail@mhsn.net + + -- cgit v1.2.3