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, 2019, 2020 Mark H Weaver <mhw@netris.org>
6 ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
7 ;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz>
8 ;;; Copyright © 2019 Marius Bakke <mbakke@fastmail.com>
10 ;;; This file is part of GNU Guix.
12 ;;; GNU Guix is free software; you can redistribute it and/or modify it
13 ;;; under the terms of the GNU General Public License as published by
14 ;;; the Free Software Foundation; either version 3 of the License, or (at
15 ;;; your option) any later version.
17 ;;; GNU Guix is distributed in the hope that it will be useful, but
18 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;;; GNU General Public License for more details.
22 ;;; You should have received a copy of the GNU General Public License
23 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
25 (define-module (gnu packages webkit)
26 #:use-module ((guix licenses) #:prefix license:)
27 #:use-module (guix packages)
28 #:use-module (guix download)
29 #:use-module (guix utils)
30 #:use-module (guix build-system cmake)
31 #:use-module (guix build-system gnu)
32 #:use-module (gnu packages)
33 #:use-module (gnu packages base)
34 #:use-module (gnu packages bison)
35 #:use-module (gnu packages compression)
36 #:use-module (gnu packages docbook)
37 #:use-module (gnu packages enchant)
38 #:use-module (gnu packages flex)
39 #:use-module (gnu packages fontutils)
40 #:use-module (gnu packages freedesktop)
41 #:use-module (gnu packages gcc)
42 #:use-module (gnu packages gettext)
43 #:use-module (gnu packages gl)
44 #:use-module (gnu packages glib)
45 #:use-module (gnu packages gnome)
46 #:use-module (gnu packages gnupg)
47 #:use-module (gnu packages gperf)
48 #:use-module (gnu packages gstreamer)
49 #:use-module (gnu packages gtk)
50 #:use-module (gnu packages icu4c)
51 #:use-module (gnu packages image)
52 #:use-module (gnu packages libreoffice)
53 #:use-module (gnu packages linux)
54 #:use-module (gnu packages perl)
55 #:use-module (gnu packages pkg-config)
56 #:use-module (gnu packages python)
57 #:use-module (gnu packages ruby)
58 #:use-module (gnu packages sqlite)
59 #:use-module (gnu packages tls)
60 #:use-module (gnu packages video)
61 #:use-module (gnu packages virtualization)
62 #:use-module (gnu packages xml)
63 #:use-module (gnu packages xdisorg)
64 #:use-module (gnu packages xorg))
74 (string-append "https://wpewebkit.org/releases/libwpe-"
77 (base32 "141w35b488jjhanl3nrm0awrbcy6hb579fk8n9vbpx07m2wcd1rm"))))
78 (build-system cmake-build-system)
80 `(#:tests? #f)) ;no tests
82 `(("pkg-config" ,pkg-config)
83 ("python" ,python-wrapper)))
87 `(("libxkbcommon" ,libxkbcommon)))
88 (synopsis "General-purpose library for WPE")
89 (description "LibWPE is general-purpose library specifically developed for
90 the WPE-flavored port of WebKit.")
91 (home-page "https://wpewebkit.org/")
92 (license license:bsd-2)))
94 (define-public wpebackend-fdo
96 (name "wpebackend-fdo")
100 (uri (string-append "https://wpewebkit.org/releases/"
101 "wpebackend-fdo-" version ".tar.xz"))
104 "1jdi43gciqjgvhnqxs160f3hmp1hkqhrllb0hhmldyxc4wryw3kl"))))
105 (build-system cmake-build-system)
107 `(#:tests? #f)) ;no tests
109 `(("pkg-config" ,pkg-config)))
114 ("wayland" ,wayland)))
115 (home-page "https://wpewebkit.org/")
116 (synopsis "Wayland WPE backend")
118 "This package provides a backend implementation for the WPE WebKit
119 engine that uses Wayland for graphics output.")
120 (license license:bsd-2)))
122 (define-public wpewebkit
130 (string-append "https://wpewebkit.org/releases/"
131 name "-" version ".tar.xz"))
133 (base32 "12z9457ja1xm93kl3gpd6nvd5xn11mvm8pr0w2zhmh3k9lx2cf95"))))
134 (build-system cmake-build-system)
135 (outputs '("out" "doc"))
137 `(#:tests? #f ; XXX: To be enabled
141 ;; XXX: To be enabled.
142 ;; "-DENABLE_ACCELERATED_2D_CANVAS=ON"
143 "-DENABLE_ENCRYPTED_MEDIA=ON"
144 "-DENABLE_GTKDOC=ON")
146 (modify-phases %standard-phases
147 (add-after 'unpack 'setenv
149 (setenv "HOME" "/tmp")
151 (add-after 'unpack 'patch-docbook-xml
152 (lambda* (#:key inputs #:allow-other-keys)
156 (("http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd")
157 (string-append (assoc-ref inputs "docbook-xml")
158 "/xml/dtd/docbook/docbookx.dtd"))))
159 (find-files "Source" "\\.sgml$"))
161 (add-after 'install 'move-doc-files
162 (lambda* (#:key outputs #:allow-other-keys)
163 (let* ((out (assoc-ref outputs "out"))
164 (doc (assoc-ref outputs "doc")))
165 (mkdir-p (string-append doc "/share"))
167 (string-append out "/share/gtk-doc")
168 (string-append doc "/share/gtk-doc"))
171 `(("docbook-xml" ,docbook-xml-4.1.2)
172 ("docbook-xsl" ,docbook-xsl)
173 ("glib:bin" ,glib "bin")
174 ("gobject-introspection" ,gobject-introspection)
177 ("pkg-config" ,pkg-config)
178 ("python" ,python-wrapper)
179 ("python2" ,python-2.7)
183 ("atk-bridge" ,at-spi2-atk)
184 ("bubblewrap" ,bubblewrap)
186 ("fontconfig" ,fontconfig)
187 ("freetype" ,freetype)
189 ("gstreamer" ,gstreamer)
190 ("gst-plugins-base" ,gst-plugins-base)
191 ("harfbuzz" ,harfbuzz)
193 ("libepoxy" ,libepoxy)
194 ("libgcrypt" ,libgcrypt)
195 ("libjpeg" ,libjpeg-turbo)
197 ("libseccomp" ,libseccomp)
198 ("libtasn1" ,libtasn1)
202 ("openjpeg" ,openjpeg)
206 ("xdg-dbus-proxy" ,xdg-dbus-proxy)
212 (synopsis "WebKit port optimized for embedded devices")
213 (description "WPE WebKit allows embedders to create simple and performant
214 systems based on Web platform technologies. It is designed with hardware
215 acceleration in mind, leveraging common 3D graphics APIs for best performance.")
216 (home-page "https://wpewebkit.org/")
219 ;; Rendering and JavaScript Engines.
224 (define-public webkitgtk
230 (uri (string-append "https://www.webkitgtk.org/releases/"
231 "webkitgtk-" version ".tar.xz"))
234 "0r4lkk21pny2g4mmsw0ds14m5hhjys1l47gvy59dfgihr7l546c2"))
235 (patches (search-patches "webkitgtk-share-store.patch"
236 "webkitgtk-bind-all-fonts.patch"))))
237 (build-system cmake-build-system)
238 (outputs '("out" "doc"))
240 '(#:tests? #f ; no tests
241 #:build-type "Release" ; turn off debugging symbols to save space
242 #:configure-flags (list
244 "-DENABLE_GTKDOC=ON" ; No doc by default
245 (string-append ; uses lib64 by default
247 (assoc-ref %outputs "out") "/lib")
249 ;; XXX Adding GStreamer GL support would apparently
250 ;; require adding gst-plugins-bad to the inputs,
251 ;; which might entail a security risk as a result of
252 ;; the plugins of dubious code quality that are
253 ;; included. More investigation is needed. For
254 ;; now, we explicitly disable it to prevent an error
255 ;; at configuration time.
256 "-DUSE_GSTREAMER_GL=OFF"
258 ;; XXX Disable WOFF2 ‘web fonts’. These were never
259 ;; supported in our previous builds. Enabling them
260 ;; requires building libwoff2 and possibly woff2dec.
263 (modify-phases %standard-phases
264 (add-after 'unpack 'configure-bubblewrap-store-directory
266 ;; This phase is a corollary to 'webkitgtk-share-store.patch' to
267 ;; avoid hard coding /gnu/store, for users with other prefixes.
268 (let ((store-directory (%store-directory)))
270 "Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp"
271 (("@storedir@") store-directory))
273 (add-after 'unpack 'patch-gtk-doc-scan
274 (lambda* (#:key inputs #:allow-other-keys)
275 (for-each (lambda (file)
277 (("http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd")
278 (string-append (assoc-ref inputs "docbook-xml")
279 "/xml/dtd/docbook/docbookx.dtd"))))
280 (find-files "Source" "\\.sgml$"))
282 (add-after 'unpack 'embed-absolute-wpebackend-reference
283 (lambda* (#:key inputs #:allow-other-keys)
284 (let ((wpebackend-fdo (assoc-ref inputs "wpebackend-fdo")))
285 (substitute* "Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp"
286 (("libWPEBackend-fdo-([\\.0-9]+)\\.so" all version)
287 (string-append wpebackend-fdo "/lib/" all)))
289 (add-after 'install 'move-doc-files
290 (lambda* (#:key outputs #:allow-other-keys)
291 (let ((out (assoc-ref outputs "out"))
292 (doc (assoc-ref outputs "doc")))
293 (mkdir-p (string-append doc "/share"))
294 (rename-file (string-append out "/share/gtk-doc")
295 (string-append doc "/share/gtk-doc"))
299 ("gettext" ,gettext-minimal)
300 ("glib:bin" ,glib "bin") ; for glib-mkenums, etc.
301 ("gobject-introspection" ,gobject-introspection)
304 ("pkg-config" ,pkg-config)
305 ("python" ,python-wrapper)
306 ("gtk-doc" ,gtk-doc) ; For documentation generation
307 ("docbook-xml" ,docbook-xml) ; For documentation generation
311 ("libsoup" ,libsoup)))
313 `(("at-spi2-core" ,at-spi2-core)
314 ("bubblewrap" ,bubblewrap)
317 ("gst-plugins-base" ,gst-plugins-base)
319 ("harfbuzz" ,harfbuzz)
322 ("libgcrypt" ,libgcrypt)
323 ("libjpeg" ,libjpeg-turbo)
324 ("libnotify" ,libnotify)
326 ("libseccomp" ,libseccomp)
327 ("libsecret" ,libsecret)
328 ("libtasn1" ,libtasn1)
331 ("libxcomposite" ,libxcomposite)
336 ("openjpeg" ,openjpeg)
338 ("wpebackend-fdo" ,wpebackend-fdo)
339 ("xdg-dbus-proxy" ,xdg-dbus-proxy)))
340 (home-page "https://www.webkitgtk.org/")
341 (synopsis "Web content engine for GTK+")
343 "WebKitGTK+ is a full-featured port of the WebKit rendering engine,
344 suitable for projects requiring any kind of web integration, from hybrid
345 HTML/CSS applications to full-fledged web browsers.")
346 ;; WebKit's JavaScriptCore and WebCore components are available under
347 ;; the GNU LGPL, while the rest is available under a BSD-style license.
348 (license (list license:lgpl2.0