summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormhsn <mail@mhsn.net>2025-12-30 11:39:45 +0000
committermhsn <mail@mhsn.net>2025-12-30 11:48:59 +0000
commit6a8076144b1f023c2721b9328487b5b7109032e1 (patch)
treea282994e9cc53bc0ee3237d98fb3b3a05b220a13
parent6cbc1b85dd53119cbc9ed05def77a8304d07632f (diff)
downloadadelie-6a8076144b1f023c2721b9328487b5b7109032e1.tar.gz
adelie-6a8076144b1f023c2721b9328487b5b7109032e1.zip
add ctpv ebuild
-rw-r--r--app-misc/ctpv/ctpv-9999.ebuild26
-rw-r--r--app-misc/ctpv/files/thumbnail-grid.diff17
-rw-r--r--app-misc/ctpv/metadata.xml7
3 files changed, 50 insertions, 0 deletions
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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>mail@mhsn.net</email>
+ </maintainer>
+</pkgmetadata>