From aae012e91e66e3edcc486db7bd4939fb34ed3b24 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Mon, 29 Mar 2021 23:51:04 +0200 Subject: gnu: gimp: Properly handle missing optional ‘dot’. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/gimp.scm (gimp)[source]: Add a patch to fix a fatal error when ‘dot’ is not in $PATH. (gegl)[arguments]: Move the 'refer-to-dot phase... [inputs]: ...and graphviz... (gegl-for-glimpse)[arguments]: ...here, and... [inputs]: ...here, respectively. (glimpse)[inputs]: Use gegl-for-glimpse gegl variant. --- gnu/packages/gimp.scm | 63 +++++++++++++++++++++++++++++++++++---------------- 1 file changed, 43 insertions(+), 20 deletions(-) (limited to 'gnu/packages/gimp.scm') diff --git a/gnu/packages/gimp.scm b/gnu/packages/gimp.scm index 86b42e0fab..a0f6b7ca11 100644 --- a/gnu/packages/gimp.scm +++ b/gnu/packages/gimp.scm @@ -230,16 +230,6 @@ provided, as well as a framework to add new color models and data types.") (list "-Dintrospection=false") #:phases (modify-phases %standard-phases - (add-after 'unpack 'refer-to-dot - ;; Without ‘dot’ in $PATH, (at least) the GIMP 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")))))) (add-after 'unpack 'extend-test-time-outs (lambda _ ;; Multiply some poorly-chosen time-outs for busy build machines. @@ -260,7 +250,6 @@ provided, as well as a framework to add new color models and data types.") ("json-glib" ,json-glib))) (inputs `(("cairo" ,cairo) - ("graphviz" ,graphviz) ("pango" ,pango) ("libpng" ,libpng) ("libjpeg" ,libjpeg-turbo))) @@ -281,14 +270,25 @@ buffers.") (package (name "gimp") (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")))) + (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 + (list (origin + ;; This upstream patch fixes a mandatory dependency on ‘dot’: + ;; . + (method url-fetch) + (uri (string-append "https://github.com/GNOME/gimp/commit/" + "2cae9b9acf9da98c4c9990819ffbd5aabe23017e" + ".patch")) + (sha256 + (base32 + "1xd5lmy1j9p6p1ka7dyj1b9jmfcra1r62rma07vzw2v4vig0khc0"))))))) (build-system gnu-build-system) (outputs '("out" "doc")) ; 9 MiB of gtk-doc HTML @@ -556,6 +556,29 @@ 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") @@ -635,7 +658,7 @@ transferring the style of an image.") ("poppler-data" ,poppler-data) ("python" ,python-2) ; optional, Python support ("python2-pygtk" ,python2-pygtk) ; optional, Python support - ("gegl" ,gegl))) + ("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 -- cgit v1.2.3