Commit | Line | Data |
---|---|---|
61c21ad3 SB |
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com> | |
9ca33236 | 3 | ;;; Copyright © 2015 David Hashe <david.hashe@dhashe.com> |
7b05ba91 | 4 | ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net> |
56804398 | 5 | ;;; Copyright © 2015, 2016, 2017, 2018 Mark H Weaver <mhw@netris.org> |
86c9c0c1 | 6 | ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr> |
0ead0b4d | 7 | ;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz> |
61c21ad3 SB |
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) | |
844cc6f8 | 28 | #:use-module (guix utils) |
61c21ad3 | 29 | #:use-module (guix build-system cmake) |
7b05ba91 RW |
30 | #:use-module (guix build-system gnu) |
31 | #:use-module (gnu packages) | |
32 | #:use-module (gnu packages base) | |
61c21ad3 | 33 | #:use-module (gnu packages bison) |
0ead0b4d | 34 | #:use-module (gnu packages docbook) |
61c21ad3 | 35 | #:use-module (gnu packages enchant) |
7b05ba91 | 36 | #:use-module (gnu packages flex) |
844cc6f8 | 37 | #:use-module (gnu packages gcc) |
61c21ad3 SB |
38 | #:use-module (gnu packages gettext) |
39 | #:use-module (gnu packages gl) | |
40 | #:use-module (gnu packages glib) | |
41 | #:use-module (gnu packages gnome) | |
c3868552 | 42 | #:use-module (gnu packages gnupg) |
61c21ad3 SB |
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) | |
19e5258d | 48 | #:use-module (gnu packages libreoffice) |
61c21ad3 SB |
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) | |
cd0322a3 | 53 | #:use-module (gnu packages sqlite) |
a54bf725 | 54 | #:use-module (gnu packages tls) |
61c21ad3 SB |
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") | |
445704c2 | 62 | (version "2.20.5") |
61c21ad3 SB |
63 | (source (origin |
64 | (method url-fetch) | |
3bd716c0 | 65 | (uri (string-append "https://www.webkitgtk.org/releases/" |
61c21ad3 SB |
66 | name "-" version ".tar.xz")) |
67 | (sha256 | |
68 | (base32 | |
445704c2 | 69 | "147r7an41920zl4x9srdva7fxvw2znjin5ldjkhay1cndv9gih0m")))) |
61c21ad3 | 70 | (build-system cmake-build-system) |
0ead0b4d | 71 | (outputs '("out" "doc")) |
61c21ad3 SB |
72 | (arguments |
73 | '(#:tests? #f ; no tests | |
74 | #:build-type "Release" ; turn off debugging symbols to save space | |
9ca33236 DH |
75 | #:configure-flags (list |
76 | "-DPORT=GTK" | |
0ead0b4d | 77 | "-DENABLE_GTKDOC=ON" ; No doc by default |
9ca33236 DH |
78 | (string-append ; uses lib64 by default |
79 | "-DLIB_INSTALL_DIR=" | |
a54bf725 MW |
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. | |
86c9c0c1 TGR |
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. | |
0ead0b4d PN |
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) | |
a509b180 MB |
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$")) | |
0ead0b4d PN |
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)))))) | |
61c21ad3 SB |
114 | (native-inputs |
115 | `(("bison" ,bison) | |
b94a6ca0 | 116 | ("gettext" ,gettext-minimal) |
61c21ad3 SB |
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-2) ; incompatible with Python 3 (print syntax) | |
0ead0b4d PN |
123 | ("gtk-doc" ,gtk-doc) ; For documentation generation |
124 | ("docbook-xml" ,docbook-xml) ; For documentation generation | |
61c21ad3 SB |
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) | |
61c21ad3 SB |
133 | ("gst-plugins-base" ,gst-plugins-base) |
134 | ("gtk+-2" ,gtk+-2) | |
135 | ("harfbuzz" ,harfbuzz) | |
19e5258d | 136 | ("hyphen" ,hyphen) |
61c21ad3 | 137 | ("icu4c" ,icu4c) |
c3868552 | 138 | ("libgcrypt" ,libgcrypt) |
61c21ad3 SB |
139 | ("libjpeg" ,libjpeg) |
140 | ("libnotify" ,libnotify) | |
141 | ("libpng" ,libpng) | |
142 | ("libsecret" ,libsecret) | |
a54bf725 | 143 | ("libtasn1" ,libtasn1) |
61c21ad3 SB |
144 | ("libwebp" ,libwebp) |
145 | ("libxcomposite" ,libxcomposite) | |
146 | ("libxml2" ,libxml2) | |
147 | ("libxslt" ,libxslt) | |
148 | ("libxt" ,libxt) | |
149 | ("mesa" ,mesa) | |
150 | ("sqlite" ,sqlite))) | |
36b2cb02 | 151 | (home-page "https://www.webkitgtk.org/") |
61c21ad3 SB |
152 | (synopsis "Web content engine for GTK+") |
153 | (description | |
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 | |
160 | license:lgpl2.1+ | |
161 | license:bsd-2 | |
162 | license:bsd-3)))) | |
844cc6f8 MW |
163 | |
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. | |
72663b48 | 168 | (define-public webkitgtk-2.24 |
844cc6f8 MW |
169 | (package/inherit webkitgtk |
170 | (name "webkitgtk") | |
8308f0ba | 171 | (version "2.24.2") |
844cc6f8 MW |
172 | (source (origin |
173 | (method url-fetch) | |
174 | (uri (string-append "https://www.webkitgtk.org/releases/" | |
175 | name "-" version ".tar.xz")) | |
176 | (sha256 | |
177 | (base32 | |
8308f0ba MB |
178 | "071jnjvjq6wsxx1jh4ql3j53h1nhphs5ga67fa5i9xjvs3qb3701")) |
179 | (patches (search-patches "webkitgtk-sans-gstreamer-gl.patch")))) | |
844cc6f8 MW |
180 | (native-inputs |
181 | `(("gcc" ,gcc-7) ; webkitgtk-2.22 requires gcc-6 or newer | |
182 | ,@(package-native-inputs webkitgtk))) | |
72663b48 MB |
183 | (inputs |
184 | `(("openjpeg" ,openjpeg) | |
185 | ,@(package-inputs webkitgtk))) | |
844cc6f8 | 186 | (arguments |
a509b180 MB |
187 | (substitute-keyword-arguments (package-arguments webkitgtk) |
188 | ((#:phases phases) | |
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>). | |
193 | (lambda _ | |
194 | (unsetenv "C_INCLUDE_PATH") | |
195 | (unsetenv "CPLUS_INCLUDE_PATH") | |
196 | #t)))))))) |