projects/guix·blob javascript-team · refs

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