gnu: Add amule.
[jackhill/guix/guix.git] / gnu / packages / image.scm
index 9366851..bbfd621 100644 (file)
@@ -7,16 +7,16 @@
 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
 ;;; Copyright © 2015 Amirouche Boubekki <amirouche@hypermove.net>
 ;;; Copyright © 2014, 2017 John Darrington <jmd@gnu.org>
-;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
-;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name>
-;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
-;;; Copyright © 2016, 2017 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2016, 2017, 2018 Leo Famulari <leo@famulari.name>
+;;; Copyright © 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2016, 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org>
 ;;; Copyright © 2016, 2017 Arun Isaac <arunisaac@systemreboot.net>
 ;;; Copyright © 2016, 2017 Kei Kebreau <kkebreau@posteo.net>
-;;; Copyright © 2017 ng0 <ng0@infotropique.org>
+;;; Copyright © 2017 Nils Gillmann <ng0@n0.is>
 ;;; Copyright © 2017 Hartmut Goebel <h.goebel@crazy-compilers.com>
 ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
+;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
   #:use-module (gnu packages maths)
   #:use-module (gnu packages mcrypt)
   #:use-module (gnu packages perl)
+  #:use-module (gnu packages photo)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
+  #:use-module (gnu packages qt)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
@@ -336,13 +338,13 @@ official designation is ISO/IEC 29199-2). This library is an implementation of t
 (define-public jpegoptim
   (package
    (name "jpegoptim")
-   (version "1.4.4")
+   (version "1.4.5")
    (source (origin
             (method url-fetch)
             (uri (string-append "http://www.kokkonen.net/tjko/src/jpegoptim-"
                                 version ".tar.gz"))
             (sha256 (base32
-                     "1cn1i0g1xjdwa12w0ifbnzgb1vqbpr8ji6h05vxksj79vyi3x849"))))
+                     "1mngi8c4mhzwa7i4wqrqq6i80cqj4adbacblfvk6dy573wywyxmi"))))
    (build-system gnu-build-system)
    (inputs `(("libjpeg" ,libjpeg)))
    (arguments
@@ -354,7 +356,7 @@ official designation is ISO/IEC 29199-2). This library is an implementation of t
 the Huffman tables) and \"lossy\" optimization based on setting
 maximum quality factor.")
    (license license:gpl2+)
-   (home-page "http://www.kokkonen.net/tjko/projects.html#jpegoptim")))
+   (home-page "https://www.kokkonen.net/tjko/projects.html#jpegoptim")))
 
 (define-public libicns
   (package
@@ -391,10 +393,11 @@ extracting icontainer icon files.")
   (package
    (name "libtiff")
    (version "4.0.9")
+   (replacement libtiff/fixed)
    (source
      (origin
        (method url-fetch)
-       (uri (string-append "ftp://download.osgeo.org/libtiff/tiff-"
+       (uri (string-append "http://download.osgeo.org/libtiff/tiff-"
                            version ".tar.gz"))
        (sha256
         (base32
@@ -420,6 +423,17 @@ collection of tools for doing simple manipulations of TIFF images.")
                                   "See COPYRIGHT in the distribution."))
    (home-page "http://www.simplesystems.org/libtiff/")))
 
+(define libtiff/fixed
+  (package
+    (inherit libtiff)
+    (source
+      (origin
+        (inherit (package-source libtiff))
+        (patches
+          (append (origin-patches (package-source libtiff))
+                  (search-patches "libtiff-CVE-2017-9935.patch"
+                                  "libtiff-CVE-2017-18013.patch")))))))
+
 (define-public leptonica
   (package
     (name "leptonica")
@@ -561,7 +575,9 @@ error-resilience, a Java-viewer for j2k-images, ...")
                                   version ".tar.bz2"))
               (sha256
                (base32
-                "1md83dip8rf29y40cm5r7nn19705f54iraz6545zhwa6y8zyq9yz"))))
+                "1md83dip8rf29y40cm5r7nn19705f54iraz6545zhwa6y8zyq9yz"))
+              (patches (search-patches
+                        "giflib-make-reallocarray-private.patch"))))
     (build-system gnu-build-system)
     (outputs '("bin"                    ; utility programs
                "out"))                  ; library
@@ -621,7 +637,7 @@ compose, and analyze GIF images.")
 (define-public imlib2
   (package
     (name "imlib2")
-    (version "1.4.10")
+    (version "1.5.1")
     (source (origin
               (method url-fetch)
               (uri (string-append
@@ -629,7 +645,7 @@ compose, and analyze GIF images.")
                     "/imlib2-" version ".tar.bz2"))
               (sha256
                (base32
-                "0wm2q2xlkbm71k7mw2jyzbxgzylrkcj5yh6nq58w5gybhp98qs9z"))))
+                "1bms2iwmvnvpz5jqq3r52glarqkafif47zbh1ykz8hw85d2mfkps"))))
     (build-system gnu-build-system)
     (native-inputs
      `(("pkgconfig" ,pkg-config)))
