gnu: linux-libre 4.19: Update to 4.19.187.
[jackhill/guix/guix.git] / gnu / packages / gimp.scm
index 42a55cf..eee9581 100644 (file)
@@ -1,10 +1,12 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2014, 2015 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2016, 2018 Ricardo Wurmus <rekado@elephly.net>
-;;; Copyright © 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
-;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
-;;; Copyright © 2018 Leo Famulari <leo@famulari.name>
+;;; Copyright © 2016, 2017, 2018, 2020 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2018, 2020 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2018 Thorsten Wilms <t_w_@freenet.de>
+;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
   #:use-module (gnu packages)
   #:use-module (gnu packages algebra)
   #:use-module (gnu packages autotools)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages build-tools)
+  #:use-module (gnu packages documentation)
+  #:use-module (gnu packages graphviz)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages gnome)
+  #:use-module (gnu packages graphics)
   #:use-module (gnu packages image)
   #:use-module (gnu packages ghostscript)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages xml)
+  #:use-module (gnu packages linux)
+  #:use-module (gnu packages ncurses)
+  #:use-module (gnu packages patchutils)
   #:use-module (gnu packages pdf)
   #:use-module (gnu packages photo)
   #:use-module (gnu packages python)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xorg))
 
+(define-public poly2tri-c
+  (package
+    (name "poly2tri-c")
+    (version "0.1.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append "https://storage.googleapis.com/"
+                       "google-code-archive-source/v2/code.google.com/"
+                       "poly2tri-c/source-archive.zip"))
+       (file-name
+        (string-append name "-" version ".zip"))
+       (sha256
+        (base32 "17cw0zhbnf2gb59jm26z0wcarqgdwir9jr1fpi3v9lcvyb2s3mqj"))))
+    (build-system glib-or-gtk-build-system)
+    (outputs '("out" "doc"))
+    (arguments
+     `(#:configure-flags
+       (list
+        "--disable-static")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'disable-strict-rules
+           (lambda _
+             (substitute* "configure.ac"
+               (("\\$CFLAGS -Wall -ansi -pedantic")
+                "$CFLAGS")
+               (("\\$CFLAGS -Werror")
+                "$CFLAGS"))
+             #t))
+         (add-after 'disable-strict-rules 'fix-build-errors
+           (lambda _
+             (substitute* "poly2tri-c/refine/Makefile.am"
+               (("cdt.c")
+                "rcdt.c")
+               (("cdt.h")
+                "rcdt.h")
+               (("utils.c")
+                "rutils.c")
+               (("utils.h")
+                "rutils.h"))
+             #t))
+         (add-before 'bootstrap 'configure-later
+           (lambda _
+             (setenv "NOCONFIGURE" "set")
+             #t))
+         (add-after 'build 'generate-doc
+           (lambda _
+             (invoke "doxygen")
+             #t))
+         (add-after 'install 'install-doc
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (doc (assoc-ref outputs "doc")))
+               (copy-recursively
+                "doc"
+                (string-append doc "/share/doc/poly2tri-c"))
+               #t))))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("doxygen" ,doxygen)
+       ("libtool" ,libtool)
+       ("pkg-config" ,pkg-config)
+       ("unzip" ,unzip)
+       ("which" ,which)))
+    (propagated-inputs
+     `(("glib" ,glib)))
+    (synopsis "2D constrained Delaunay triangulation library")
+    (description "Poly2Tri-C is a library for generating, refining and rendering
+2-Dimensional Constrained Delaunay Triangulations.")
+    (home-page "https://code.google.com/archive/p/poly2tri-c/")
+    (license license:bsd-3)))
+
+(define-public mrg
+  (package
+    (name "mrg")
+    (version "0.1.4")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/hodefoting/mrg")
+         (commit version)))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "106qhh0c11576cc5kh90ds0ram72d3r6n9sadw0y4krnhap6dvwk"))))
+    (build-system meson-build-system)
+    (arguments
+     `(#:glib-or-gtk? #t))   ; To wrap binaries and/or compile schemas
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
+    (propagated-inputs
+     `(("alsa" ,alsa-lib)
+       ("cairo" ,cairo)
+       ("gtk+" ,gtk+)
+       ("mmm" ,mmm)
+       ("x11" ,libx11)))
+    (synopsis "Microraptor GUI")
+    (description "MrG is is a C API for creating user interfaces.  It can be
+used as an application writing environment or as an interactive canvas for part
+of a larger interface.")
+    (home-page "https://github.com/hodefoting/mrg")
+    (license license:lgpl2.0+)))
+
 (define-public babl
   (package
     (name "babl")
-    (version "0.1.72")
+    (version "0.1.86")
     (source (origin
               (method url-fetch)
               (uri (list (string-append "https://download.gimp.org/pub/babl/"
                                         "/babl-" version ".tar.xz")))
               (sha256
                (base32
-                "0hkagjrnza77aasa1kss5hvy37ndm50y6i7hkdn2z8hzgc4i3qb4"))))
+                "1w68h81kqkqnziixrx21qs0gfv2z79651h19sxn226xdb58mjgqb"))))
     (build-system meson-build-system)
     (arguments
-     `(#:configure-flags
+     `(#:meson ,meson-0.55
+       #:configure-flags
        (list "-Denable-gir=false")))
     (native-inputs
      `(("pkg-config" ,pkg-config)))
     (propagated-inputs
      ;; Propagated to satisfy ‘babl.pc’.
      `(("lcms" ,lcms)))
