~ruther/guix-local

4c895efb5ce11f3e154b69f321045fa96518f952 — Maxim Cournoyer 1 year, 4 months ago 1109bc6
Reapply "gnu: Add vv."

This reverts commit 3fa68819a2876c831d01d1cbd7895e9fd3157899.
1 files changed, 67 insertions(+), 0 deletions(-)

M gnu/packages/image-viewers.scm
M gnu/packages/image-viewers.scm => gnu/packages/image-viewers.scm +67 -0
@@ 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+)))