gnu: Add python-pyshp.
[jackhill/guix/guix.git] / gnu / packages / image.scm
index 49d9e5d..457fb90 100644 (file)
@@ -9,7 +9,7 @@
 ;;; Copyright © 2014, 2017 John Darrington <jmd@gnu.org>
 ;;; Copyright © 2016, 2017, 2018, 2020 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
-;;; Copyright © 2016, 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2016–2021 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org>
 ;;; Copyright © 2016, 2017, 2020 Arun Isaac <arunisaac@systemreboot.net>
 ;;; Copyright © 2016, 2017 Kei Kebreau <kkebreau@posteo.net>
@@ -27,7 +27,8 @@
 ;;; Copyright © 2020 R Veera Kumar <vkor@vkten.in>
 ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2020 Zhu Zihao <all_but_last@163.com>
-;;; Copyright © 2020 Vinicius Monego <monego@posteo.net>
+;;; Copyright © 2020, 2021 Vinicius Monego <monego@posteo.net>
+;;; Copyright © 2021 Sharlatan Hellseher <sharlatanus@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -78,6 +79,7 @@
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages qt)
+  #:use-module (gnu packages ragel)
   #:use-module (gnu packages sphinx)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages textutils)
@@ -455,8 +457,8 @@ lossless JPEG manipulations such as rotation, scaling or cropping:
                                        "libjxr-fix-typos.patch"))))
     (build-system gnu-build-system)
     (arguments
-     '(#:make-flags
-       (list "CC=gcc"
+     `(#:make-flags
+       (list ,(string-append "CC=" (cc-for-target))
              ;; A substitute* procedure call would be enough to add the -fPIC
              ;; flag if there was no file decoding error.
              ;; The makefile is a "Non-ISO extended-ASCII text, with CRLF line
@@ -588,16 +590,18 @@ extracting icontainer icon files.")
        (sha256
         (base32
          "0d46bdvxdiv59lxnb0xz9ywm8arsr6xsapi5s6y6vnys2wjz6aax"))))
+   (replacement libtiff/fixed)
    (build-system gnu-build-system)
    (outputs '("out"
               "doc"))                           ;1.3 MiB of HTML documentation
    (arguments
     ;; Instead of using --docdir, this package has its own --with-docdir.
-    `(#:configure-flags (list (string-append "--with-docdir="
-                                             (assoc-ref %outputs "doc")
-                                             "/share/doc/"
-                                             ,name "-" ,version)
-                              "--disable-static")))
+    `(#:configure-flags
+      (list (string-append "--with-docdir="
+                           (assoc-ref %outputs "doc")
+                           "/share/doc/"
+                           ,name "-" ,(package-version this-package))
+            "--disable-static")))
    (inputs `(("zlib" ,zlib)
              ("libjpeg" ,libjpeg-turbo)))
    (synopsis "Library for handling TIFF files")
@@ -610,10 +614,24 @@ collection of tools for doing simple manipulations of TIFF images.")
                                   "See COPYRIGHT in the distribution."))
    (home-page "http://www.simplesystems.org/libtiff/")))
 
+(define-public libtiff/fixed
+  (package
+    (inherit libtiff)
+    (name "libtiff")
+    (version "4.2.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://download.osgeo.org/libtiff/tiff-"
+                           version ".tar.gz"))
+       (sha256
+        (base32
+         "1jrkjv0xya9radddn8idxvs2gqzp3l2b1s8knlizmn7ad3jq817b"))))))
+
 (define-public leptonica
   (package
     (name "leptonica")
-    (version "1.74.4")
+    (version "1.80.0")
     (source
      (origin
        (method git-fetch)
@@ -622,7 +640,7 @@ collection of tools for doing simple manipulations of TIFF images.")
              (commit version)))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "0sfg1ky0lghlq7xx0qii5167bim0wwfnnr83dl4skbj9awyvjiwi"))))
