projects/guix·blob ruby-team · refs

508 lines · 19.1 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2014, 2015, 2021 Ludovic Courtès <[email protected]>
3;;; Copyright © 2016, 2018, 2025 Ricardo Wurmus <[email protected]>
4;;; Copyright © 2016-2018, 2020, 2023 Efraim Flashner <[email protected]>
5;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <[email protected]>
6;;; Copyright © 2018 Leo Famulari <[email protected]>
7;;; Copyright © 2018 Thorsten Wilms <[email protected]>
8;;; Copyright © 2020 Marius Bakke <[email protected]>
9;;; Copyright © 2020 Michael Rohleder <[email protected]>
10;;; Copyright © 2021, 2022, 2025 Vinicius Monego <[email protected]>
11;;; Copyright © 2022 Maxim Cournoyer <[email protected]>
12;;; Copyright © 2025 Runciter <[email protected]>
13;;; Copyright © 2025 Janneke Nieuwenhuizen <[email protected]>
14;;; Copyright © 2026 Andreas Enge <[email protected]>
15;;;
16;;; This file is part of GNU Guix.
17;;;
18;;; GNU Guix is free software; you can redistribute it and/or modify it
19;;; under the terms of the GNU General Public License as published by
20;;; the Free Software Foundation; either version 3 of the License, or (at
21;;; your option) any later version.
22;;;
23;;; GNU Guix is distributed in the hope that it will be useful, but
24;;; WITHOUT ANY WARRANTY; without even the implied warranty of
25;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26;;; GNU General Public License for more details.
27;;;
28;;; You should have received a copy of the GNU General Public License
29;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
30
31(define-module (gnu packages gimp)
32 #:use-module (guix packages)
33 #:use-module (guix deprecation)
34 #:use-module (guix download)
35 #:use-module (guix gexp)
36 #:use-module (guix git-download)
37 #:use-module (guix utils)
38 #:use-module ((guix licenses) #:prefix license:)
39 #:use-module (guix build-system gnu)
40 #:use-module (guix build-system glib-or-gtk)
41 #:use-module (guix build-system meson)
42 #:use-module (gnu packages)
43 #:use-module (gnu packages algebra)
44 #:use-module (gnu packages autotools)
45 #:use-module (gnu packages backup)
46 #:use-module (gnu packages base)
47 #:use-module (gnu packages bash)
48 #:use-module (gnu packages build-tools)
49 #:use-module (gnu packages compression)
50 #:use-module (gnu packages documentation)
51 #:use-module (gnu packages fontutils)
52 #:use-module (gnu packages freedesktop)
53 #:use-module (gnu packages ghostscript)
54 #:use-module (gnu packages glib)
55 #:use-module (gnu packages gnome)
56 #:use-module (gnu packages graphics)
57 #:use-module (gnu packages graphviz)
58 #:use-module (gnu packages gtk)
59 #:use-module (gnu packages image)
60 #:use-module (gnu packages linux)
61 #:use-module (gnu packages maths)
62 #:use-module (gnu packages ncurses)
63 #:use-module (gnu packages patchutils)
64 #:use-module (gnu packages pdf)
65 #:use-module (gnu packages photo)
66 #:use-module (gnu packages pkg-config)
67 #:use-module (gnu packages python)
68 #:use-module (gnu packages sdl)
69 #:use-module (gnu packages web)
70 #:use-module (gnu packages xml)
71 #:use-module (gnu packages xorg))
72
73(define-public poly2tri-c
74 (package
75 (name "poly2tri-c")
76 (version "0.1.0")
77 (source
78 (origin
79 (method url-fetch)
80 (uri
81 (string-append "https://storage.googleapis.com/"
82 "google-code-archive-source/v2/code.google.com/"
83 "poly2tri-c/source-archive.zip"))
84 (file-name
85 (string-append name "-" version ".zip"))
86 (sha256
87 (base32 "17cw0zhbnf2gb59jm26z0wcarqgdwir9jr1fpi3v9lcvyb2s3mqj"))))
88 (build-system glib-or-gtk-build-system)
89 (outputs '("out" "doc"))
90 (arguments
91 `(#:configure-flags
92 (list
93 "--disable-static")
94 #:phases
95 (modify-phases %standard-phases
96 (add-after 'unpack 'disable-strict-rules
97 (lambda _
98 (substitute* "configure.ac"
99 (("\\$CFLAGS -Wall -ansi -pedantic")
100 "$CFLAGS")
101 (("\\$CFLAGS -Werror")
102 "$CFLAGS"))
103 #t))
104 (add-after 'disable-strict-rules 'fix-build-errors
105 (lambda _
106 (substitute* "poly2tri-c/refine/Makefile.am"
107 (("cdt.c")
108 "rcdt.c")
109 (("cdt.h")
110 "rcdt.h")
111 (("utils.c")
112 "rutils.c")
113 (("utils.h")
114 "rutils.h"))
115 #t))
116 (add-before 'bootstrap 'configure-later
117 (lambda _
118 (setenv "NOCONFIGURE" "set")
119 #t))
120 (add-after 'build 'generate-doc
121 (lambda _
122 (invoke "doxygen")
123 #t))
124 (add-after 'install 'install-doc
125 (lambda* (#:key outputs #:allow-other-keys)
126 (let* ((out (assoc-ref outputs "out"))
127 (doc (assoc-ref outputs "doc")))
128 (copy-recursively
129 "doc"
130 (string-append doc "/share/doc/poly2tri-c"))
131 #t))))))
132 (native-inputs
133 (list autoconf
134 automake
135 doxygen
136 libtool
137 pkg-config
138 unzip
139 which))
140 (propagated-inputs
141 (list glib))
142 (synopsis "2D constrained Delaunay triangulation library")
143 (description "Poly2Tri-C is a library for generating, refining and rendering
1442-Dimensional Constrained Delaunay Triangulations.")
145 (home-page "https://code.google.com/archive/p/poly2tri-c/")
146 (license license:bsd-3)))
147
148(define-public babl
149 (package
150 (name "babl")
151 (version "0.1.124")
152 (source (origin
153 (method url-fetch)
154 (uri (list (string-append "https://download.gimp.org/pub/babl/"
155 (version-major+minor version)
156 "/babl-" version ".tar.xz")
157 (string-append "https://ftp.gtk.org/pub/babl/"
158 (version-major+minor version)
159 "/babl-" version ".tar.xz")
160 (string-append "ftp://ftp.gtk.org/pub/babl/"
161 (version-major+minor version)
162 "/babl-" version ".tar.xz")))
163 (sha256
164 (base32
165 "1cgisifpxz0bhzp57x7jfg9wds6if9i24xznnnqz42glnr55838v"))))
166 (build-system meson-build-system)
167 (arguments
168 (list
169 #:configure-flags #~(list "-Dwith-docs=false")
170 #:phases
171 #~(modify-phases %standard-phases
172 #$@(if (target-aarch64?)
173 #~((add-after 'unpack 'disable-failing-test
174 (lambda _
175 (substitute* "tests/meson.build"
176 ;; float -> u8 1 failed #1[1] got 76 expected 77
177 (("'float-to-8bit',") "")))))
178 '()))))
179 (native-inputs
180 (list gobject-introspection pkg-config vala))
181 (propagated-inputs
182 ;; Propagated to satisfy ‘babl.pc’.
183 (list lcms))
184 (home-page "https://gegl.org/babl/")
185 (synopsis "Image pixel format conversion library")
186 (description
187 "Babl is a dynamic, any-to-any pixel format translation library.
188It allows converting between different methods of storing pixels, known as
189@dfn{pixel formats}, that have different bit depths and other data
190representations, color models, and component permutations.
191
192A vocabulary to formulate new pixel formats from existing primitives is
193provided, as well as a framework to add new color models and data types.")
194 (license license:lgpl3+)))
195
196(define-public gegl
197 (package
198 (name "gegl")
199 (version "0.4.68")
200 (source
201 (origin
202 (method url-fetch)
203 (uri (list (string-append "https://download.gimp.org/pub/gegl/"
204 (string-take version 3)
205 "/gegl-" version ".tar.xz")
206 (string-append "https://ftp.gtk.org/pub/gegl/"
207 (version-major+minor version)
208 "/gegl-" version ".tar.xz")
209 (string-append "ftp://ftp.gtk.org/pub/gegl/"
210 (version-major+minor version)
211 "/gegl-" version ".tar.xz")))
212 (sha256
213 (base32 "1qrsn8rllllj3673767rrs3khrym1xa62flbirjn04khkadk00jh"))))
214 (build-system meson-build-system)
215 (arguments
216 `(#:configure-flags
217 ;; TODO: properly unbundle.
218 '("--wrap-mode=nodownload")
219 #:phases
220 (modify-phases %standard-phases
221 (add-after 'unpack 'extend-test-time-outs
222 (lambda _
223 ;; Multiply some poorly-chosen time-outs for busy build machines.
224 (substitute* "tests/simple/test-node-exponential.c"
225 (("G_TIME_SPAN_SECOND" match)
226 (string-append "10 * " match)))
227 (substitute* "tests/simple/test-buffer-sharing.c"
228 (("g_timeout_add_seconds\\([0-9]+" match)
229 (string-append match "0")))
230 (substitute* (find-files "tests" "^meson\\.build$")
231 (("timeout ?: [0-9]+" match)
232 (string-append match "0"))))))))
233 ;; These are propagated to satisfy 'gegl-0.4.pc'.
234 (propagated-inputs
235 (list babl glib json-glib))
236 (inputs
237 ;; All inputs except libjpeg and libpng are optional.
238 (list cairo
239 gdk-pixbuf
240 gexiv2
241 jasper
242 libjpeg-turbo
243 libnsgif
244 libpng
245 libraw
246 (librsvg-for-system)
247 libspiro
248 libtiff
249 libwebp
250 maxflow
251 openexr
252 pango
253 poppler
254 sdl2))
255 (native-inputs
256 (list `(,glib "bin") ; for gtester
257 gobject-introspection
258 intltool
259 pkg-config
260 vala))
261 (home-page "https://gegl.org")
262 (synopsis "Graph based image processing framework")
263 (description "GEGL (Generic Graphics Library) provides infrastructure to
264do demand based cached non destructive image editing on larger than RAM
265buffers.")
266 ;; The library itself is licensed under LGPL while the sample commandline
267 ;; application and GUI binary gegl is licensed under GPL.
268 (license (list license:lgpl3+ license:gpl3+))))
269
270(define-public gimp
271 (package
272 (name "gimp")
273 (version "3.2.0")
274 (source
275 (origin
276 (method url-fetch)
277 (uri (string-append "https://download.gimp.org/pub/gimp/v"
278 (version-major+minor version)
279 "/gimp-" version ".tar.xz"))
280 (sha256
281 (base32 "10z0n9shpqwny6hkwdin7nmp5vb0707gk7nzjg3f66z52qa3j616"))))
282 (build-system meson-build-system)
283 (outputs '("out" "doc"))
284 (arguments
285 (list #:modules `((ice-9 popen)
286 (ice-9 rdelim)
287 (guix build meson-build-system)
288 (guix build utils))
289 ;; Test tries to connect to the internet and fails.
290 #:test-options #~(list "--no-suite=desktop")
291 #:phases
292 #~(modify-phases %standard-phases
293 (add-after 'unpack 'remove-gcc-reference
294 ;; Avoid reference to GCC.
295 (lambda _
296 (let* ((port (open-input-pipe "gcc -v 2>&1 | tail -n 1"))
297 (cc-version (read-line port)))
298 (close-pipe port)
299 (substitute* "app/gimp-version.c"
300 (("CC_VERSION") (string-append "\"" cc-version "\""))))))
301 (add-after 'install 'move-doc
302 (lambda _
303 (mkdir-p (string-append #$output:doc "/share"))
304 (rename-file (string-append #$output "/share/doc")
305 (string-append #$output:doc "/share/doc"))))
306 (add-after 'install 'wrap
307 (lambda* _
308 (for-each
309 (lambda (prog)
310 (wrap-program prog
311 ;; Ensure GI_TYPELIB_PATH is not suffixed to the
312 ;; environment, as it could cause Gimp to crash (see
313 ;; bug#77921).
314 `("GI_TYPELIB_PATH" prefix
315 (,(getenv "GI_TYPELIB_PATH")
316 ,(string-append #$output "/lib/girepository-1.0")))
317 `("GUIX_PYTHONPATH" prefix
318 (,(getenv "GUIX_PYTHONPATH")))
319 `("GDK_PIXBUF_MODULE_FILE" =
320 (,(getenv "GDK_PIXBUF_MODULE_FILE")))
321 `("XDG_DATA_DIRS" prefix
322 (,(string-append #$(this-package-input "gtk+")
323 "/share")
324 ,(string-append #$(this-package-native-input
325 "shared-mime-info")
326 "/share")))))
327 (find-files (string-append #$output "/bin")
328 (lambda (_ stat)
329 (eq? 'regular (stat:type stat))))))))))
330 (inputs
331 (list appstream
332 bash-minimal
333 libjxl
334 libxmu
335 libxt
336 python
337 python-pygobject-3.50
338 gjs
339 libxslt
340 xdg-utils
341 at-spi2-core
342 babl
343 gegl
344 gexiv2-0.14
345 glib
346 glib-networking
347 gtk+
348 libjpeg-turbo
349 libmypaint
350 libtiff
351 libwebp
352 mypaint-brushes
353 libexif ;optional, EXIF + XMP support
354 ghostscript ;optional, EPS + PS support
355 lcms ;optional, color management
356 libheif ;optional, HEIF + AVIF support
357 libmng ;optional, MNG support
358 libxpm ;optional, XPM support
359 (librsvg-for-system) ;optional, SVG support
360 libxcursor ;optional, Mouse Cursor support
361 openexr ;optional, EXR support
362 openjpeg ;optional, JPEG 2000 support
363 poppler ;optional, PDF support
364 poppler-data)) ;optional, PDF support
365 (native-inputs
366 (list appstream-glib
367 gi-docgen
368 libarchive
369 shared-mime-info
370 desktop-file-utils
371 `(,glib "bin") ;for glib-compile-resources and gdbus-codegen
372 intltool
373 pkg-config))
374 (home-page "https://www.gimp.org")
375 (synopsis "GNU Image Manipulation Program")
376 ;; CVE-2025-8672 concerns the Python bundled with GIMP < 3.1.4.2 on MacOS.
377 (properties '((lint-hidden-cve . (list "CVE-2025-8672"))))
378 (description
379 "GIMP is an application for image manipulation tasks such as photo
380retouching, composition and authoring. It supports all common image formats
381as well as specialized ones. It features a highly customizable interface
382that is extensible via a plugin system.")
383 (license license:gpl3+))) ; some files are lgplv3
384
385;; 2026-05-20
386(define-deprecated/public-alias gimp-3 gimp)
387
388(define-public libmypaint
389 (package
390 (name "libmypaint")
391 (version "1.6.1")
392 (source
393 (origin
394 (method git-fetch)
395 (uri (git-reference
396 (url "https://github.com/mypaint/libmypaint")
397 (commit (string-append "v" version))))
398 (file-name (git-file-name name version))
399 (sha256
400 (base32 "1ppgpmnhph9h8ayx9776f79a0bxbdszfw9c6bw7c3ffy2yk40178"))))
401 (build-system gnu-build-system)
402 (arguments
403 (list
404 #:phases
405 #~(modify-phases %standard-phases
406 (add-before 'bootstrap 'overwrite-automake-and-aclocal-versions
407 (lambda _
408 (setenv "AUTOMAKE" "automake")
409 (setenv "ACLOCAL" "aclocal"))))))
410 (native-inputs
411 (list autoconf
412 automake
413 intltool
414 libtool
415 pkg-config
416 python))
417 ;; As needed by 'libmypaint.pc'.
418 (propagated-inputs
419 (list json-c gobject-introspection))
420 (inputs
421 (list glib))
422 (synopsis "Artistic brushes library")
423 (description "Libmypaint, also called \"brushlib\", is a library for making
424brushstrokes which is used by MyPaint and GIMP.")
425 (home-page "http://mypaint.org")
426 (license license:isc)))
427
428;; To update mypaint, remove when a fresh version is released.
429(define-public libmypaint-next
430 (package
431 (inherit libmypaint)
432 (name "libmypaint")
433 (properties '((commit . "551dfb9ca5d2b82f2361a5a8a9e7f386f35fd320")
434 (revision . "0")))
435 (version (git-version "1.6.1"
436 (assoc-ref properties 'revision)
437 (assoc-ref properties 'commit)))
438 (source
439 (origin
440 (method git-fetch)
441 (uri (git-reference
442 (url "https://github.com/mypaint/libmypaint")
443 (commit (assoc-ref properties 'commit))))
444 (file-name (git-file-name name version))
445 (sha256
446 (base32 "0pl8cma6gfkrqx364fs1xw7f491f7y6pzxqjq1cdqlrf9r8gg0sk"))))))
447
448(define-public mypaint-brushes
449 (package
450 (name "mypaint-brushes")
451 (version "2.0.2")
452 (source
453 (origin
454 (method git-fetch)
455 (uri (git-reference
456 (url "https://github.com/mypaint/mypaint-brushes")
457 (commit (string-append "v" version))))
458 (file-name (git-file-name name version))
459 (sha256
460 (base32 "0kcqz13vzpy24dhmrx9hbs6s7hqb8y305vciznm15h277sabpmw9"))))
461 (build-system gnu-build-system)
462 (native-inputs
463 (list autoconf automake))
464 (synopsis "Default brushes for MyPaint")
465 (description "This package provides the default set of brushes for
466MyPaint.")
467 (home-page "https://github.com/mypaint/mypaint-brushes/")
468 ;; Scripts are distributed under GPL2+ terms, brushes are provided as
469 ;; public domain or under CC0 terms.
470 (license (list license:gpl2+ license:cc0 license:public-domain))))
471
472(define-public gimp-resynthesizer
473 ;; GIMP does not respect any plugin search path environment variable, so after
474 ;; installation users have to edit their GIMP settings to include
475 ;; "$HOME/.guix-profile/lib/gimp/2.0/plug-ins/" in
476 ;; “Edit->Preferences->Folders->Plug Ins”.
477 (package
478 (name "gimp-resynthesizer")
479 (version "3.0")
480 (source
481 (origin
482 (method git-fetch)
483 (uri (git-reference
484 (url "https://github.com/bootchk/resynthesizer")
485 (commit (string-append "v" version))))
486 (sha256
487 (base32
488 "1w0mp8bpwlk6p2gwg9zqvckzyfc16djgmzjc8x9zp2biai3vkz7w"))
489 (file-name (git-file-name name version))))
490 (build-system meson-build-system)
491 (native-inputs
492 (list pkg-config))
493 (inputs
494 (list cairo
495 gdk-pixbuf
496 gegl
497 gexiv2-0.14
498 gimp
499 gtk+
500 pango))
501 (home-page "https://github.com/bootchk/resynthesizer")
502 (synopsis "GIMP plugins for texture synthesis")
503 (description
504 "This package provides resynthesizer plugins for GIMP, which encompasses
505tools for healing selections (content-aware fill), enlarging the canvas and
506healing the border, increasing the resolution while adding detail, and
507transferring the style of an image.")
508 (license license:gpl3+)))