| 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 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> |
| 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) |
| 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 docbook) |
| 36 | #:use-module (gnu packages enchant) |
| 37 | #:use-module (gnu packages flex) |
| 38 | #:use-module (gnu packages freedesktop) |
| 39 | #:use-module (gnu packages gcc) |
| 40 | #:use-module (gnu packages gettext) |
| 41 | #:use-module (gnu packages gl) |
| 42 | #:use-module (gnu packages glib) |
| 43 | #:use-module (gnu packages gnome) |
| 44 | #:use-module (gnu packages gnupg) |
| 45 | #:use-module (gnu packages gperf) |
| 46 | #:use-module (gnu packages gstreamer) |
| 47 | #:use-module (gnu packages gtk) |
| 48 | #:use-module (gnu packages icu4c) |
| 49 | #:use-module (gnu packages image) |
| 50 | #:use-module (gnu packages libreoffice) |
| 51 | #:use-module (gnu packages linux) |
| 52 | #:use-module (gnu packages perl) |
| 53 | #:use-module (gnu packages pkg-config) |
| 54 | #:use-module (gnu packages python) |
| 55 | #:use-module (gnu packages ruby) |
| 56 | #:use-module (gnu packages sqlite) |
| 57 | #:use-module (gnu packages tls) |
| 58 | #:use-module (gnu packages video) |
| 59 | #:use-module (gnu packages virtualization) |
| 60 | #:use-module (gnu packages xml) |
| 61 | #:use-module (gnu packages xdisorg) |
| 62 | #:use-module (gnu packages xorg)) |
| 63 | |
| 64 | (define-public libwpe |
| 65 | (package |
| 66 | (name "libwpe") |
| 67 | (version "1.4.0") |
| 68 | (source (origin |
| 69 | (method url-fetch) |
| 70 | (uri (string-append "https://wpewebkit.org/releases/libwpe-" |
| 71 | version ".tar.xz")) |
| 72 | (sha256 |
| 73 | (base32 |
| 74 | "1221vs72zs87anrzhbm6pf8jnii7s6ms7mkzj6nlds9zqd7lklz2")))) |
| 75 | (build-system cmake-build-system) |
| 76 | (arguments |
| 77 | `(#:tests? #f)) ;no tests |
| 78 | (native-inputs |
| 79 | `(("pkg-config" ,pkg-config))) |
| 80 | (inputs |
| 81 | `(("mesa" ,mesa))) |
| 82 | (propagated-inputs |
| 83 | `(;; In Requires of wpe-1.0.pc. |
| 84 | ("libxkbcommon" ,libxkbcommon))) |
| 85 | (home-page "https://wpewebkit.org/") |
| 86 | (synopsis "Platform agnostic WebKit interfaces") |
| 87 | (description |
| 88 | "@code{libwpe} is a small library that defines programming interfaces |
| 89 | for use by WebKit, and provides a mechanism for loading a platform-specific |
| 90 | backend which implements them.") |
| 91 | (license license:bsd-2))) |
| 92 | |
| 93 | (define-public wpebackend-fdo |
| 94 | (package |
| 95 | (name "wpebackend-fdo") |
| 96 | (version "1.4.0") |
| 97 | (source (origin |
| 98 | (method url-fetch) |
| 99 | (uri (string-append "https://wpewebkit.org/releases/" |
| 100 | "wpebackend-fdo-" version ".tar.xz")) |
| 101 | (sha256 |
| 102 | (base32 |
| 103 | "1bwbs47v4nlzhsqrw9fpyny5m3n9ry0kfzsvk90zjif4bd5cl6d9")))) |
| 104 | (build-system cmake-build-system) |
| 105 | (arguments |
| 106 | `(#:tests? #f)) ;no tests |
| 107 | (native-inputs |
| 108 | `(("pkg-config" ,pkg-config))) |
| 109 | (inputs |
| 110 | `(("glib" ,glib) |
| 111 | ("libwpe" ,libwpe) |
| 112 | ("mesa" ,mesa) |
| 113 | ("wayland" ,wayland))) |
| 114 | (home-page "https://wpewebkit.org/") |
| 115 | (synopsis "Wayland WPE backend") |
| 116 | (description |
| 117 | "This package provides a backend implementation for the WPE WebKit |
| 118 | engine that uses Wayland for graphics output.") |
| 119 | (license license:bsd-2))) |
| 120 | |
| 121 | (define-public webkitgtk |
| 122 | (package |
| 123 | (name "webkitgtk") |
| 124 | (version "2.26.2") |
| 125 | (source (origin |
| 126 | (method url-fetch) |
| 127 | (uri (string-append "https://www.webkitgtk.org/releases/" |
| 128 | "webkitgtk-" version ".tar.xz")) |
| 129 | (patches (search-patches "webkitgtk-icu-65.patch")) |
| 130 | (sha256 |
| 131 | (base32 |
| 132 | "04k5h0sid9azsqz9pyq436v1rx4lnfrhvmcgmicqb0c0g9iz103b")))) |
| 133 | (build-system cmake-build-system) |
| 134 | (outputs '("out" "doc")) |
| 135 | (arguments |
| 136 | '(#:tests? #f ; no tests |
| 137 | #:build-type "Release" ; turn off debugging symbols to save space |
| 138 | #:configure-flags (list |
| 139 | "-DPORT=GTK" |
| 140 | "-DENABLE_GTKDOC=ON" ; No doc by default |
| 141 | (string-append ; uses lib64 by default |
| 142 | "-DLIB_INSTALL_DIR=" |
| 143 | (assoc-ref %outputs "out") "/lib") |
| 144 | |
| 145 | ;; XXX Adding GStreamer GL support would apparently |
| 146 | ;; require adding gst-plugins-bad to the inputs, |
| 147 | ;; which might entail a security risk as a result of |
| 148 | ;; the plugins of dubious code quality that are |
| 149 | ;; included. More investigation is needed. For |
| 150 | ;; now, we explicitly disable it to prevent an error |
| 151 | ;; at configuration time. |
| 152 | "-DUSE_GSTREAMER_GL=OFF" |
| 153 | |
| 154 | ;; XXX Disable WOFF2 ‘web fonts’. These were never |
| 155 | ;; supported in our previous builds. Enabling them |
| 156 | ;; requires building libwoff2 and possibly woff2dec. |
| 157 | "-DUSE_WOFF2=OFF") |
| 158 | #:phases |
| 159 | (modify-phases %standard-phases |
| 160 | (add-after 'unpack 'patch-gtk-doc-scan |
| 161 | (lambda* (#:key inputs #:allow-other-keys) |
| 162 | (for-each (lambda (file) |
| 163 | (substitute* file |
| 164 | (("http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd") |
| 165 | (string-append (assoc-ref inputs "docbook-xml") |
| 166 | "/xml/dtd/docbook/docbookx.dtd")))) |
| 167 | (find-files "Source" "\\.sgml$")) |
| 168 | #t)) |
| 169 | (add-after 'unpack 'embed-absolute-wpebackend-reference |
| 170 | (lambda* (#:key inputs #:allow-other-keys) |
| 171 | (let ((wpebackend-fdo (assoc-ref inputs "wpebackend-fdo"))) |
| 172 | (substitute* "Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp" |
| 173 | (("libWPEBackend-fdo-([\\.0-9]+)\\.so" all version) |
| 174 | (string-append wpebackend-fdo "/lib/" all))) |
| 175 | #t))) |
| 176 | (add-after 'install 'move-doc-files |
| 177 | (lambda* (#:key outputs #:allow-other-keys) |
| 178 | (let ((out (assoc-ref outputs "out")) |
| 179 | (doc (assoc-ref outputs "doc"))) |
| 180 | (mkdir-p (string-append doc "/share")) |
| 181 | (rename-file (string-append out "/share/gtk-doc") |
| 182 | (string-append doc "/share/gtk-doc")) |
| 183 | #t)))))) |
| 184 | (native-inputs |
| 185 | `(("bison" ,bison) |
| 186 | ("gettext" ,gettext-minimal) |
| 187 | ("glib:bin" ,glib "bin") ; for glib-mkenums, etc. |
| 188 | ("gobject-introspection" ,gobject-introspection) |
| 189 | ("gperf" ,gperf) |
| 190 | ("perl" ,perl) |
| 191 | ("pkg-config" ,pkg-config) |
| 192 | ("python" ,python-wrapper) |
| 193 | ("gtk-doc" ,gtk-doc) ; For documentation generation |
| 194 | ("docbook-xml" ,docbook-xml) ; For documentation generation |
| 195 | ("ruby" ,ruby))) |
| 196 | (propagated-inputs |
| 197 | `(("gtk+" ,gtk+) |
| 198 | ("libsoup" ,libsoup))) |
| 199 | (inputs |
| 200 | `(("at-spi2-core" ,at-spi2-core) |
| 201 | ("bubblewrap" ,bubblewrap) |
| 202 | ("enchant" ,enchant) |
| 203 | ("geoclue" ,geoclue) |
| 204 | ("gst-plugins-base" ,gst-plugins-base) |
| 205 | ("gtk+-2" ,gtk+-2) |
| 206 | ("harfbuzz" ,harfbuzz) |
| 207 | ("hyphen" ,hyphen) |
| 208 | ("icu4c" ,icu4c) |
| 209 | ("libgcrypt" ,libgcrypt) |
| 210 | ("libjpeg" ,libjpeg-turbo) |
| 211 | ("libnotify" ,libnotify) |
| 212 | ("libpng" ,libpng) |
| 213 | ("libseccomp" ,libseccomp) |
| 214 | ("libsecret" ,libsecret) |
| 215 | ("libtasn1" ,libtasn1) |
| 216 | ("libwebp" ,libwebp) |
| 217 | ("libwpe" ,libwpe) |
| 218 | ("libxcomposite" ,libxcomposite) |
| 219 | ("libxml2" ,libxml2) |
| 220 | ("libxslt" ,libxslt) |
| 221 | ("libxt" ,libxt) |
| 222 | ("mesa" ,mesa) |
| 223 | ("openjpeg" ,openjpeg) |
| 224 | ("sqlite" ,sqlite) |
| 225 | ("wpebackend-fdo" ,wpebackend-fdo) |
| 226 | ("xdg-dbus-proxy" ,xdg-dbus-proxy))) |
| 227 | (home-page "https://www.webkitgtk.org/") |
| 228 | (synopsis "Web content engine for GTK+") |
| 229 | (description |
| 230 | "WebKitGTK+ is a full-featured port of the WebKit rendering engine, |
| 231 | suitable for projects requiring any kind of web integration, from hybrid |
| 232 | HTML/CSS applications to full-fledged web browsers.") |
| 233 | ;; WebKit's JavaScriptCore and WebCore components are available under |
| 234 | ;; the GNU LGPL, while the rest is available under a BSD-style license. |
| 235 | (license (list license:lgpl2.0 |
| 236 | license:lgpl2.1+ |
| 237 | license:bsd-2 |
| 238 | license:bsd-3)))) |