-    (home-page "http://gegl.org/babl/")
+    (home-page "https://gegl.org/babl/")
     (synopsis "Image pixel format conversion library")
     (description
      "Babl is a dynamic, any-to-any pixel format translation library.
@@ -89,7 +208,7 @@ provided, as well as a framework to add new color models and data types.")
 (define-public gegl
   (package
     (name "gegl")
-    (version "0.4.18")
+    (version "0.4.28")
     (source (origin
               (method url-fetch)
               (uri (list (string-append "https://download.gimp.org/pub/gegl/"
@@ -103,11 +222,27 @@ provided, as well as a framework to add new color models and data types.")
                                         "/gegl-" version ".tar.xz")))
               (sha256
                (base32
-                "0r6akqnrkvxizyhyi8sv40mxm7j4bcwjb6mqjpxy0zzbbfsdyin9"))))
+                "003ri7yv7lm2fi86ama3vlkwnz656yyib4r36hxwlk6mfy2hs48x"))))
     (build-system meson-build-system)
     (arguments
-     `(#:configure-flags
-       (list "-Dintrospection=false")))
+     `(#:meson ,meson-0.55
+       #:configure-flags
+       (list "-Dintrospection=false")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'extend-test-time-outs
+           (lambda _
+             ;; Multiply some poorly-chosen time-outs for busy build machines.
+             (substitute* "tests/simple/test-node-exponential.c"
+               (("G_TIME_SPAN_SECOND" match)
+                (string-append "10 * " match)))
+             (substitute* "tests/simple/test-buffer-sharing.c"
+               (("g_timeout_add_seconds\\([0-9]+" match)
+                (string-append match "0")))
+             (substitute* (find-files "tests" "^meson\\.build$")
+               (("timeout ?: [0-9]+" match)
+                (string-append match "0")))
+             #t)))))
     ;; These are propagated to satisfy 'gegl-0.4.pc'.
     (propagated-inputs
      `(("babl" ,babl)
@@ -117,12 +252,12 @@ provided, as well as a framework to add new color models and data types.")
      `(("cairo" ,cairo)
        ("pango" ,pango)
        ("libpng" ,libpng)
-       ("libjpeg" ,libjpeg)))
+       ("libjpeg" ,libjpeg-turbo)))
     (native-inputs
      `(("pkg-config" ,pkg-config)
        ("glib" ,glib "bin")             ; for gtester
        ("intltool" ,intltool)))
-    (home-page "http://gegl.org")
+    (home-page "https://gegl.org")
     (synopsis "Graph based image processing framework")
     (description "GEGL (Generic Graphics Library) provides infrastructure to
 do demand based cached non destructive image editing on larger than RAM
@@ -134,15 +269,16 @@ buffers.")
 (define-public gimp
   (package
     (name "gimp")
-    (version "2.10.14")
-    (source (origin
-              (method url-fetch)
-              (uri (string-append "https://download.gimp.org/pub/gimp/v"
-                                  (version-major+minor version)
-                                  "/gimp-" version ".tar.bz2"))
-              (sha256
-               (base32
-                "0m6wdnfvsxyhimdd4v3351g4r1fklllnbipbwcfym3h7q88hz6yz"))))
+    (version "2.10.22")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://download.gimp.org/pub/gimp/v"
+                           (version-major+minor version)
+                           "/gimp-" version ".tar.bz2"))
+       (sha256
+        (base32 "1fqqyshakvdarf1jipk2n33ibqr23ni22z3d8srq13bpydblpf1d"))
+       (patches (search-patches "gimp-make-gegl-introspect-optional.patch"))))
     (build-system gnu-build-system)
     (outputs '("out"
                "doc"))                            ; 9 MiB of gtk-doc HTML
@@ -151,6 +287,16 @@ buffers.")
        (list (string-append "--with-html-dir="
                             (assoc-ref %outputs "doc")
                             "/share/gtk-doc/html")
+
+             ;; Prevent the build system from running 'gtk-update-icon-cache'
+             ;; which is not needed during the build because Guix runs it at
+             ;; profile creation time.
+             "ac_cv_path_GTK_UPDATE_ICON_CACHE=true"
+
+             ;; Disable automatic network request on startup to check for
+             ;; version updates.
+             "--disable-check-update"
+
              ;; ./configure requests not to annoy upstream with packaging bugs.
              "--with-bug-report-url=https://bugs.gnu.org/guix")
        #:phases
@@ -174,15 +320,17 @@ buffers.")
        ("glib" ,glib)
        ("glib-networking" ,glib-networking)
        ("libtiff" ,libtiff)
-       ("libjpeg" ,libjpeg)
+       ("libwebp" ,libwebp)
+       ("libjpeg" ,libjpeg-turbo)
        ("atk" ,atk)
        ("gexiv2" ,gexiv2)
        ("gtk+" ,gtk+-2)
        ("libmypaint" ,libmypaint)
-       ("mypaint-brushes" ,mypaint-brushes)
+       ("mypaint-brushes" ,mypaint-brushes-1.3)
        ("exif" ,libexif)                ; optional, EXIF + XMP support
        ("lcms" ,lcms)                   ; optional, color management
        ("librsvg" ,librsvg)             ; optional, SVG support
+       ("libxcursor" ,libxcursor)       ; optional, Mouse Cursor support
        ("poppler" ,poppler)             ; optional, PDF support
        ("poppler-data" ,poppler-data)
        ("python" ,python-2)             ; optional, Python support
@@ -254,7 +402,7 @@ that is extensible via a plugin system.")
        ("gtk+" ,gtk+-2)))
     (native-inputs
      `(("pkg-config" ,pkg-config)))
-    (home-page "http://registry.gimp.org/node/19596")
+    (home-page "https://www.lprp.fr/gimp_plugin_en/#fourier")
     (synopsis "GIMP plug-in to edit image in fourier space")
     (description
      "This package provides a simple plug-in to apply the fourier transform on
@@ -266,7 +414,7 @@ inverse fourier transform.")
 (define-public libmypaint
   (package
     (name "libmypaint")
-    (version "1.3.0")
+    (version "1.6.1")
     (source (origin
               (method url-fetch)
               (uri (string-append "https://github.com/mypaint/libmypaint/"
@@ -274,7 +422,7 @@ inverse fourier transform.")
                                   version ".tar.xz"))
               (sha256
                (base32
-                "0wd6jk69vmhsq1mdw96v0fh7b28n3glkr5ca466zcq7agzaxj1va"))))
+                "0priwpmc7dizccqvn21ig6d649bprl3xl1hmjj7nddznjgr585vl"))))
     (build-system gnu-build-system)
     (native-inputs
      `(("intltool" ,intltool)
@@ -294,34 +442,42 @@ brushstrokes which is used by MyPaint and GIMP.")
 (define-public mypaint-brushes
   (package
     (name "mypaint-brushes")
-    (version "1.3.0")
-    (source (origin
-              (method git-fetch)
-              (uri (git-reference
-                    (url "https://github.com/Jehan/mypaint-brushes.git")
-                    (commit (string-append "v" version))))
-              (file-name (git-file-name name version))
-              (sha256
-               (base32
-                "1iz89z6v2mp8j1lrf942k561s8311i3s34ap36wh4rybb2lq15m0"))))
+    (version "2.0.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/mypaint/mypaint-brushes")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0kcqz13vzpy24dhmrx9hbs6s7hqb8y305vciznm15h277sabpmw9"))))
     (build-system gnu-build-system)
-    (arguments
-     `(#:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'relax-dependency-version
-           (lambda _
-             (substitute* "autogen.sh"
-               (("automake-1.13") "automake")
-               (("aclocal-1.13") "aclocal"))
-             #t)))))
     (native-inputs
      `(("autoconf" ,autoconf)
        ("automake" ,automake)))
     (synopsis "Default brushes for MyPaint")
     (description "This package provides the default set of brushes for
 MyPaint.")
-    (home-page "https://github.com/Jehan/mypaint-brushes")
-    (license license:cc0)))
+    (home-page "https://github.com/mypaint/mypaint-brushes/")
+    ;; Scripts are distributed under GPL2+ terms, brushes are provided as
+    ;; public domain or under CC0 terms.
+    (license (list license:gpl2+ license:cc0 license:public-domain))))
+
+(define-public mypaint-brushes-1.3
+  (package
+    (inherit mypaint-brushes)
+    (name "mypaint-brushes")
+    (version "1.3.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/mypaint/mypaint-brushes")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1c95l1vfz7sbrdlzrbz7h1p6s1k113kyjfd9wfnxlm0p6562cz3j"))))))
 
 (define-public gimp-resynthesizer
   ;; GIMP does not respect any plugin search path environment variable, so after
@@ -333,13 +489,14 @@ MyPaint.")
     (version "2.0.3")
     (source
      (origin
-       (method url-fetch)
-       (uri (string-append "https://github.com/bootchk/resynthesizer/archive/v"
-                          version ".tar.gz"))
+       (method git-fetch)
+       (uri (git-reference
+              (url "https://github.com/bootchk/resynthesizer")
+              (commit (string-append "v" version))))
        (sha256
         (base32
-         "0l3404w6rqny7h3djskxf149gzx6x4qhndgbh3403c9lbh4pi1kr"))
-       (file-name (string-append name "-" version ".tar.gz"))))
+         "1jwc8bhhm21xhrgw56nzbma6fwg59gc8anlmyns7jdiw83y0zx3j"))
+       (file-name (git-file-name name version))))
     (build-system gnu-build-system)
     (arguments
      `( ;; Turn off tests to avoid:
@@ -347,11 +504,11 @@ MyPaint.")
        #:tests? #f
        #:phases
        (modify-phases %standard-phases
-        (add-after 'unpack 'set-env
-          (lambda _
-            (setenv "CONFIG_SHELL" (which "sh"))
-            #t))
-        (add-after 'configure 'set-prefix
+         (add-after 'unpack 'set-env
+           (lambda _
+             (setenv "CONFIG_SHELL" (which "sh"))
+             #t))
+         (add-after 'configure 'set-prefix
            ;; Install plugin under $prefix, not under GIMP's libdir.
            (lambda* (#:key outputs #:allow-other-keys)
              (let ((target (string-append (assoc-ref outputs "out")
@@ -360,12 +517,14 @@ MyPaint.")
                                             (package-version gimp))
                                           ".0")))
                (substitute* (list "src/resynthesizer/Makefile"
-                                 "src/resynthesizer-gui/Makefile")
-                (("GIMP_LIBDIR = .*")
+                                  "src/resynthesizer-gui/Makefile")
+                 (("GIMP_LIBDIR = .*")
                   (string-append "GIMP_LIBDIR = " target "\n")))
                (mkdir-p target)
                #t))))))
     (native-inputs
+     ;; avoid ./autogen.sh: ./configure: /bin/sh: bad interpreter:
+     ;; No such file or directory
      `(("autoconf" ,autoconf-wrapper)
        ("automake" ,automake)
        ("glib" ,glib "bin")                       ; glib-gettextize
@@ -386,3 +545,115 @@ tools for healing selections (content-aware fill), enlarging the canvas and
 healing the border, increasing the resolution while adding detail, and
 transferring the style of an image.")
     (license license:gpl3+)))
+
+(define gegl-for-glimpse
+  ;; Remove this when GIMP commit 2cae9b9acf9da98c4c9990819ffbd5aabe23017e
+  ;; makes it into Glimpse.
+  (package
+    (inherit gegl)
+    (arguments
+     (substitute-keyword-arguments (package-arguments gegl)
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (add-after 'unpack 'refer-to-dot
+             ;; XXX Without ‘dot’ in $PATH, Glimpse would fail to start with an
+             ;; extremely obtuse ‘GEGL operation missing!’ error.
+             (lambda _
+               (substitute* "gegl/gegl-dot.c"
+                 (("\"dot ")
+                  (format #f "\"~a " (which "dot"))))
+               (substitute* "operations/common/introspect.c"
+                 (("g_find_program_in_path \\(\"dot\"\\)")
+                  (format #f "g_strdup (\"~a\")" (which "dot"))))))))))
+    (inputs
+     `(,@(package-inputs gegl)
+       ("graphviz" ,graphviz)))))
+
+(define-public glimpse
+  (package
+    (name "glimpse")
+    (version "0.2.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                     (url "https://github.com/glimpse-editor/Glimpse")
+                     (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0drngj2xqzxfaag6pc4xjffiw003n4y43x5rb5bf4ziv1ac51dm9"))))
+    (build-system gnu-build-system)
+    (outputs '("out"
+               "doc"))                            ; 9 MiB of gtk-doc HTML
+    (arguments
+     '(#:configure-flags
+       (list (string-append "--with-html-dir="
+                            (assoc-ref %outputs "doc")
+                            "/share/gtk-doc/html")
+             "--enable-gtk-doc"
+
+             ;; Prevent the build system from running 'gtk-update-icon-cache'
+             ;; which is not needed during the build because Guix runs it at
+             ;; profile creation time.
+             "ac_cv_path_GTK_UPDATE_ICON_CACHE=true"
+
+             ;; Disable automatic network request on startup to check for
+             ;; version updates.
+             "--disable-check-update"
+
+             ;; ./configure requests not to annoy upstream with packaging bugs.
+             "--with-bug-report-url=https://bugs.gnu.org/guix")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'install 'install-sitecustomize.py
+           ;; Install 'sitecustomize.py' into glimpse's python directory to
+           ;; add pygobject and pygtk to pygimp's search path.
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((pythonpath (getenv "PYTHONPATH"))
+                    (out        (assoc-ref outputs "out"))
+                    (sitecustomize.py
+                     (string-append
+                      out "/lib/glimpse/2.0/python/sitecustomize.py")))
+               (call-with-output-file sitecustomize.py
+                 (lambda (port)
+                   (format port "import site~%")
+                   (format port "for dir in '~a'.split(':'):~%" pythonpath)
+                   (format port "    site.addsitedir(dir)~%")))))))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("gtk-doc" ,gtk-doc)
+       ("intltool" ,intltool)
+       ("libtool" ,libtool)
+       ("libxslt" ,libxslt) ; for xsltproc
+       ("pkg-config" ,pkg-config)
+       ("glib:bin" ,glib "bin"))) ; for gdbus-codegen
+    (inputs
+     `(("babl" ,babl)
+       ("glib" ,glib)
+       ("glib-networking" ,glib-networking)
+       ("libtiff" ,libtiff)
+       ("libwebp" ,libwebp)
+       ("libjpeg" ,libjpeg-turbo)
+       ("atk" ,atk)
+       ("gexiv2" ,gexiv2)
+       ("gtk+" ,gtk+-2)
+       ("libmypaint" ,libmypaint)
+       ("mypaint-brushes" ,mypaint-brushes-1.3)
+       ("exif" ,libexif)                ; optional, EXIF + XMP support
+       ("lcms" ,lcms)                   ; optional, color management
+       ("librsvg" ,librsvg)             ; optional, SVG support
+       ("libxcursor" ,libxcursor)       ; optional, Mouse Cursor support
+       ("poppler" ,poppler)             ; optional, PDF support
+       ("poppler-data" ,poppler-data)
+       ("python" ,python-2)             ; optional, Python support
+       ("python2-pygtk" ,python2-pygtk) ; optional, Python support
+       ("gegl" ,gegl-for-glimpse)))     ; XXX see comment in gegl-for-glimpse
+    (home-page "https://glimpse-editor.github.io/")
+    (synopsis "Glimpse Image Editor")
+    (description "The Glimpse Image Editor is an application for image
+manipulation tasks such as photo retouching, composition and authoring.
+It supports all common image formats as well as specialized ones.  It
+features a highly customizable interface that is extensible via a plugin
+system.  It was forked from the GNU Image Manipulation Program.")
+    (license license:gpl3+)))