@@ -702,26 +718,65 @@ supplies a generic doubly-linked list and some string functions.")
             (sha256
              (base32
               "12bz57asdcfsz3zr9i9nska0fb6h3z2aizy412qjqkixkginbz7v"))
-            (patches (search-patches "freeimage-CVE-2015-0852.patch"
+            (modules '((guix build utils)))
+            (snippet
+             '(begin
+                (for-each
+                  (lambda (dir)
+                    (delete-file-recursively (string-append "Source/" dir)))
+                  '("LibJPEG" "LibOpenJPEG" "LibPNG" "LibRawLite"
+                    ;; "LibJXR"
+                    "LibWebP" "OpenEXR" "ZLib"))))
+            (patches (search-patches "freeimage-unbundle.patch"
+                                     "freeimage-CVE-2015-0852.patch"
                                      "freeimage-CVE-2016-5684.patch"
                                      "freeimage-fix-build-with-gcc-5.patch"))))
    (build-system gnu-build-system)
    (arguments
     '(#:phases
       (modify-phases %standard-phases
-        (delete 'configure)
+        ;; According to Fedora these files depend on private headers, but their
+        ;; presence is required for building, so we replace them with empty files.
+        (add-after 'unpack 'delete-unbuildable-files
+          (lambda _
+            (for-each (lambda (file)
+                        (delete-file file)
+                        (close (open file O_CREAT)))
+                      '("Source/FreeImage/PluginG3.cpp"
+                        "Source/FreeImageToolkit/JPEGTransform.cpp"))
+            #t))
+        ;; These scripts generate the Makefiles.
+        (replace 'configure
+          (lambda _
+            (invoke "sh" "gensrclist.sh")
+            (invoke "sh" "genfipsrclist.sh")))
         (add-before 'build 'patch-makefile
           (lambda* (#:key outputs #:allow-other-keys)
             (substitute* "Makefile.gnu"
               (("/usr") (assoc-ref outputs "out"))
               (("-o root -g root") ""))
             #t)))
-      #:make-flags '("CC=gcc")
+      #:make-flags
+      (list "CC=gcc"
+            ;; We need '-fpermissive' for Source/FreeImage.h.
+            ;; libjxr doesn't have a pkg-config file.
+            (string-append "CFLAGS+=-O2 -fPIC -fvisibility=hidden -fpermissive "
+                           ;"-I" (assoc-ref %build-inputs "libjxr") "/include/jxrlib"
+                           ))
       #:tests? #f)) ; no check target
    (native-inputs
-    `(("unzip" ,unzip)))
-   ;; Fails to build on MIPS due to assembly code in the source.
-   (supported-systems (delete "mips64el-linux" %supported-systems))
+    `(("pkg-config" ,pkg-config)
+      ("unzip" ,unzip)))
+   (inputs
+    `(("libjpeg" ,libjpeg)
+      ;("libjxr" ,libjxr)
+      ("libpng" ,libpng)
+      ("libraw" ,libraw)
+      ("libtiff" ,libtiff)
+      ("libwebp" ,libwebp)
+      ("openexr" ,openexr)
+      ("openjpeg" ,openjpeg)
+      ("zlib" ,zlib)))
    (synopsis "Library for handling popular graphics image formats")
    (description
     "FreeImage is a library for developers who would like to support popular
@@ -791,16 +846,18 @@ multi-dimensional image processing.")
 (define-public libwebp
   (package
     (name "libwebp")
-    (version "0.6.1")
+    (version "1.0.0")
     (source
      (origin
-       (method url-fetch)
-       (uri (string-append
-             "http://downloads.webmproject.org/releases/webp/libwebp-" version
-             ".tar.gz"))
+       ;; No tarballs are provided for >0.6.1.
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://chromium.googlesource.com/webm/libwebp")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
        (sha256
         (base32
-         "1ayq2zq0zbgf5yizbm32zh7p1vb8kibw74am6am1n5cz5mw3ql06"))))
+         "1w8jzdbr1s4238ygyrlxryycss3f2z6d9amxdq8m82nl3l6skar4"))))
     (build-system gnu-build-system)
     (inputs
      `(("freeglut" ,freeglut)
@@ -808,10 +865,18 @@ multi-dimensional image processing.")
        ("libjpeg" ,libjpeg)
        ("libpng" ,libpng)
        ("libtiff" ,libtiff)))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)))
     (arguments
      '(#:configure-flags '("--enable-libwebpmux"
                            "--enable-libwebpdemux"
-                           "--enable-libwebpdecoder")))
+                           "--enable-libwebpdecoder")
+       #:phases (modify-phases %standard-phases
+                  (add-after 'unpack 'bootstrap
+                    (lambda _
+                      (invoke "autoreconf" "-vif"))))))
     (home-page "https://developers.google.com/speed/webp/")
     (synopsis "Lossless and lossy image compression")
     (description
@@ -1079,29 +1144,28 @@ installed as @code{stb_image}.")
 (define-public optipng
   (package
     (name "optipng")
-    (version "0.7.6")
+    (version "0.7.7")
     (source
      (origin
        (method url-fetch)
        (uri (string-append "http://prdownloads.sourceforge.net/optipng/optipng-"
                            version ".tar.gz"))
-       (patches (search-patches "optipng-CVE-2017-1000229.patch"))
        (sha256
         (base32
-         "105yk5qykvhiahzag67gm36s2kplxf6qn5hay02md0nkrcgn6w28"))))
+         "0lj4clb851fzpaq446wgj0sfy922zs5l5misbpwv6w7qrqrz4cjg"))))
     (build-system gnu-build-system)
     (inputs
      `(("zlib" ,zlib)))
     (arguments
      '(#:phases
        (modify-phases %standard-phases
-         ;; configure script does not accept arguments CONFIG_SHELL and SHELL
          (replace 'configure
            (lambda* (#:key outputs #:allow-other-keys)
-             (zero? (system* "sh" "configure"
-                             (string-append "--prefix=" (assoc-ref outputs "out")))))))))
-    (synopsis "Optimizer that recompresses PNG image files to a
-smaller size")
+             ;; configure script doesn't accept arguments CONFIG_SHELL and SHELL
+             (invoke "sh" "configure"
+                     (string-append "--prefix=" (assoc-ref outputs "out")))
+             #t)))))
+    (synopsis "Optimizer that recompresses PNG image files to a smaller size")
     (description "OptiPNG is a PNG optimizer that recompresses image
 files to a smaller size, without losing any information.  This program
 also converts external formats (BMP, GIF, PNM and TIFF) to optimized
@@ -1219,3 +1283,86 @@ medical image data, e.g. magnetic resonance image (MRI) and functional MRI
     (synopsis "Color picker")
     (description "Gpick is an advanced color picker and palette editing tool.")
     (license license:bsd-3)))
+
+(define-public libiptcdata
+  (package
+    (name "libiptcdata")
+    (version "1.0.4")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://sourceforge/" name "/" name "/"
+                                  version "/" name "-" version ".tar.gz"))
+              (sha256
+               (base32
+                "03pfvkmmx762iydq0q207x2028d275pbdysfsgpmrr0ywy63pxkr"))))
+    (build-system gnu-build-system)
+    (home-page "http://libiptcdata.sourceforge.net/")
+    (synopsis "IPTC metadata manipulation library")
+    (description "Libiptcdata is a C library for manipulating the International
+Press Telecommunications Council (IPTC) metadata stored within multimedia files
+such as images.  This metadata can include captions and keywords, often used by
+popular photo management applications.  The library provides routines for
+parsing, viewing, modifying, and saving this metadata.")
+    (license license:lgpl2.0+)))
+
+(define-public flameshot
+  (package
+    (name "flameshot")
+    (version "0.5.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://github.com/lupoDharkael/flameshot/archive/"
+                           "v" version ".tar.gz"))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32
+         "0kp451bqgssvg8n3sg60s3fifplm9l5kxiij0yxkl864p2mhw8im"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("qttools" ,qttools)))
+    (inputs
+     `(("qtbase" ,qtbase)))
+    (arguments
+     `(#:tests? #f ; no tests
+       #:phases
+       (modify-phases %standard-phases
+         (replace 'configure
+           (lambda* (#:key outputs #:allow-other-keys)
+             (invoke "qmake"
+                     "CONFIG+=packaging"
+                     (string-append "BASEDIR=" (assoc-ref outputs "out"))
+                     "PREFIX=/"))))))
+    (home-page "https://github.com/lupoDharkael/flameshot")
+    (synopsis "Powerful yet simple to use screenshot software")
+    (description "Flameshot is a screenshot program.
+Features:
+
+@itemize
+@item Customizable appearance.
+@item Easy to use.
+@item In-app screenshot edition.
+@item DBus interface.
+@item Upload to Imgur.
+@end itemize\n")
+    (license license:gpl3+)))
+
+(define-public r-jpeg
+  (package
+   (name "r-jpeg")
+   (version "0.1-8")
+   (source
+     (origin
+       (method url-fetch)
+       (uri (cran-uri "jpeg" version))
+       (sha256
+        (base32
+         "05hawv5qcb82ljc1l2nchx1wah8mq2k2kfkhpzyww554ngzbwcnh"))))
+   (build-system r-build-system)
+   (inputs `(("libjpeg" ,libjpeg)))
+   (home-page "http://www.rforge.net/jpeg/")
+   (synopsis "Read and write JPEG images with R")
+   (description "This package provides a way to read, write and display bitmap
+images stored in the JPEG format with R.  It can read and write both files and
+in-memory raw vectors.")
+   (license license:gpl2+)))