;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2014, 2015 Ludovic Courtès ;;; Copyright © 2016, 2018 Ricardo Wurmus ;;; Copyright © 2016, 2017, 2018, 2020 Efraim Flashner ;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice ;;; Copyright © 2018, 2020 Leo Famulari ;;; Copyright © 2018 Thorsten Wilms ;;; Copyright © 2020 Marius Bakke ;;; Copyright © 2020 Michael Rohleder ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Guix is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix. If not, see . (define-module (gnu packages gimp) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix git-download) #:use-module (guix utils) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix build-system gnu) #:use-module (guix build-system glib-or-gtk) #:use-module (guix build-system meson) #:use-module (gnu packages) #:use-module (gnu packages algebra) #:use-module (gnu packages autotools) #:use-module (gnu packages base) #:use-module (gnu packages documentation) #: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.78") (source (origin (method url-fetch) (uri (list (string-append "https://download.gimp.org/pub/babl/" (version-major+minor version) "/babl-" version ".tar.xz") (string-append "https://ftp.gtk.org/pub/babl/" (version-major+minor version) "/babl-" version ".tar.xz") (string-append "ftp://ftp.gtk.org/pub/babl/" (version-major+minor version) "/babl-" version ".tar.xz"))) (sha256 (base32 "0fjjfb0pbgimlqi7rk8cqz8pq595b7gw8nrpkxfmixdz6cv4km8p")))) (build-system meson-build-system) (arguments `(#:configure-flags (list "-Denable-gir=false"))) (native-inputs `(("pkg-config" ,pkg-config))) (propagated-inputs ;; Propagated to satisfy ‘babl.pc’. `(("lcms" ,lcms))) (home-page "https://gegl.org/babl/") (synopsis "Image pixel format conversion library") (description "Babl is a dynamic, any-to-any pixel format translation library. It allows converting between different methods of storing pixels, known as @dfn{pixel formats}, that have different bit depths and other data representations, color models, and component permutations. A vocabulary to formulate new pixel formats from existing primitives is provided, as well as a framework to add new color models and data types.") (license license:lgpl3+))) (define-public gegl (package (name "gegl") (version "0.4.26") (source (origin (method url-fetch) (uri (list (string-append "https://download.gimp.org/pub/gegl/" (string-take version 3) "/gegl-" version ".tar.xz") (string-append "https://ftp.gtk.org/pub/gegl/" (version-major+minor version) "/gegl-" version ".tar.xz") (string-append "ftp://ftp.gtk.org/pub/gegl/" (version-major+minor version) "/gegl-" version ".tar.xz"))) (sha256 (base32 "097427icgpgvcx40019b3dm8m84cchz79pixzpz648drs8p1wdqg")))) (build-system meson-build-system) (arguments `(#: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) ("glib" ,glib) ("json-glib" ,json-glib))) (inputs `(("cairo" ,cairo) ("pango" ,pango) ("libpng" ,libpng) ("libjpeg" ,libjpeg-turbo))) (native-inputs `(("pkg-config" ,pkg-config) ("glib" ,glib "bin") ; for gtester ("intltool" ,intltool))) (home-page "http://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 buffers.") ;; The library itself is licensed under LGPL while the sample commandline ;; application and GUI binary gegl is licensed under GPL. (license (list license:lgpl3+ license:gpl3+)))) (define-public gimp (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")))) (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") ;; 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 gimp'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/gimp/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)~%"))))))))) (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))) (native-inputs `(("glib:bin" ,glib "bin") ; for glib-compile-resources and gdbus-codegen ("pkg-config" ,pkg-config) ("intltool" ,intltool))) (home-page "https://www.gimp.org") (synopsis "GNU Image Manipulation Program") (description "GIMP 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.") (license license:gpl3+))) ; some files are lgplv3 (define-public gimp-fourier (package (name "gimp-fourier") (version "0.4.3-2") (source (origin (method url-fetch) (uri (string-append "http://registry.gimp.org/files/fourier-" version ".tar.gz")) (sha256 (base32 "1rpacyad678lqgxa3hh2n0zpg4azs8dpa8q079bqsl12812k9184")))) (build-system gnu-build-system) (arguments `(#:tests? #f ;no tests #:phases (modify-phases %standard-phases ;; FIXME: The gegl package only installs "gegl-0.4.pc", but ;; "gimp-2.0.pc" requires "gegl-0.3.pc", so we just copy it. (replace 'configure (lambda* (#:key inputs #:allow-other-keys) (mkdir-p "tmppkgconfig") (copy-file (string-append (assoc-ref inputs "gegl") "/lib/pkgconfig/gegl-0.4.pc") "tmppkgconfig/gegl-0.3.pc") (setenv "PKG_CONFIG_PATH" (string-append "tmppkgconfig:" (or (getenv "PKG_CONFIG_PATH") ""))) #t)) (add-after 'unpack 'set-prefix (lambda* (#:key outputs #:allow-other-keys) ;; gimptool-2.0 does not allow us to install to any target ;; directory. (let ((target (string-append (assoc-ref outputs "out") "/lib/gimp/" (car (string-split ,(package-version gimp) #\.)) ".0/plug-ins"))) (substitute* "Makefile" (("\\$\\(PLUGIN_INSTALL\\) fourier") (string-append "cp fourier " target))) (mkdir-p target)) #t))))) (inputs `(("fftw" ,fftw) ("gimp" ,gimp) ;; needed by gimpuot;) "/share/fontconfig/conf.avail"))) (copy-recursively "fontconfig" conf-dir) #t)))))) (home-page "https://dejavu-fonts.github.io/") (synopsis "Vera font family derivate with additional characters") (description "DejaVu provides an expanded version of the Vera font family aiming for quality and broader Unicode coverage while retaining the original Vera style. DejaVu currently works towards conformance to the Multilingual European Standards (MES-1 and MES-2) for Unicode coverage. The DejaVu fonts provide serif, sans and monospaced variants.") (license (license:x11-style "http://dejavu-fonts.org/")))) (define-public font-bitstream-vera (package (name "font-bitstream-vera") (version "1.10") (source (origin (method url-fetch) (uri (string-append "mirror://gnome/sources/ttf-bitstream-vera/" version "/ttf-bitstream-vera-" version ".tar.bz2")) (sha256 (base32 "1p3qs51x5327gnk71yq8cvmxc6wgx79sqxfvxcv80cdvgggjfnyv")))) (build-system font-build-system) (home-page "https://www.gnome.org/fonts/") (synopsis "Bitstream Vera sans-serif typeface") (description "Vera is a sans-serif typeface from Bitstream, Inc. This package provides the TrueType (TTF) files.") (license (license:fsdg-compatible "https://www.gnome.org/fonts/#Final_Bitstream_Vera_Fonts" "The Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself.")))) (define-public font-canada1500 (package (name "font-canada1500") (version "1.101") (source (origin (method url-fetch/zipbomb) (uri "https://typodermicfonts.com/wp-content/uploads/2017/06/canada1500.zip") (sha256 (base32 "0cdcb89ab6q7b6jd898bnvrd1sifbd2xr42qgji98h8d5cq4b6fp")))) (build-system font-build-system) (arguments '(#:license-file-regexp "^license.pdf$")) (outputs '("out" "ttf")) (home-page "https://typodermicfonts.com/canada1500/") (synopsis "Canadian typeface that supports English, French and Aboriginal languages") (description "Canada1500 is a display typeface originally created for the Canadian sesquicentennial with four weights, italics and space symbols which includes lining and old-style numerals, tabular and proportional. Greek, Cyrillic, Canadian Syllabics and most Latin based languages are supported.") (license license:cc0))) (define-public font-abattis-cantarell ;; Use the latest commit, as the last released version, 0.303, has problems ;; with the newer statmake. The dependency has been removed in the latest ;; code base. (let ((commit "e049149faf0c15b0711e8d790e2333be923f0486") (revision "0")) (package (name "font-abattis-cantarell") (version (git-version "0.303" revision commit)) (source (origin (method git-fetch) (uri (git-reference (url "https://gitlab.gnome.org/GNOME/cantarell-fonts") (commit commit))) (file-name (git-file-name name version)) (sha256 (base32 "032csq99bkmmgh9mmmbrgg4fzxgkcsvxv4wy595qms72mmlgmcc7")))) (build-system meson-build-system) (arguments (list #:configure-flags #~(list "-Dbuildstatics=true"))) (native-inputs (list gettext-minimal psautohint python python-cffsubr python-fontmath python-ufo2ft)) (home-page "https://wiki.gnome.org/Projects/CantarellFonts") (synopsis "Cantarell sans-serif typeface") (description "The Cantarell font family is a contemporary Humanist sans-serif designed for on-screen reading. It is used by GNOME@tie{}3. This package contains both the non-variable as well as the variable versions of the font.") (license license:silofl1.1)))) (define-public font-atkinson-hyperlegible (let ((commit "1cb311624b2ddf88e9e37873999d165a8cd28b46") (revision "0")) (package (name "font-atkinson-hyperlegible") (version (git-version "0.0.0" revision commit)) (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/googlefonts/atkinson-hyperlegible") (commit commit))) (file-name (git-file-name name version)) (sha256 (base32 "1qw0pr1dhmqrgmw1acyw8dv8kbm66xa1bq0mrn7yin4q1kk2dpj4")))) (build-system font-build-system) (home-page "https://github.com/googlefonts/atkinson-hyperlegible") (synopsis "Typeface with greater legibility and readability for low vision readers") (description "Atkinson Hyperlegible is a freely available typeface built around a grotesque sans-serif core, intended to be optimally legible for readers who are partially visually impaired, with all characters maximally distinguishable from one another.") (license license:silofl1.1)))) (define-public font-lato (package (name "font-lato") (version "2.015") ; also update description (source (origin (method url-fetch) (uri (string-append "https://www.latofonts.com/download/Lato2OFL.zip")) (sha256 (base32 "1f5540g0ja1nx3ddd3ywn77xc81ssrxpq8n3gyb9sabyq2b4xda2")))) (build-system font-build-system) (home-page "https://www.latofonts.com/lato-free-fonts/") (synopsis "Lato sans-serif typeface") (description "Lato is a sanserif typeface family. It covers over 3000 glyphs per style. The Lato 2.010 family supports more than 100 Latin-based languages, over 50 Cyrillic-based languages as well as Greek and IPA phonetics.") (license license:silofl1.1))) (define-public font-carlito (let ((commit "64cab86c9b602088697294736b86f2831f3f44be") (revision "0")) (package (name "font-carlito") (version (git-version "0.0.0" revision commit)) (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/googlefonts/carlito") (commit commit))) (file-name (git-file-name name version)) (sha256 (base32 "02wy8vs5m4whm5apl3p6cpz0qa9jwjj9qi219zjspiszha2ivssz")))) (build-system font-build-system) (home-page "https://github.com/googlefonts/carlito") (synopsis "Free alternative to Calibri") (description "Carlito is a font designed by Łukasz Dziedzic derived from Lato (also designed by Łukasz Dziedzic) that is metric-compatible with Calibri.") (license license:silofl1.1)))) (define-public font-gfs-ambrosia ;; Based on ;; https://src.fedoraproject.org/rpms/gfs-ambrosia-fonts ;; /blob/rawhide/f/gfs-ambrosia-fonts.spec. (package (name "font-gfs-ambrosia") (version "20080624") (source (origin (method url-fetch) (uri (string-append "https://www.greekfontsociety-gfs.gr/" "_assets/fonts/GFS_Ambrosia.zip")) (sha256 (base32 "0vnnsal61slgj9r4q35wiznd4mbcv49dl18n91s3nvv6jzd4r8b4")))) (build-system font-build-system) (home-page "https://www.greekfontsociety-gfs.gr/") (synopsis "GFS Ambrosia, a Greek majuscule font family") (description "GFS Ambrosia is a Greek typeface that has the main characteristics of the majuscule forms of the early Christian tradition. The font is provided in the OpenType font (OTF) format.") (license license:silofl1.1))) (define-public font-gnu-freefont (package (name "font-gnu-freefont") (version "20120503") (source (origin (method url-fetch) (uri (string-append "mirror://gnu/freefont/freefont-src-" version ".tar.gz")) (sha256 (base32 "0yk58blhcd4hm7nyincmqq4jrzjjk82wif2zmk1l3y2m4vif4qhd")) (patches (search-patches "font-gnu-freefont-python3-compat.patch")) (snippet '(begin (delete-file "tools/generate/buildutils.pyc"))))) (build-system gnu-build-system) (arguments `(#:phases (modify-phases %standard-phases (delete 'configure) (replace 'install (lambda _ (let ((doc-dir (string-append %output "/share/doc/" ,name "-" ,version)) (ttf-font-dir (string-append %output "/share/fonts/truetype&quo