+        (base32 "12ddln72z5l3icz0i9rpsfkg5xik8fcwcn8lb0cp3jigjxi8gvkg"))))
     (build-system gnu-build-system)
     (native-inputs
      `(("gnuplot" ,gnuplot)             ;needed for test suite
@@ -872,7 +890,7 @@ JPEG 2000 Reference Software.")
     (outputs '("bin"                    ; utility programs
                "out"))                  ; library
     (arguments
-     '(#:make-flags (list "CC=gcc"
+     `(#:make-flags (list ,(string-append "CC=" (cc-for-target))
                           (string-append "PREFIX="
                                          (assoc-ref %outputs "out"))
                           (string-append "BINDIR="
@@ -980,7 +998,7 @@ Metafile}, and @acronym{EMF+, Enhanced Metafile Plus} files.")
 (define-public imlib2
   (package
     (name "imlib2")
-    (version "1.7.0")
+    (version "1.7.1")
     (source (origin
               (method url-fetch)
               (uri (string-append
@@ -988,7 +1006,7 @@ Metafile}, and @acronym{EMF+, Enhanced Metafile Plus} files.")
                     "/imlib2-" version ".tar.bz2"))
               (sha256
                (base32
-                "0zdk4afdrrr1539f2q15zja19j4wwfmpswzws2ffgflcnhywlxhr"))))
+                "01y45cdml2dr9cqgybrgxr86sd77d1qfa1gzclzy1j6bkminlfh3"))))
     (build-system gnu-build-system)
     (arguments
      '(#:configure-flags (list "--disable-static")))
@@ -1096,7 +1114,7 @@ supplies a generic doubly-linked list and some string functions.")
                         "0cwjxjz0f4gs6igvwqg0p99mnrsrwzkal1l2n08yvz2xq9s5khki"))))))))
    (build-system gnu-build-system)
    (arguments
-    '(#:phases
+    `(#:phases
       (modify-phases %standard-phases
         ;; According to Fedora these files depend on private headers, but their
         ;; presence is required for building, so we replace them with empty files.
@@ -1120,7 +1138,7 @@ supplies a generic doubly-linked list and some string functions.")
               (("-o root -g root") ""))
             #t)))
       #:make-flags
-      (list "CC=gcc"
+      (list ,(string-append "CC=" (cc-for-target))
             ;; We need '-fpermissive' for Source/FreeImage.h.
             ;; libjxr doesn't have a pkg-config file.
             (string-append "CFLAGS+=-O2 -fPIC -fvisibility=hidden -fpermissive "
@@ -1217,7 +1235,9 @@ processing and analysis library that puts its main emphasis on customizable
 algorithms and data structures.  It is particularly strong for
 multi-dimensional image processing.")
    (license license:expat)
-   (home-page "https://ukoethe.github.io/vigra/")))
+   (home-page "https://ukoethe.github.io/vigra/")
+   (properties '((max-silent-time . 7200))))) ;2 hours, to avoid timing out
+
 
 (define-public vigra-c
   (let* ((commit "66ff4fa5a7d4a77415caa676a45c2c6ea16562e7")
@@ -1348,34 +1368,6 @@ and XMP metadata of images in various formats.")
     ;;   <https://launchpad.net/ubuntu/precise/+source/exiv2/+copyright>.
     (license license:gpl2+)))
 
-(define-public exiv2-0.26
-  (package
-    (inherit exiv2)
-    (version "0.26")
-    (source (origin
-             (method url-fetch)
-             (uri (list (string-append "https://www.exiv2.org/builds/exiv2-"
-                                       version "-trunk.tar.gz")
-                        (string-append "https://www.exiv2.org/exiv2-"
-                                       version ".tar.gz")
-                        (string-append "https://fossies.org/linux/misc/exiv2-"
-                                       version ".tar.gz")))
-             (patches (search-patches "exiv2-CVE-2017-14860.patch"
-                                      "exiv2-CVE-2017-14859-14862-14864.patch"))
-             (sha256
-              (base32
-               "1yza317qxd8yshvqnay164imm0ks7cvij8y8j86p1gqi1153qpn7"))))
-    (build-system gnu-build-system)
-    (arguments '(#:tests? #f))                    ; no `check' target
-    (propagated-inputs
-     `(("expat" ,expat)
-       ("zlib" ,zlib)))
-    (native-inputs
-     `(("intltool" ,intltool)))
-
-    ;; People should rely on the newer version, so don't expose it.
-    (properties `((hidden? . #t)))))
-
 (define-public devil
   (package
     (name "devil")
@@ -1416,7 +1408,7 @@ convert, manipulate, filter and display a wide variety of image formats.")
 (define-public jasper
   (package
     (name "jasper")
-    (version "2.0.23")
+    (version "2.0.27")
     (source (origin
               (method git-fetch)
               (uri (git-reference
@@ -1425,7 +1417,7 @@ convert, manipulate, filter and display a wide variety of image formats.")
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "1fccpss5ii9rnsd2pkg6k7mkckwpfi8dgp64qzqv3zp1vs2nffw6"))))
+                "0mrnazk8qla7nn59xad86gmrf5fzqcv74j5xhcdrxbgfw67l17zd"))))
     (build-system cmake-build-system)
     (inputs
      `(("libjpeg" ,libjpeg-turbo)))
@@ -1577,6 +1569,39 @@ PNG, and performs PNG integrity checks and corrections.")
     (home-page "http://optipng.sourceforge.net/")
     (license license:zlib)))
 
