From fc27362f8d6e45149c4f8f725462f7d20c9efb2c Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Tue, 21 Jan 2025 02:21:05 +0100 Subject: [PATCH] gnu: Add vv. * gnu/packages/image-viewers.scm (vv): New variable. Change-Id: I0f0b4eb220993b5d10583793c9754aa089918248 --- gnu/packages/image-viewers.scm | 67 ++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/gnu/packages/image-viewers.scm b/gnu/packages/image-viewers.scm index cea11c3e47..8edfea8bba 100644 --- a/gnu/packages/image-viewers.scm +++ b/gnu/packages/image-viewers.scm @@ -66,13 +66,16 @@ #:use-module (gnu packages bash) #:use-module (gnu packages boost) #:use-module (gnu packages check) + #:use-module (gnu packages cmake) #:use-module (gnu packages compression) + #:use-module (gnu packages cpp) #:use-module (gnu packages curl) #:use-module (gnu packages documentation) #:use-module (gnu packages djvu) #:use-module (gnu packages fontutils) #:use-module (gnu packages freedesktop) #:use-module (gnu packages gawk) + #:use-module (gnu packages gcc) #:use-module (gnu packages gettext) #:use-module (gnu packages ghostscript) #:use-module (gnu packages gl) @@ -93,6 +96,7 @@ #:use-module (gnu packages perl-check) #:use-module (gnu packages photo) #:use-module (gnu packages pkg-config) + #:use-module (gnu packages profiling) #:use-module (gnu packages python) #:use-module (gnu packages python-check) #:use-module (gnu packages python-compression) @@ -101,6 +105,7 @@ #:use-module (gnu packages python-xyz) #:use-module (gnu packages qt) #:use-module (gnu packages suckless) + #:use-module (gnu packages stb) #:use-module (gnu packages terminals) #:use-module (gnu packages upnp) #:use-module (gnu packages version-control) @@ -1176,3 +1181,65 @@ Advanced users can share tags and files anonymously through custom servers that any user may run. Everything is free and privacy is the first concern.") (home-page "https://hydrusnetwork.github.io/hydrus/") (license license:wtfpl2))) + +(define-public vv + (package + (name "vv") + (version "3.1") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/wolfpld/vv.git") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0swx5pnv8f58p7721a02jnrvi0w84cbp6p484vvqd3yryrc1k05v")))) + (build-system cmake-build-system) + (arguments + (list #:tests? #f ; no tests. + #:cmake cmake-3.30 + #:configure-flags + #~ (list "-DMARCH_NATIVE=OFF" + "-DCMAKE_BUILD_TYPE=Release" + "-DCPM_USE_LOCAL_PACKAGES=ON" + "-DCPM_LOCAL_PACKAGES_ONLY=ON" + (string-append "-DCPM_stb_SOURCE=" + #$stb-image-resize2 + "/include") + (string-append "-DCPM_tracy_SOURCE=" + #$(package-source tracy-wayland)) + "-DCMAKE_CXX_STANDARD=20" + "-DCMAKE_CXX_STANDARD_REQUIRED=ON") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'patch-dependencies + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "src/image/vector/PdfImage.cpp" + (("\"libpoppler-glib.so\"") + (string-append "\"" + (assoc-ref inputs "poppler") + "/lib/libpoppler-glib.so" + "\""))))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + ;; The provided installer doesn't have: + ;; install(TARGETS vv DESTINATION bin) + ;; So nothing would have been installed. + (install-file "vv" + (string-append (assoc-ref outputs "out") + "/bin"))))))) + (native-inputs + (list pkg-config gcc-14)) + (inputs + (list cairo openexr libheif libjpeg-turbo libjxl-0.10 lcms libpng libraw + librsvg libsixel libtiff libwebp zlib + aklomp-base64 stb-image poppler)) + (synopsis "Image viewer for the terminal") + (description "This package provides a color-correct image viewer for the +terminal. Your terminal should support the Kitty Graphics protocol. If it +doesn't, it should support the Sixel protocol.") + (properties `((tunable? . #t))) + (home-page "https://wolf.nereid.pl/posts/image-viewer/") + ;; Author tried to make it BSD-3--but it uses a GPL library (poppler) + (license license:gpl2+)))