gnu: r-dose: Update to 3.10.2.
[jackhill/guix/guix.git] / gnu / packages / image-viewers.scm
index ae7ae0f..a5bfb28 100644 (file)
@@ -2,13 +2,14 @@
 ;;; Copyright © 2013, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2014 Ian Denhardt <ian@zenhack.net>
 ;;; Copyright © 2015, 2016 Alex Kost <alezost@gmail.com>
-;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
+;;; 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>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
 (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)
+  #:use-module (guix build-system meson)
   #:use-module (guix build-system python)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages algebra)
-  #:use-module (gnu packages base)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages curl)
   #:use-module (gnu packages fontutils)
+  #:use-module (gnu packages gettext)
   #:use-module (gnu packages ghostscript)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gnome)
@@ -52,6 +55,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))
@@ -59,7 +63,7 @@
 (define-public feh
   (package
     (name "feh")
-    (version "2.25.1")
+    (version "3.1.3")
     (home-page "https://feh.finalrewind.org/")
     (source (origin
               (method url-fetch)
                                   name "-" version ".tar.bz2"))
               (sha256
                (base32
-                "197sm78bm33dvahr5nxqkbmpmdn4b13ahc9mrgn1l7n104bg4phc"))))
+                "1vsnxf4as3vyzjfhd8frzb1a8i7wnq7ck5ljx7qxqrnfqvxl1s4z"))))
     (build-system gnu-build-system)
     (arguments
      '(#:phases (modify-phases %standard-phases (delete 'configure))
        #:test-target "test"
        #:make-flags
-       (list "CC=gcc" (string-append "PREFIX=" (assoc-ref %outputs "out")))))
+       (list "CC=gcc" (string-append "PREFIX=" (assoc-ref %outputs "out"))
+             "exif=1")))
     (native-inputs
      `(("perl" ,perl)
        ("perl-test-command" ,perl-test-command)))
     (inputs `(("imlib2" ,imlib2)
               ("curl" ,curl)
+              ("libexif" ,libexif)
               ("libpng" ,libpng)
               ("libxt" ,libxt)
               ("libx11" ,libx11)
@@ -121,28 +127,25 @@ actions.")
 
        #:phases
        (modify-phases %standard-phases
-         (add-after 'unpack 'autogen
+         (add-before 'bootstrap 'pre-bootstrap
            (lambda _
              (define (write-dummy-changelog port)
                (display "See Git history for a change log.\n" port))
-
-             (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)
-
-             (zero? (system* "sh" "autogen.sh")))))))
+             (setenv "NOCONFIGURE" "true")
+             #t)))))
     (inputs
      `(("clutter" ,clutter)
        ("libchamplain" ,libchamplain)
        ("lcms" ,lcms)
        ("exiv2" ,exiv2)
        ("libpng" ,libpng)
-       ("gtk+" ,gtk+-2)))
+       ("gtk+" ,gtk+)))
     (native-inputs
      `(("autoconf" ,autoconf)
        ("automake" ,automake)
@@ -186,16 +189,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
@@ -204,7 +207,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")
@@ -231,43 +234,38 @@ it and customize it for your needs.")
 (define-public viewnior
   (package
     (name "viewnior")
-    (version "1.6")
+    (version "1.7")
     (source
       (origin
-        (method url-fetch)
-        (uri (string-append "https://github.com/xsisqox/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
-          "18309qjgwak3kn228z3p3nx7yxasqgzx69v3rgc23hf161nky0c9"))))
-    (build-system gnu-build-system)
+          "0y4hk3vq8psba5k615w18qj0kbdfp5w0lm98nv5apy6hmcpwfyig"))))
+    (build-system meson-build-system)
     (arguments
      '(#:phases
        (modify-phases %standard-phases
-         (add-after 'unpack 'autogen
-           (lambda _
-             (zero? (system* "sh" "autogen.sh"))))
-         (add-before 'install 'skip-gtk-update-icon-cache
+         (add-after 'unpack 'patch-source
            (lambda _
              ;; Don't create 'icon-theme.cache'
-             (substitute* (find-files "data" "^Makefile$")
-               (("gtk-update-icon-cache") (which "true")))
-             #t)))))
+             (substitute* "meson.build"
+               (("meson.add_install_script*") ""))
+             #t)))
+       #:tests? #f)) ; no tests
     (native-inputs
-     `(("automake" ,automake)
-       ("autoconf" ,autoconf)
-       ("intltool" ,intltool)
+     `(("gettext" ,gettext-minimal)
        ("glib" ,glib "bin") ; glib-genmarshal
-       ("gnome-common" ,gnome-common)
-       ("libtool" ,libtool)
        ("pkg-config" ,pkg-config)
-       ("shared-mime-info" ,shared-mime-info)
-       ("which" ,which)))
+       ("shared-mime-info" ,shared-mime-info)))
     (inputs
      `(("exiv2" ,exiv2)
        ("gdk-pixbuf" ,gdk-pixbuf)
        ("gtk+-2" ,gtk+-2)))
-    (home-page "http://siyanpanayotov.com/project/viewnior/")
+    (home-page "http://siyanpanayotov.com/project/viewnior")
     (synopsis "Simple, fast and elegant image viewer")
     (description "Viewnior is an image viewer program.  Created to be simple,
 fast and elegant.  Its minimalistic interface provides more screenspace for
@@ -288,52 +286,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")
@@ -445,3 +430,50 @@ 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)))
+              (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+)))