gnu: emacs-prop-menu: Use git-reference.
[jackhill/guix/guix.git] / gnu / packages / image-viewers.scm
index fce2b02..d05078c 100644 (file)
@@ -1,14 +1,17 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2013, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2014 Ian Denhardt <ian@zenhack.net>
 ;;; Copyright © 2015, 2016 Alex Kost <alezost@gmail.com>
 ;;; Copyright © 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2017 Alex Griffin <a@ajgrf.com>
-;;; Copyright © 2017 Nils Gillmann <ng0@n0.is>
+;;; Copyright © 2017 ng0 <ng0@n0.is>
 ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;; Copyright © 2017 nee <nee-git@hidamari.blue>
-;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
-;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2019 Nicolas Goaziou <mail@nicolasgoaziou.fr>
+;;; Copyright © 2019 Guy Fleury Iteriteka <hoonandon@gmail.com>
+;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -28,6 +31,7 @@
 (define-module (gnu packages image-viewers)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix packages)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system cmake)
@@ -53,6 +57,7 @@
   #:use-module (gnu packages photo)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages qt)
   #:use-module (gnu packages xorg)
   #:use-module (gnu packages))
@@ -60,7 +65,7 @@
 (define-public feh
   (package
     (name "feh")
-    (version "3.1")
+    (version "3.3")
     (home-page "https://feh.finalrewind.org/")
     (source (origin
               (method url-fetch)
@@ -68,7 +73,7 @@
                                   name "-" version ".tar.bz2"))
               (sha256
                (base32
-                "01rrl009m1kxwvqqr98y4wk8m1al18fkxwv8cds2k7n4qiv6xdb7"))))
+                "04c8cgwzkax481sz7lbzy23mk79bqmjy3qpvr7vxa4c14mc9k5gk"))))
     (build-system gnu-build-system)
     (arguments
      '(#:phases (modify-phases %standard-phases (delete 'configure))
