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> |
9d3a5ddc | 5 | ;;; Copyright © 2015–2021 Mark H Weaver <mhw@netris.org> |
759e9acd | 6 | ;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <me@tobias.gr> |
0ead0b4d | 7 | ;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz> |
b037ea96 | 8 | ;;; Copyright © 2019 Marius Bakke <mbakke@fastmail.com> |
61c21ad3 SB |
9 | ;;; |
10 | ;;; This file is part of GNU Guix. | |
11 | ;;; | |
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. | |
16 | ;;; | |
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. | |
21 | ;;; | |
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/>. | |
24 | ||
25 | (define-module (gnu packages webkit) | |
26 | #:use-module ((guix licenses) #:prefix license:) | |
27 | #:use-module (guix packages) | |
28 | #:use-module (guix download) | |
844cc6f8 | 29 | #:use-module (guix utils) |
61c21ad3 | 30 | #:use-module (guix build-system cmake) |
7b05ba91 RW |
31 | #:use-module (guix build-system gnu) |
32 | #:use-module (gnu packages) | |
33 | #:use-module (gnu packages base) | |
61c21ad3 | 34 | #:use-module (gnu packages bison) |
f8a6cc22 | 35 | #:use-module (gnu packages compression) |
0ead0b4d | 36 | #:use-module (gnu packages docbook) |
61c21ad3 | 37 | #:use-module (gnu packages enchant) |
7b05ba91 | 38 | #:use-module (gnu packages flex) |
f8a6cc22 | 39 | #:use-module (gnu packages fontutils) |
7970127f | 40 | #:use-module (gnu packages freedesktop) |
844cc6f8 | 41 | #:use-module (gnu packages gcc) |
61c21ad3 | 42 | #:use-module (gnu packages gettext) |
9d3a5ddc | 43 | #:use-module (gnu packages ghostscript) |
61c21ad3 SB |
44 | #:use-module (gnu packages gl) |
45 | #:use-module (gnu packages glib) | |
46 | #:use-module (gnu packages gnome) | |
c3868552 | 47 | #:use-module (gnu packages gnupg) |
61c21ad3 SB |
48 | #:use-module (gnu packages gperf) |
49 | #:use-module (gnu packages gstreamer) | |
50 | #:use-module (gnu packages gtk) | |
51 | #:use-module (gnu packages icu4c) | |
52 | #:use-module (gnu packages image) | |
19e5258d | 53 | #:use-module (gnu packages libreoffice) |
689b44bc | 54 | #:use-module (gnu packages linux) |
9d3a5ddc | 55 | #:use-module (gnu packages llvm) |
61c21ad3 SB |
56 | #:use-module (gnu packages perl) |
57 | #:use-module (gnu packages pkg-config) | |
58 | #:use-module (gnu packages python) | |
59 | #:use-module (gnu packages ruby) | |
cd0322a3 | 60 | #:use-module (gnu packages sqlite) |
a54bf725 | 61 | #:use-module (gnu packages tls) |
61c21ad3 | 62 | #:use-module (gnu packages video) |
689b44bc | 63 | #:use-module (gnu packages virtualization) |
61c21ad3 | 64 | #:use-module (gnu packages xml) |
b037ea96 | 65 | #:use-module (gnu packages xdisorg) |
61c21ad3 SB |
66 | #:use-module (gnu packages xorg)) |
67 | ||
b037ea96 MB |
68 | (define-public libwpe |
69 | (package | |
70 | (name "libwpe") | |
63efc495 | 71 | (version "1.6.0") |
eaa147c4 RG |
72 | (source |
73 | (origin | |
74 | (method url-fetch) | |
75 | (uri | |
76 | (string-append "https://wpewebkit.org/releases/libwpe-" | |
77 | version ".tar.xz")) | |
78 | (sha256 | |
79 | (base32 "141w35b488jjhanl3nrm0awrbcy6hb579fk8n9vbpx07m2wcd1rm")))) | |
b037ea96 MB |
80 | (build-system cmake-build-system) |
81 | (arguments | |
82 | `(#:tests? #f)) ;no tests | |
83 | (native-inputs | |
eaa147c4 RG |
84 | `(("pkg-config" ,pkg-config) |
85 | ("python" ,python-wrapper))) | |
b037ea96 MB |
86 | (inputs |
87 | `(("mesa" ,mesa))) | |
88 | (propagated-inputs | |
eaa147c4 RG |
89 | `(("libxkbcommon" ,libxkbcommon))) |
90 | (synopsis "General-purpose library for WPE") | |
91 | (description "LibWPE is general-purpose library specifically developed for | |
92 | the WPE-flavored port of WebKit.") | |
b037ea96 | 93 | (home-page "https://wpewebkit.org/") |
b037ea96 MB |
94 | (license license:bsd-2))) |
95 | ||
7970127f MB |
96 | (define-public wpebackend-fdo |
97 | (package | |
98 | (name "wpebackend-fdo") | |
8e9ccf7a | 99 | (version "1.6.1") |
7970127f MB |
100 | (source (origin |
101 | (method url-fetch) | |
102 | (uri (string-append "https://wpewebkit.org/releases/" | |
103 | "wpebackend-fdo-" version ".tar.xz")) | |
104 | (sha256 | |
105 | (base32 | |
8e9ccf7a | 106 | "1jdi43gciqjgvhnqxs160f3hmp1hkqhrllb0hhmldyxc4wryw3kl")))) |
7970127f MB |
107 | (build-system cmake-build-system) |
108 | (arguments | |
109 | `(#:tests? #f)) ;no tests | |
110 | (native-inputs | |
111 | `(("pkg-config" ,pkg-config))) | |
112 | (inputs | |
113 | `(("glib" ,glib) | |
114 | ("libwpe" ,libwpe) | |
115 | ("mesa" ,mesa) | |
116 | ("wayland" ,wayland))) | |
117 | (home-page "https://wpewebkit.org/") | |
118 | (synopsis "Wayland WPE backend") | |
119 | (description | |
120 | "This package provides a backend implementation for the WPE WebKit | |
121 | engine that uses Wayland for graphics output.") | |
122 | (license license:bsd-2))) | |
123 | ||
f8a6cc22 RG |
124 | (define-public wpewebkit |
125 | (package | |
126 | (name "wpewebkit") | |
37b5e791 | 127 | (version "2.30.5") |
f8a6cc22 RG |
128 | (source |
129 | (origin | |
130 | (method url-fetch) | |
131 | (uri | |
132 | (string-append "https://wpewebkit.org/releases/" | |
133 | name "-" version ".tar.xz")) | |
134 | (sha256 | |
37b5e791 | 135 | (base32 "16imr0kmzhs7dz6jva9750xbsdz9v50playnagabajy30x7pymsb")))) |
f8a6cc22 RG |
136 | (build-system cmake-build-system) |
137 | (outputs '("out" "doc")) | |
138 | (arguments | |
139 | `(#:tests? #f ; XXX: To be enabled | |
140 | #:configure-flags | |
141 | (list | |
142 | "-DPORT=WPE" | |
143 | ;; XXX: To be enabled. | |
144 | ;; "-DENABLE_ACCELERATED_2D_CANVAS=ON" | |
37b5e791 LLB |
145 | "-DUSE_SYSTEMD=OFF" |
146 | "-DENABLE_ENCRYPTED_MEDIA=OFF" | |
147 | "-DENABLE_GTKDOC=ON" | |
148 | "-DUSE_GSTREAMER_GL=OFF") | |
f8a6cc22 RG |
149 | #:phases |
150 | (modify-phases %standard-phases | |
151 | (add-after 'unpack 'setenv | |
152 | (lambda _ | |
153 | (setenv "HOME" "/tmp") | |
154 | #t)) | |
155 | (add-after 'unpack 'patch-docbook-xml | |
156 | (lambda* (#:key inputs #:allow-other-keys) | |
157 | (for-each | |
158 | (lambda (file) | |
159 | (substitute* file | |
160 | (("http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd") | |
161 | (string-append (assoc-ref inputs "docbook-xml") | |
162 | "/xml/dtd/docbook/docbookx.dtd")))) | |
163 | (find-files "Source" "\\.sgml$")) | |
164 | #t)) | |
165 | (add-after 'install 'move-doc-files | |
166 | (lambda* (#:key outputs #:allow-other-keys) | |
167 | (let* ((out (assoc-ref outputs "out")) | |
168 | (doc (assoc-ref outputs "doc"))) | |
169 | (mkdir-p (string-append doc "/share")) | |
170 | (rename-file | |
171 | (string-append out "/share/gtk-doc") | |
172 | (string-append doc "/share/gtk-doc")) | |
173 | #t)))))) | |
174 | (native-inputs | |
175 | `(("docbook-xml" ,docbook-xml-4.1.2) | |
176 | ("docbook-xsl" ,docbook-xsl) | |
177 | ("glib:bin" ,glib "bin") | |
178 | ("gobject-introspection" ,gobject-introspection) | |
9dea1618 | 179 | ("gtk-doc" ,gtk-doc/stable) |
f8a6cc22 RG |
180 | ("perl" ,perl) |
181 | ("pkg-config" ,pkg-config) | |
182 | ("python" ,python-wrapper) | |
183 | ("python2" ,python-2.7) | |
184 | ("ruby" ,ruby))) | |
185 | (inputs | |
186 | `(("atk" ,atk) | |
187 | ("atk-bridge" ,at-spi2-atk) | |
188 | ("bubblewrap" ,bubblewrap) | |
189 | ("cairo" ,cairo) | |
190 | ("fontconfig" ,fontconfig) | |
191 | ("freetype" ,freetype) | |
192 | ("gperf" ,gperf) | |
193 | ("gstreamer" ,gstreamer) | |
194 | ("gst-plugins-base" ,gst-plugins-base) | |
195 | ("harfbuzz" ,harfbuzz) | |
196 | ("icu" ,icu4c) | |
197 | ("libepoxy" ,libepoxy) | |
198 | ("libgcrypt" ,libgcrypt) | |
199 | ("libjpeg" ,libjpeg-turbo) | |
200 | ("libpng" ,libpng) | |
201 | ("libseccomp" ,libseccomp) | |
202 | ("libtasn1" ,libtasn1) | |
203 | ("libxml2" ,libxml2) | |
204 | ("libxslt" ,libxslt) | |
205 | ("mesa" ,mesa) | |
206 | ("openjpeg" ,openjpeg) | |
207 | ("sqlite" ,sqlite) | |
208 | ("webp" ,libwebp) | |
209 | ("woff2" ,woff2) | |
210 | ("xdg-dbus-proxy" ,xdg-dbus-proxy) | |
211 | ("zlib" ,zlib))) | |
212 | (propagated-inputs | |
213 | `(("glib" ,glib) | |
214 | ("libsoup" ,libsoup) | |
215 | ("wpe" ,libwpe))) | |
216 | (synopsis "WebKit port optimized for embedded devices") | |
217 | (description "WPE WebKit allows embedders to create simple and performant | |
218 | systems based on Web platform technologies. It is designed with hardware | |
219 | acceleration in mind, leveraging common 3D graphics APIs for best performance.") | |
220 | (home-page "https://wpewebkit.org/") | |
221 | (license | |
222 | (list | |
223 | ;; Rendering and JavaScript Engines. | |
224 | license:lgpl2.1+ | |
225 | ;; Others | |
226 | license:bsd-2)))) | |
227 | ||
61c21ad3 SB |
228 | (define-public webkitgtk |
229 | (package | |
230 | (name "webkitgtk") | |
8797a07a | 231 | (version "2.34.1") |
61c21ad3 SB |
232 | (source (origin |
233 | (method url-fetch) | |
3bd716c0 | 234 | (uri (string-append "https://www.webkitgtk.org/releases/" |
256ab7cf | 235 | "webkitgtk-" version ".tar.xz")) |
61c21ad3 SB |
236 | (sha256 |
237 | (base32 | |
8797a07a | 238 | "1vix0w24m7mq82rzxrk8xvcrkli44gimzs282xs29q2xf0b16g24")) |
bc549a27 LP |
239 | (patches (search-patches "webkitgtk-share-store.patch" |
240 | "webkitgtk-bind-all-fonts.patch")))) | |
61c21ad3 | 241 | (build-system cmake-build-system) |
0ead0b4d | 242 | (outputs '("out" "doc")) |
61c21ad3 | 243 | (arguments |
4fd12fb0 | 244 | `(#:tests? #f ; no tests |
61c21ad3 | 245 | #:build-type "Release" ; turn off debugging symbols to save space |
9ca33236 DH |
246 | #:configure-flags (list |
247 | "-DPORT=GTK" | |
0ead0b4d | 248 | "-DENABLE_GTKDOC=ON" ; No doc by default |
3c5e1412 LF |
249 | ;; Requires libmanette, new dependency added in 2.32.0. |
250 | ;; TODO Decide if we should enable this | |
251 | "-DENABLE_GAMEPAD=OFF" | |
e6b6e834 | 252 | "-DUSE_SYSTEMD=OFF" |
9ca33236 DH |
253 | (string-append ; uses lib64 by default |
254 | "-DLIB_INSTALL_DIR=" | |
a54bf725 | 255 | (assoc-ref %outputs "out") "/lib") |
a54bf725 MW |
256 | ;; XXX Adding GStreamer GL support would apparently |
257 | ;; require adding gst-plugins-bad to the inputs, | |
258 | ;; which might entail a security risk as a result of | |
259 | ;; the plugins of dubious code quality that are | |
260 | ;; included. More investigation is needed. For | |
261 | ;; now, we explicitly disable it to prevent an error | |
262 | ;; at configuration time. | |
92d0949a | 263 | "-DUSE_GSTREAMER_GL=OFF") |
e5c65fb7 TGR |
264 | #:make-flags |
265 | ;; Never build with unsupported -j1: https://issues.guix.gnu.org/47964#5 | |
266 | (list "-j" (number->string (max 2 (parallel-job-count)))) | |
0ead0b4d PN |
267 | #:phases |
268 | (modify-phases %standard-phases | |
a6919866 JH |
269 | (add-after 'unpack 'configure-bubblewrap-store-directory |
270 | (lambda _ | |
271 | ;; This phase is a corollary to 'webkitgtk-share-store.patch' to | |
272 | ;; avoid hard coding /gnu/store, for users with other prefixes. | |
273 | (let ((store-directory (%store-directory))) | |
274 | (substitute* | |
275 | "Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp" | |
26457b40 | 276 | (("@storedir@") store-directory))))) |
0ead0b4d PN |
277 | (add-after 'unpack 'patch-gtk-doc-scan |
278 | (lambda* (#:key inputs #:allow-other-keys) | |
a509b180 MB |
279 | (for-each (lambda (file) |
280 | (substitute* file | |
281 | (("http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd") | |
282 | (string-append (assoc-ref inputs "docbook-xml") | |
283 | "/xml/dtd/docbook/docbookx.dtd")))) | |
26457b40 | 284 | (find-files "Source" "\\.sgml$")))) |
1714edc3 MB |
285 | (add-after 'unpack 'embed-absolute-wpebackend-reference |
286 | (lambda* (#:key inputs #:allow-other-keys) | |
287 | (let ((wpebackend-fdo (assoc-ref inputs "wpebackend-fdo"))) | |
288 | (substitute* "Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp" | |
289 | (("libWPEBackend-fdo-([\\.0-9]+)\\.so" all version) | |
26457b40 | 290 | (string-append wpebackend-fdo "/lib/" all)))))) |
d82fd7c2 LMP |
291 | ,@(if (string-prefix? "x86_64" (or (%current-target-system) |
292 | (%current-system))) | |
293 | '() | |
294 | '((add-after 'unpack 'disable-sse2 | |
295 | (lambda _ | |
296 | (substitute* "Source/cmake/DetectSSE2.cmake" | |
297 | (("CHECK_FOR_SSE2\\(\\)") "")))))) | |
0ead0b4d PN |
298 | (add-after 'install 'move-doc-files |
299 | (lambda* (#:key outputs #:allow-other-keys) | |
300 | (let ((out (assoc-ref outputs "out")) | |
301 | (doc (assoc-ref outputs "doc"))) | |
302 | (mkdir-p (string-append doc "/share")) | |
303 | (rename-file (string-append out "/share/gtk-doc") | |
26457b40 | 304 | (string-append doc "/share/gtk-doc")))))))) |
61c21ad3 | 305 | (native-inputs |
26457b40 | 306 | `(("bison" ,bison) |
b94a6ca0 | 307 | ("gettext" ,gettext-minimal) |
61c21ad3 SB |
308 | ("glib:bin" ,glib "bin") ; for glib-mkenums, etc. |
309 | ("gobject-introspection" ,gobject-introspection) | |
310 | ("gperf" ,gperf) | |
311 | ("perl" ,perl) | |
312 | ("pkg-config" ,pkg-config) | |
625801f5 | 313 | ("python" ,python-wrapper) |
9dea1618 | 314 | ("gtk-doc" ,gtk-doc/stable) ; For documentation generation |
0ead0b4d | 315 | ("docbook-xml" ,docbook-xml) ; For documentation generation |
61c21ad3 SB |
316 | ("ruby" ,ruby))) |
317 | (propagated-inputs | |
318 | `(("gtk+" ,gtk+) | |
319 | ("libsoup" ,libsoup))) | |
320 | (inputs | |
321 | `(("at-spi2-core" ,at-spi2-core) | |
e7f62a41 | 322 | ("bubblewrap" ,bubblewrap) |
61c21ad3 SB |
323 | ("enchant" ,enchant) |
324 | ("geoclue" ,geoclue) | |
61c21ad3 SB |
325 | ("gst-plugins-base" ,gst-plugins-base) |
326 | ("gtk+-2" ,gtk+-2) | |
327 | ("harfbuzz" ,harfbuzz) | |
19e5258d | 328 | ("hyphen" ,hyphen) |
61c21ad3 | 329 | ("icu4c" ,icu4c) |
9d3a5ddc | 330 | ("lcms" ,lcms) |
c3868552 | 331 | ("libgcrypt" ,libgcrypt) |
4bd428a7 | 332 | ("libjpeg" ,libjpeg-turbo) |
61c21ad3 SB |
333 | ("libnotify" ,libnotify) |
334 | ("libpng" ,libpng) | |
e7f62a41 | 335 | ("libseccomp" ,libseccomp) |
61c21ad3 | 336 | ("libsecret" ,libsecret) |
a54bf725 | 337 | ("libtasn1" ,libtasn1) |
61c21ad3 | 338 | ("libwebp" ,libwebp) |
e7f62a41 | 339 | ("libwpe" ,libwpe) |
61c21ad3 SB |
340 | ("libxcomposite" ,libxcomposite) |
341 | ("libxml2" ,libxml2) | |
342 | ("libxslt" ,libxslt) | |
343 | ("libxt" ,libxt) | |
344 | ("mesa" ,mesa) | |
19008a22 | 345 | ("openjpeg" ,openjpeg) |
e7f62a41 | 346 | ("sqlite" ,sqlite) |
92d0949a | 347 | ("woff2" ,woff2) |
e7f62a41 MB |
348 | ("wpebackend-fdo" ,wpebackend-fdo) |
349 | ("xdg-dbus-proxy" ,xdg-dbus-proxy))) | |
36b2cb02 | 350 | (home-page "https://www.webkitgtk.org/") |
61c21ad3 SB |
351 | (synopsis "Web content engine for GTK+") |
352 | (description | |
353 | "WebKitGTK+ is a full-featured port of the WebKit rendering engine, | |
354 | suitable for projects requiring any kind of web integration, from hybrid | |
355 | HTML/CSS applications to full-fledged web browsers.") | |
356 | ;; WebKit's JavaScriptCore and WebCore components are available under | |
357 | ;; the GNU LGPL, while the rest is available under a BSD-style license. | |
358 | (license (list license:lgpl2.0 | |
359 | license:lgpl2.1+ | |
360 | license:bsd-2 | |
361 | license:bsd-3)))) |