Merge branch 'staging' into core-updates
[jackhill/guix/guix.git] / gnu / packages / inkscape.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014 John Darrington <jmd@gnu.org>
3 ;;; Copyright © 2014, 2016 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2016, 2018 Ricardo Wurmus <rekado@elephly.net>
5 ;;; Copyright © 2017, 2020 Marius Bakke <mbakke@fastmail.com>
6 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
7 ;;;
8 ;;; This file is part of GNU Guix.
9 ;;;
10 ;;; GNU Guix is free software; you can redistribute it and/or modify it
11 ;;; under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 3 of the License, or (at
13 ;;; your option) any later version.
14 ;;;
15 ;;; GNU Guix is distributed in the hope that it will be useful, but
16 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;;; GNU General Public License for more details.
19 ;;;
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22
23 (define-module (gnu packages inkscape)
24 #:use-module ((guix licenses) #:prefix license:)
25 #:use-module (guix packages)
26 #:use-module (guix download)
27 #:use-module (guix utils)
28 #:use-module (guix build-system cmake)
29 #:use-module (gnu packages)
30 #:use-module (gnu packages aspell)
31 #:use-module (gnu packages bdw-gc)
32 #:use-module (gnu packages boost)
33 #:use-module (gnu packages glib)
34 #:use-module (gnu packages gtk)
35 #:use-module (gnu packages maths)
36 #:use-module (gnu packages perl)
37 #:use-module (gnu packages pdf)
38 #:use-module (gnu packages popt)
39 #:use-module (gnu packages python)
40 #:use-module (gnu packages xml)
41 #:use-module (gnu packages ghostscript)
42 #:use-module (gnu packages fontutils)
43 #:use-module (gnu packages image)
44 #:use-module (gnu packages pkg-config))
45
46 (define-public inkscape
47 (package
48 (name "inkscape")
49 (version "0.92.4")
50 (source (origin
51 (method url-fetch)
52 (uri (string-append "https://media.inkscape.org/dl/"
53 "resources/file/"
54 "inkscape-" version ".tar.bz2"))
55 (patches (search-patches "inkscape-poppler-0.76.patch"))
56 (sha256
57 (base32
58 "0pjinhjibfsz1aywdpgpj3k23xrsszpj4a1ya5562dkv2yl2vv2p"))))
59 (build-system cmake-build-system)
60 (inputs
61 `(("aspell" ,aspell)
62 ("gtkmm" ,gtkmm-2)
63 ("gtk" ,gtk+-2)
64 ("gsl" ,gsl)
65 ("poppler" ,poppler)
66 ("libpng" ,libpng)
67 ("libxml2" ,libxml2)
68 ("libxslt" ,libxslt)
69 ("libgc" ,libgc)
70 ("freetype" ,freetype)
71 ("popt" ,popt)
72 ("potrace" ,potrace)
73 ("python" ,python-2)
74 ("lcms" ,lcms)
75 ("boost" ,boost)))
76 (native-inputs
77 `(("intltool" ,intltool)
78 ("glib" ,glib "bin")
79 ("perl" ,perl)
80 ("pkg-config" ,pkg-config)))
81 ;; FIXME: tests require gmock
82 (arguments
83 `(#:tests? #f
84 #:phases
85 (modify-phases %standard-phases
86 (add-after 'unpack 'patch-icon-cache-generator
87 (lambda _
88 (substitute* "share/icons/application/CMakeLists.txt"
89 (("gtk-update-icon-cache") "true"))
90 #t))
91 (add-after 'unpack 'adjust-for-new-poppler
92 (lambda _
93 (substitute* (find-files "src/extension/internal/pdfinput")
94 ;; Needed for Poppler 0.82.
95 (("Unicode \\*u") "Unicode const *u")
96 ;; Needed for Poppler 0.83.
97 (("\\(GfxPath") "(const GfxPath")
98 (("GfxSubpath") "const GfxSubpath")
99 (("new GlobalParams\\(\\)")
100 "std::unique_ptr<GlobalParams>(new GlobalParams())")
101 (("new GlobalParams\\(poppler_datadir\\)")
102 "std::unique_ptr<GlobalParams>(new GlobalParams(poppler_datadir))"))
103 #t))
104 (add-before 'configure 'dont-use-system-includes
105 (lambda _
106 ;; Don't add redundant -isystem includes which confuses GCC7.
107 (substitute* "CMakeScripts/DefineDependsandFlags.cmake"
108 (("include_directories\\(SYSTEM")
109 "include_directories("))
110 #t)))))
111 (home-page "https://inkscape.org/")
112 (synopsis "Vector graphics editor")
113 (description "Inkscape is a vector graphics editor. What sets Inkscape
114 apart is its use of Scalable Vector Graphics (SVG), an XML-based W3C standard,
115 as the native format.")
116 (license license:gpl2+)))