+(define-public imgp
+  (package
+    (name "imgp")
+    (version "2.8")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "imgp" version))
+       (sha256
+        (base32 "0q99h9wv9rynig0s0flnr9mxi541zzl0gw8vh4y6m5x132diilri"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:tests? #f ;there are no tests
+       #:phases
+       (modify-phases %standard-phases
+         ;; setup.py expects the file to be named 'imgp'.
+         (add-after 'unpack 'rename-imgp
+           (lambda _
+             (rename-file "imgp.py" "imgp")
+             #t)))))
+    (inputs
+     `(("python-pillow" ,python-pillow)))
+    (home-page "https://github.com/jarun/imgp")
+    (synopsis "High-performance CLI batch image resizer & rotator")
+    (description
+     "@code{imgp} is a command line image resizer and rotator for JPEG and PNG
+images.  It can resize (or thumbnail) and rotate thousands of images in a go
+while saving significantly on storage.
+
+This package may optionally be built with @code{python-pillow-simd} in place
+of @{python-pillow} for SIMD parallelism.")
+    (license license:gpl3+)))
+
 (define-public pngsuite
   (package
     (name "pngsuite")
@@ -1721,7 +1746,7 @@ medical image data, e.g. magnetic resonance image (MRI) and functional MRI
 (define-public gpick
   (package
     (name "gpick")
-    (version "0.2.5")
+    (version "0.2.6")
     (source (origin
               (method git-fetch)
               (uri (git-reference
@@ -1730,12 +1755,13 @@ medical image data, e.g. magnetic resonance image (MRI) and functional MRI
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "0mcj806zagh122qgrdkrg0macpzby97y89xi2sjyn3bh8vmmyxjy"))))
+                "0nl89gca5nmbyycv5rl5bm6k7facapdk4pab9pl949aa3cjw9bk7"))))
     (build-system scons-build-system)
     (native-inputs
      `(("boost" ,boost)
        ("gettext" ,gettext-minimal)
-       ("pkg-config" ,pkg-config)))
+       ("pkg-config" ,pkg-config)
+       ("ragel" ,ragel)))
     (inputs
      `(("expat" ,expat)
        ("gtk2" ,gtk+-2)
@@ -1798,7 +1824,7 @@ parsing, viewing, modifying, and saving this metadata.")
     (native-inputs
      `(("qttools" ,qttools)))
     (inputs
-     `(("qtbase" ,qtbase)
+     `(("qtbase" ,qtbase-5)
        ("qtsvg" ,qtsvg)))
     (arguments
      `(#:tests? #f))                    ;no tests
@@ -1816,6 +1842,36 @@ Features:
 @end itemize\n")
     (license license:gpl3+)))
 
+(define-public swappy
+  (package
+    (name "swappy")
+    (version "1.2.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/jtheoof/swappy")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "14ac2jmnak7avcz0jhqjm30vk7pv3gq5aq5rdyh84k8c613kkicf"))))
+    (build-system meson-build-system)
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("scdoc" ,scdoc)
+       ("glib" ,glib "bin"))) ; for 'glib-compile-resources'
+    (inputs
+     `(("gtk+" ,gtk+)
+       ("libnotify" ,libnotify)))
+    (home-page "https://github.com/jtheoof/swappy")
+    (synopsis "Grab and edit on the fly snapshots of a Wayland compositor")
+    (description
+     "@command{swappy} is a command-line utility to take and edit screenshots
+of Wayland desktops.  Works great with grim, slurp and sway.  But can easily
+work with other screen copy tools that can output a final PNG image to
+stdout.")
+    (license license:expat)))
+
 (define-public gifsicle
   (package
    (name "gifsicle")
@@ -1889,7 +1945,7 @@ identical visual appearance.")
 (define-public grim
   (package
    (name "grim")
-   (version "1.3.1")
+   (version "1.3.2")
    (source
     (origin
      (method git-fetch)
@@ -1898,7 +1954,7 @@ identical visual appearance.")
            (commit (string-append "v" version))))
      (file-name (git-file-name name version))
      (sha256
-      (base32 "0fjmjq0ws9rlblkcqxxw2lv7zvvyi618jqzlnz5z9zb477jwdfib"))))
+      (base32 "1l4gwvvc0zvg5b6f6w92xjhmwj7cg9hlgrf43lc7ygaz8dh6cmzg"))))
    (build-system meson-build-system)
    (native-inputs `(("pkg-config" ,pkg-config)
                     ("scdoc" ,scdoc)))
@@ -1915,7 +1971,7 @@ identical visual appearance.")
 (define-public slurp
   (package
    (name "slurp")
-   (version "1.3.1")
+   (version "1.3.2")
    (source
     (origin
      (method git-fetch)
@@ -1924,7 +1980,7 @@ identical visual appearance.")
            (commit (string-append "v" version))))
      (file-name (git-file-name name version))
      (sha256
-      (base32 "1fby2v2ylcadgclds05wpkl9xi2r9dfz49dqyqpn20rjv1wnz3jv"))))
+      (base32 "00dx6ds1227qnxqrw58k0am78q8fa49rgp1zingrkjcbpbi7g475"))))
    (build-system meson-build-system)
    (native-inputs
     `(("pkg-config" ,pkg-config)
@@ -2070,7 +2126,7 @@ This package can be used to create @code{favicon.ico} files for web sites.")
 (define-public libavif
   (package
     (name "libavif")
-    (version "0.8.4")
+    (version "0.9.1")
     (source (origin
               (method git-fetch)
               (uri (git-reference
@@ -2079,7 +2135,7 @@ This package can be used to create @code{favicon.ico} files for web sites.")
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "1qvjd3xi9r89pcblxdgz4c6hqp67ss53b1x9zkg7lrik7g3lwq8d"))))
+                "1h1gf4cbrff73f8s4avkph2sbr4d3s71kifipskzcmrqjbjc2qsx"))))
     (build-system cmake-build-system)
     (arguments
      `(#:configure-flags '("-DAVIF_CODEC_AOM=ON" "-DAVIF_CODEC_DAV1D=ON"
@@ -2108,6 +2164,42 @@ by AOM, including with alpha.")
     (license (list license:bsd-2    ; libavif itself
                    license:expat)))) ; cJSON in the test suite
 
+(define-public libheif
+  (package
+    (name "libheif")
+    (version "1.12.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/strukturag/libheif")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0cp2d216hp7gw3n56x3g5q5n8jb9ganyanrlibxw8fw16il8nca6"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f)) ;no test target although there is a tests folder
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("dav1d" ,dav1d)
+       ("gdk-pixbuf" ,gdk-pixbuf) ;optional
+       ("libaom" ,libaom)
+       ("libde265" ,libde265)
+       ("libjpeg" ,libjpeg-turbo)
+       ("libpng" ,libpng)
+       ("x265" ,x265)))
+    (home-page "https://github.com/strukturag/libheif")
+    (synopsis "HEIF and AVIF file format decoder and encoder")
+    (description
+     "@code{libheif} is an ISO/IEC 23008-12:2017 HEIF and AVIF (AV1 Image File
+Format) file format decoder and encoder.")
+    (license license:lgpl3+)))
+
 (define-public mtpaint
   (package
     (name "mtpaint")