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>
9 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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))
59 (define-public webkitgtk
65 (uri (string-append "https://www.webkitgtk.org/releases/"
66 name "-" version ".tar.xz"))
69 "147r7an41920zl4x9srdva7fxvw2znjin5ldjkhay1cndv9gih0m"))))
70 (build-system cmake-build-system)
71 (outputs '("out" "doc"))
73 '(#:tests? #f ; no tests
74 #:build-type "Release" ; turn off debugging symbols to save space
75 #:configure-flags (list
77 "-DENABLE_GTKDOC=ON" ; No doc by default
78 (string-append ; uses lib64 by default
80 (assoc-ref %outputs "out") "/lib")
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"
91 ;; XXX Disable WOFF2 ‘web fonts’. These were never
92 ;; supported in our previous builds. Enabling them
93 ;; requires building libwoff2 and possibly woff2dec.
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)
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$"))
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"))
116 ("gettext" ,gettext-minimal)
117 ("glib:bin" ,glib "bin") ; for glib-mkenums, etc.
118 ("gobject-introspection" ,gobject-introspection)
121 ("pkg-config" ,pkg-config)
122 ("python" ,python-2) ; incompatible with Python 3 (print syntax)
123 ("gtk-doc" ,gtk-doc) ; For documentation generation
124 ("docbook-xml" ,docbook-xml) ; For documentation generation
128 ("libsoup" ,libsoup)))
130 `(("at-spi2-core" ,at-spi2-core)
133 ("gst-plugins-base" ,gst-plugins-base)
135 ("harfbuzz" ,harfbuzz)
138 ("libgcrypt" ,libgcrypt)
140 ("libnotify" ,libnotify)
142 ("libsecret" ,libsecret)
143 ("libtasn1" ,libtasn1)
145 ("libxcomposite" ,libxcomposite)
151 (home-page "https://www.webkitgtk.org/")
152 (synopsis "Web content engine for GTK+")
154 "WebKitGTK+ is a full-featured port of the WebKit rendering engine,
155 suitable for projects requiring any kind of web integration, from hybrid
156 HTML/CSS applications to full-fledged web browsers.")
157 ;; WebKit's JavaScriptCore and WebCore components are available under
158 ;; the GNU LGPL, while the rest is available under a BSD-style license.
159 (license (list license:lgpl2.0
164 ;; This version of webkitgtk needs to be kept separate, because it requires a
165 ;; newer version of GCC than our default compiler, and this causes problems
166 ;; when linked with C++ libraries built using our default compiler. For now,
167 ;; we use this newer webkitgtk only for selected packages, e.g. epiphany.
168 (define-public webkitgtk-2.24
169 (package/inherit webkitgtk
174 (uri (string-append "https://www.webkitgtk.org/releases/"
175 name "-" version ".tar.xz"))
178 "071jnjvjq6wsxx1jh4ql3j53h1nhphs5ga67fa5i9xjvs3qb3701"))
179 (patches (search-patches "webkitgtk-sans-gstreamer-gl.patch"))))
181 `(("gcc" ,gcc-7) ; webkitgtk-2.22 requires gcc-6 or newer
182 ,@(package-native-inputs webkitgtk)))
184 `(("openjpeg" ,openjpeg)
185 ,@(package-inputs webkitgtk)))
187 (substitute-keyword-arguments (package-arguments webkitgtk)
189 `(modify-phases ,phases
190 (add-before 'configure 'work-around-gcc-7-include-path-issue
191 ;; FIXME: Work around a problem with gcc-7 includes (see
192 ;; <https://bugs.gnu.org/30756>).
194 (unsetenv "C_INCLUDE_PATH")
195 (unsetenv "CPLUS_INCLUDE_PATH")