@@ -106,62 +111,78 @@ actions.")
               "See 'COPYING' in the distribution."))))
 
 (define-public geeqie
-  (package
-    (name "geeqie")
-    (version "1.4")
-    (source (origin
-             (method url-fetch)
-             (uri (string-append "https://github.com/BestImageViewer/geeqie/"
-                                 "releases/download/v" version "/geeqie-"
-                                 version ".tar.xz"))
-             (sha256
-              (base32
-               "0ciygvcxb78pqg59r6p061mkbpvkgv2rv3r79j3kgv3kalb3ln2w"))))
-    (build-system gnu-build-system)
-    (arguments
-     `(;; Enable support for a "map" pane using GPS data.
-       #:configure-flags '("--enable-map")
+  ;; The latest release, 1.4, fails to build with Exiv2 0.27.1.  The upstream
+  ;; repo has several fixes for that, so take a snapshot.
+  (let ((commit "c220ddefb1b6b11b54f7598f0d44dd0723325ed4")
+        (revision "1"))
+    (package
+      (name "geeqie")
+      (version (git-version "1.4" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/BestImageViewer/geeqie")
+                      (commit commit)))
+                (sha256
+                 (base32
+                  "07424nzrnwbksgalgg1a6ig2snd986w79kca1cfnv1q9kc7x2h3x"))
+                (file-name (git-file-name name version))))
+      (build-system gnu-build-system)
+      (arguments
+       `( ;; Enable support for a "map" pane using GPS data.
+         #:configure-flags '("--enable-map")
 
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'autogen
-           (lambda _
-             (define (write-dummy-changelog port)
-               (display "See Git history for a change log.\n" port))
+         ;; Parallel builds fail with something like:
+         ;;   image-load.c:143:9: error: ‘gq_marshal_VOID__INT_INT_INT_INT’ undeclared
+         ;; due to unexpressed makefile dependencies.
+         #:parallel-build? #f
 
-             (setenv "NOCONFIGURE" "true")
+         #:phases
+         (modify-phases %standard-phases
+           (add-before 'bootstrap 'pre-bootstrap
+             (lambda _
+               (define (write-dummy-changelog port)
+                 (display "See Git history for a change log.\n" port))
+               ;; Create ChangeLog{,.html} to placate the makefile, which would
+               ;; otherwise require access to the Git repo.
+               (call-with-output-file "ChangeLog"
+                 write-dummy-changelog)
+               (call-with-output-file "ChangeLog.html"
+                 write-dummy-changelog)
+               (setenv "NOCONFIGURE" "true")
 
-             ;; Create ChangeLog{,.html} to placate the makefile, which would
-             ;; otherwise require access to the Git repo.
-             (call-with-output-file "ChangeLog"
-               write-dummy-changelog)
-             (call-with-output-file "ChangeLog.html"
-               write-dummy-changelog)
+               ;; Don't try to run 'git' for the version number.
+               (substitute* "configure.ac"
+                 (("m4_esyscmd_s\\([^)]+\\)")
+                  (string-append "[" ,version "]")))
 
-             (zero? (system* "sh" "autogen.sh")))))))
-    (inputs
-     `(("clutter" ,clutter)
-       ("libchamplain" ,libchamplain)
-       ("lcms" ,lcms)
-       ("exiv2" ,exiv2)
-       ("libpng" ,libpng)
-       ("gtk+" ,gtk+-2)))
-    (native-inputs
-     `(("autoconf" ,autoconf)
-       ("automake" ,automake)
-       ("glib" ,glib "bin") ; glib-gettextize
-       ("intltool" ,intltool)
-       ("pkg-config" ,pkg-config)))
-    (home-page "http://www.geeqie.org/")
-    (synopsis "Lightweight GTK+ based image viewer")
-    (description
-     "Geeqie is a lightweight GTK+ based image viewer for Unix like operating
+               ;; Remove references to non-existent files.
+               (substitute* "po/POTFILES.in"
+                 (("^plugins/import/.*") ""))
+               #t)))))
+      (inputs
+       `(("clutter" ,clutter)
+         ("libchamplain" ,libchamplain)
+         ("lcms" ,lcms)
+         ("exiv2" ,exiv2)
+         ("libpng" ,libpng)
+         ("gtk+" ,gtk+)))
+      (native-inputs
+       `(("autoconf" ,autoconf)
+         ("automake" ,automake)
+         ("glib" ,glib "bin")                     ; glib-gettextize
+         ("intltool" ,intltool)
+         ("pkg-config" ,pkg-config)))
+      (home-page "http://www.geeqie.org/")
+      (synopsis "Lightweight GTK+ based image viewer")
+      (description
+       "Geeqie is a lightweight GTK+ based image viewer for Unix like operating
 systems.  It features: EXIF, IPTC and XMP metadata browsing and editing
 interoperability; easy integration with other software; geeqie works on files
 and directories, there is no need to import images; fast preview for many raw
 image formats; tools for image comparison, sorting and managing photo
 collection.  Geeqie was initially based on GQview.")
-    (license license:gpl2+)))
+      (license license:gpl2+))))
 
 (define-public gpicview
   (package
@@ -189,16 +210,16 @@ It is the default image viewer on LXDE desktop environment.")
 (define-public sxiv
   (package
     (name "sxiv")
-    (version "24")
+    (version "25")
     (source (origin
-              (method url-fetch)
-              (uri (string-append
-                    "https://github.com/muennich/sxiv/archive/v"
-                    version ".tar.gz"))
-              (file-name (string-append name "-" version ".tar.gz"))
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/muennich/sxiv.git")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
               (sha256
                (base32
-                "044i077li6m4zsz2fswlcdi2m0sbr9mwws1h3k1zjaln29fw87ai"))))
+                "13s1lfar142hq1j7xld0ri616p4bqs57b17yr4d0b9a9w7liz4hp"))))
     (build-system gnu-build-system)
     (arguments
      `(#:tests? #f                      ; no check target
@@ -207,7 +228,7 @@ It is the default image viewer on LXDE desktop environment.")
              "CC=gcc"
              ;; Xft.h #includes <ft2build.h> (without ‘freetype2/’).  The sxiv
              ;; Makefile works around this by hard-coding /usr/include instead.
-             (string-append "DEF_CPPFLAGS=-I"
+             (string-append "CPPFLAGS=-I"
                             (assoc-ref %build-inputs "freetype")
                             "/include/freetype2")
              "V=1")
@@ -237,12 +258,14 @@ it and customize it for your needs.")
     (version "1.7")
     (source
       (origin
-        (method url-fetch)
-        (uri (string-append "https://github.com/hellosiyan/Viewnior/archive/"
-                            name "-" version ".tar.gz"))
+        (method git-fetch)
+        (uri (git-reference
+               (url "https://github.com/hellosiyan/Viewnior.git")
+               (commit (string-append name "-" version))))
+        (file-name (git-file-name name version))
         (sha256
          (base32
-          "1rpkk721s3xas125q3g0fl11b5zsrmzv9pzl6ddzcy4sj2rd7ymr"))))
+          "0y4hk3vq8psba5k615w18qj0kbdfp5w0lm98nv5apy6hmcpwfyig"))))
     (build-system meson-build-system)
     (arguments
      '(#:phases
@@ -284,52 +307,39 @@ your images.  Among its features are:
 (define-public catimg
   (package
     (name "catimg")
-    (version "2.4.0")
+    (version "2.5.0")
     (source
      (origin
-       (method url-fetch)
-       (uri (string-append "https://github.com/posva/catimg/archive"
-                           "/v" version ".tar.gz"))
-       (file-name (string-append name "-" version ".tar.gz"))
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/posva/catimg.git")
+             (commit version)))
+       (file-name (git-file-name name version))
        (sha256
-        (base32
-         "1rwgbq2imd5l4nql5hrz7rr5f4gz8aad1amlf0j3cxir8slpbd1y"))))
+        (base32 "0n74iczzgxrcq3zpa7ndycb9rinm829yvf81c747q4ngv5q6pzcm"))))
     (build-system cmake-build-system)
     (arguments
      `(#:tests? #f                      ; no tests
        #:phases
        (modify-phases %standard-phases
-         (replace 'configure
-           (lambda* (#:key inputs #:allow-other-keys)
-             (let* ((magic (assoc-ref %build-inputs "imagemagick"))
-                    (convert (string-append magic "/bin/convert")))
-               (substitute* "catimg"
-                 ;; By replacing "convert", we also replace the "convert"
-                 ;; in the message 'The version of convert is too old, don't
-                 ;; expect good results :('.  This should not happen, but in
-                 ;; practice this error message should not affect us.
-                 (("convert") convert))
-               #t)))
-         (replace 'build
+         (add-after 'unpack 'patch-convert
            (lambda _
-             (let* ((out (assoc-ref %outputs "out"))
-                    (man (string-append out "/share/man/man1")))
-               (zero? (system* "cmake"
-                               (string-append "-DCMAKE_INSTALL_PREFIX=" out)
-                               (string-append "-DMAN_OUTPUT_PATH=" man)
-                               "."))
-               (zero? (system* "make")))))
-         (add-before 'install 'install-script
+             (substitute* "catimg"
+               ;; By replacing "convert", we also replace the "convert"
+               ;; in the message 'The version of convert is too old, don't
+               ;; expect good results :('.  This should not happen, but in
+               ;; practice this error message should not affect us.
+               (("convert") (which "convert")))
+             #t))
+         (add-after 'install 'install-script
            (lambda* (#:key outputs #:allow-other-keys)
              ;; The bash script lacks an file extension.  We have to rename
              ;; it so that the C program and the bash script can be happy
              ;; side by side.
-             (let* ((out (assoc-ref outputs "out"))
-                    (bin (string-append out "/bin")))
-               (install-file "catimg" bin)
-               (rename-file (string-append bin "/catimg")
-                            (string-append bin "/catimg.sh"))
-               #t))))))
+             (copy-file "../source/catimg"
+                        (string-append (assoc-ref outputs "out")
+                                       "/bin/catimg.sh"))
+             #t)))))
     (inputs
      `(("imagemagick" ,imagemagick))) ; for the bash script version
     (home-page "https://github.com/posva/catimg")
@@ -441,3 +451,76 @@ imaging.  It supports several HDR and LDR image formats, and it can:
 a comic and manga reader.  It supports a variety of container formats
 including CBZ, CB7, CBT, LHA.")
     (license license:gpl2+)))
+
+(define-public qview
+  (package
+    (name "qview")
+    (version "2.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/jurplel/qView.git")
+                    (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1s29hz44rb5dwzq8d4i4bfg77dr0v3ywpvidpa6xzg7hnnv3mhi5"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'configure
+           (lambda _
+             (invoke "qmake")))
+         ;; Installation process hard-codes "/usr/bin", possibly
+         ;; prefixed.
+         (add-after 'configure 'fix-install-directory
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (substitute* "Makefile"
+                 (("\\$\\(INSTALL_ROOT\\)/usr") out))
+               #t)))
+         ;; Don't phone home or show "Checking for updates..." in the
+         ;; About menu.
+         (add-before 'build 'disable-auto-update
+           (lambda _
+             (substitute* "src/qvaboutdialog.cpp"
+               (("ui->updateLabel->setText\\(updateText\\);") "")
+               (("requestUpdates\\(\\);") ""))
+             #t)))))
+    (inputs
+     `(("qtbase" ,qtbase)
+       ("qtsvg" ,qtsvg)
+       ("qtimageformats" ,qtimageformats)))
+    (home-page "https://interversehq.com/qview/")
+    (synopsis "Convenient and minimal image viewer")
+    (description "qView is a Qt image viewer designed with visually
+minimalism and usability in mind.  Its features include animated GIF
+controls, file history, rotation/mirroring, and multithreaded
+preloading.")
+    (license license:gpl3+)))
+
+(define-public chafa
+  (package
+    (name "chafa")
+    (version "1.2.1")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://hpjansson.org/chafa/releases/chafa-"
+                                  version ".tar.xz"))
+              (sha256
+               (base32
+                "1hj4vdyczby8h52ff23qxl8ng18p5jy549idngpiddwszf5s4drz"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
+    (inputs
+     `(("glib" ,glib)
+       ("imagemagick" ,imagemagick)))
+    (synopsis "Convert images to ANSI/Unicode characters")
+    (description
+     "Chafa is a command-line utility that converts all kinds of images,
+including animated GIFs, into ANSI/Unicode character output that can be
+displayed in a terminal.")
+    (home-page "https://hpjansson.org/chafa/")
+    (license license:lgpl3+)))