Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / webkit.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
3 ;;; Copyright © 2015 David Hashe <david.hashe@dhashe.com>
4 ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
5 ;;; Copyright © 2015, 2016, 2017, 2018 Mark H Weaver <mhw@netris.org>
6 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
7 ;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz>
8 ;;;
9 ;;; This file is part of GNU Guix.
10 ;;;
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
12 ;;; under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 3 of the License, or (at
14 ;;; your option) any later version.
15 ;;;
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
17 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
20 ;;;
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23
24 (define-module (gnu packages webkit)
25 #:use-module ((guix licenses) #:prefix license:)
26 #:use-module (guix packages)
27 #:use-module (guix download)
28 #:use-module (guix utils)
29 #:use-module (guix build-system cmake)
30 #:use-module (guix build-system gnu)
31 #:use-module (gnu packages)
32 #:use-module (gnu packages base)
33 #:use-module (gnu packages bison)
34 #:use-module (gnu packages docbook)
35 #:use-module (gnu packages enchant)
36 #:use-module (gnu packages flex)
37 #:use-module (gnu packages gcc)
38 #:use-module (gnu packages gettext)
39 #:use-module (gnu packages gl)
40 #:use-module (gnu packages glib)
41 #:use-module (gnu packages gnome)
42 #:use-module (gnu packages gnupg)
43 #:use-module (gnu packages gperf)
44 #:use-module (gnu packages gstreamer)
45 #:use-module (gnu packages gtk)
46 #:use-module (gnu packages icu4c)
47 #:use-module (gnu packages image)
48 #:use-module (gnu packages libreoffice)
49 #:use-module (gnu packages perl)
50 #:use-module (gnu packages pkg-config)
51 #:use-module (gnu packages python)
52 #:use-module (gnu packages ruby)
53 #:use-module (gnu packages sqlite)
54 #:use-module (gnu packages tls)
55 #:use-module (gnu packages video)
56 #:use-module (gnu packages xml)
57 #:use-module (gnu packages xorg))
58
59 (define-public webkitgtk
60 (package
61 (name "webkitgtk")
62 (version "2.24.3")
63 (source (origin
64 (method url-fetch)
65 (uri (string-append "https://www.webkitgtk.org/releases/"
66 name "-" version ".tar.xz"))
67 (sha256
68 (base32
69 "0lbcrw5axwrbrajxq7fqywfyh0djqi23ynzb5wi5ghw2grnp83cl"))))
70 (build-system cmake-build-system)
71 (outputs '("out" "doc"))
72 (arguments
73 '(#:tests? #f ; no tests
74 #:build-type "Release" ; turn off debugging symbols to save space
75 #:configure-flags (list
76 "-DPORT=GTK"
77 "-DENABLE_GTKDOC=ON" ; No doc by default
78 (string-append ; uses lib64 by default
79 "-DLIB_INSTALL_DIR="
80 (assoc-ref %outputs "out") "/lib")
81
82 ;; XXX Adding GStreamer GL support would apparently
83 ;; require adding gst-plugins-bad to the inputs,
84 ;; which might entail a security risk as a result of
85 ;; the plugins of dubious code quality that are
86 ;; included. More investigation is needed. For
87 ;; now, we explicitly disable it to prevent an error
88 ;; at configuration time.
89 "-DUSE_GSTREAMER_GL=OFF"
90
91 ;; XXX Disable WOFF2 ‘web fonts’. These were never
92 ;; supported in our previous builds. Enabling them
93 ;; requires building libwoff2 and possibly woff2dec.
94 "-DUSE_WOFF2=OFF")
95 #:phases
96 (modify-phases %standard-phases
97 (add-after 'unpack 'patch-gtk-doc-scan
98 (lambda* (#:key inputs #:allow-other-keys)
99 (for-each (lambda (file)
100 (substitute* file
101 (("http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd")
102 (string-append (assoc-ref inputs "docbook-xml")
103 "/xml/dtd/docbook/docbookx.dtd"))))
104 (find-files "Source" "\\.sgml$"))
105 #t))
106 (add-after 'install 'move-doc-files
107 (lambda* (#:key outputs #:allow-other-keys)
108 (let ((out (assoc-ref outputs "out"))
109 (doc (assoc-ref outputs "doc")))
110 (mkdir-p (string-append doc "/share"))
111 (rename-file (string-append out "/share/gtk-doc")
112 (string-append doc "/share/gtk-doc"))
113 #t))))))
114 (native-inputs
115 `(("bison" ,bison)
116 ("gettext" ,gettext-minimal)
117 ("glib:bin" ,glib "bin") ; for glib-mkenums, etc.
118 ("gobject-introspection" ,gobject-introspection)
119 ("gperf" ,gperf)
120 ("perl" ,perl)
121 ("pkg-config" ,pkg-config)
122 ("python" ,python-wrapper)
123 ("gtk-doc" ,gtk-doc) ; For documentation generation
124 ("docbook-xml" ,docbook-xml) ; For documentation generation
125 ("ruby" ,ruby)))
126 (propagated-inputs
127 `(("gtk+" ,gtk+)
128 ("libsoup" ,libsoup)))
129 (inputs
130 `(("at-spi2-core" ,at-spi2-core)
131 ("enchant" ,enchant)
132 ("geoclue" ,geoclue)
133 ("gst-plugins-base" ,gst-plugins-base)
134 ("gtk+-2" ,gtk+-2)
135 ("harfbuzz" ,harfbuzz)
136 ("hyphen" ,hyphen)
137 ("icu4c" ,icu4c)
138 ("libgcrypt" ,libgcrypt)
139 ("libjpeg" ,libjpeg)
140 ("libnotify" ,libnotify)
141 ("libpng" ,libpng)
142 ("libsecret" ,libsecret)
143 ("libtasn1" ,libtasn1)
144 ("libwebp" ,libwebp)
145 ("libxcomposite" ,libxcomposite)
146 ("libxml2" ,libxml2)
147 ("libxslt" ,libxslt)
148 ("libxt" ,libxt)
149 ("mesa" ,mesa)
150 ("openjpeg" ,openjpeg)
151 ("sqlite" ,sqlite)))
152 (home-page "https://www.webkitgtk.org/")
153 (synopsis "Web content engine for GTK+")
154 (description
155 "WebKitGTK+ is a full-featured port of the WebKit rendering engine,
156 suitable for projects requiring any kind of web integration, from hybrid
157 HTML/CSS applications to full-fledged web browsers.")
158 ;; WebKit's JavaScriptCore and WebCore components are available under
159 ;; the GNU LGPL, while the rest is available under a BSD-style license.
160 (license (list license:lgpl2.0
161 license:lgpl2.1+
162 license:bsd-2
163 license:bsd-3))))