Subject: [PATCH] gnu: Add the Glimpse Image Editor.

From: Leo Famulari <[email-masked]>
Date: Thu, 3 Dec 2020 15:13:12 -0500

* gnu/packages/gimp.scm (glimpse): New variable.
---
 gnu/packages/gimp.scm | 91 ++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 90 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/gimp.scm b/gnu/packages/gimp.scm
index c0c66e52f5..a47de30ae4 100644
--- a/gnu/packages/gimp.scm
+++ b/gnu/packages/gimp.scm
@@ -3,7 +3,7 @@
 ;;; Copyright © 2016, 2018 Ricardo Wurmus <[email-masked]>
 ;;; Copyright © 2016, 2017, 2018, 2020 Efraim Flashner <[email-masked]>
 ;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <[email-masked]>
-;;; Copyright © 2018 Leo Famulari <[email-masked]>
+;;; Copyright © 2018, 2020 Leo Famulari <[email-masked]>
 ;;; Copyright © 2018 Thorsten Wilms <[email-masked]>
 ;;; Copyright © 2020 Marius Bakke <[email-masked]>
 ;;; Copyright © 2020 Michael Rohleder <[email-masked]>
@@ -538,3 +538,92 @@ 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-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-wrapper)
+       ("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)))
+    (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+)))
-- 
2.29.2