| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 |
|
| 30 | (define-module (gnu packages webkit)
|
| 31 | #:use-module ((guix licenses) #:prefix license:)
|
| 32 | #:use-module (guix packages)
|
| 33 | #:use-module (guix download)
|
| 34 | #:use-module (guix gexp)
|
| 35 | #:use-module (guix git-download)
|
| 36 | #:use-module (guix utils)
|
| 37 | #:use-module (guix build utils)
|
| 38 | #:use-module (guix build-system cmake)
|
| 39 | #:use-module (guix build-system meson)
|
| 40 | #:use-module (gnu packages)
|
| 41 | #:use-module (gnu packages base)
|
| 42 | #:use-module (gnu packages bison)
|
| 43 | #:use-module (gnu packages c)
|
| 44 | #:use-module (gnu packages compression)
|
| 45 | #:use-module (gnu packages docbook)
|
| 46 | #:use-module (gnu packages enchant)
|
| 47 | #:use-module (gnu packages compiler-tools)
|
| 48 | #:use-module (gnu packages fontutils)
|
| 49 | #:use-module (gnu packages freedesktop)
|
| 50 | #:use-module (gnu packages games)
|
| 51 | #:use-module (gnu packages gcc)
|
| 52 | #:use-module (gnu packages gettext)
|
| 53 | #:use-module (gnu packages ghostscript)
|
| 54 | #:use-module (gnu packages gl)
|
| 55 | #:use-module (gnu packages glib)
|
| 56 | #:use-module (gnu packages gnome)
|
| 57 | #:use-module (gnu packages gnupg)
|
| 58 | #:use-module (gnu packages gperf)
|
| 59 | #:use-module (gnu packages gstreamer)
|
| 60 | #:use-module (gnu packages gtk)
|
| 61 | #:use-module (gnu packages icu4c)
|
| 62 | #:use-module (gnu packages image)
|
| 63 | #:use-module (gnu packages libreoffice)
|
| 64 | #:use-module (gnu packages linux)
|
| 65 | #:use-module (gnu packages llvm)
|
| 66 | #:use-module (gnu packages perl)
|
| 67 | #:use-module (gnu packages pkg-config)
|
| 68 | #:use-module (gnu packages python)
|
| 69 | #:use-module (gnu packages ruby)
|
| 70 | #:use-module (gnu packages speech)
|
| 71 | #:use-module (gnu packages sqlite)
|
| 72 | #:use-module (gnu packages tls)
|
| 73 | #:use-module (gnu packages video)
|
| 74 | #:use-module (gnu packages virtualization)
|
| 75 | #:use-module (gnu packages xml)
|
| 76 | #:use-module (gnu packages xdisorg)
|
| 77 | #:use-module (gnu packages xorg))
|
| 78 |
|
| 79 | (define-public libwpe
|
| 80 | (package
|
| 81 | (name "libwpe")
|
| 82 | (version "1.16.0")
|
| 83 | (source
|
| 84 | (origin
|
| 85 | (method url-fetch)
|
| 86 | (uri
|
| 87 | (string-append "https://wpewebkit.org/releases/libwpe-"
|
| 88 | version ".tar.xz"))
|
| 89 | (sha256
|
| 90 | (base32 "0ajb6c7z0lzwgp23pwq7vqly7lmnlbnwrivd906pj1nhng3a7wy7"))))
|
| 91 | (build-system meson-build-system)
|
| 92 | (arguments
|
| 93 | `(#:tests? #f)) |
| 94 | (native-inputs
|
| 95 | `(("pkg-config" ,pkg-config)
|
| 96 | ("python" ,python-wrapper)))
|
| 97 | (inputs
|
| 98 | (list mesa))
|
| 99 | (propagated-inputs
|
| 100 | (list libxkbcommon))
|
| 101 | (synopsis "General-purpose library for WPE")
|
| 102 | (description "LibWPE is general-purpose library specifically developed for
|
| 103 | the WPE-flavored port of WebKit.")
|
| 104 | (home-page "https://wpewebkit.org/")
|
| 105 | (license license:bsd-2)))
|
| 106 |
|
| 107 | (define-public wpebackend-fdo
|
| 108 | (package
|
| 109 | (name "wpebackend-fdo")
|
| 110 | (version "1.14.3")
|
| 111 | (source (origin
|
| 112 | (method url-fetch)
|
| 113 | (uri (string-append "https://wpewebkit.org/releases/"
|
| 114 | "wpebackend-fdo-" version ".tar.xz"))
|
| 115 | (sha256
|
| 116 | (base32
|
| 117 | "0v6wb60m1f628b78dlr2j03xz14r1gdz70iyvf8h51asb511h4hh"))))
|
| 118 | (build-system meson-build-system)
|
| 119 | (arguments
|
| 120 | `(#:tests? #f)) |
| 121 | (native-inputs
|
| 122 | (list pkg-config))
|
| 123 | (inputs
|
| 124 | (list glib libepoxy libwpe mesa wayland))
|
| 125 | (home-page "https://wpewebkit.org/")
|
| 126 | (synopsis "Wayland WPE backend")
|
| 127 | (description
|
| 128 | "This package provides a backend implementation for the WPE WebKit
|
| 129 | engine that uses Wayland for graphics output.")
|
| 130 | (license license:bsd-2)))
|
| 131 |
|
| 132 | (define-public webkitgtk
|
| 133 | (package
|
| 134 | (name "webkitgtk")
|
| 135 | (version "2.50.3")
|
| 136 | (source (origin
|
| 137 | (method url-fetch)
|
| 138 | (uri (string-append "https://www.webkitgtk.org/releases/"
|
| 139 | "webkitgtk-" version ".tar.xz"))
|
| 140 | (sha256
|
| 141 | (base32 "0kymjkskp2ndvs10hvqc0l7i3x19s2hga0g8azhv5djvd6s0d83h"))
|
| 142 | (patches (search-patches
|
| 143 | "webkitgtk-adjust-bubblewrap-paths.patch"))))
|
| 144 | (build-system cmake-build-system)
|
| 145 | (outputs '("out" "doc"))
|
| 146 | (arguments
|
| 147 | (list
|
| 148 | |
| 149 | |
| 150 | #:tests? #f
|
| 151 | |
| 152 | |
| 153 | |
| 154 | #:build-type "Release"
|
| 155 | #:configure-flags
|
| 156 | #~(list "-DPORT=GTK"
|
| 157 | "-DENABLE_INTROSPECTION=ON"
|
| 158 | "-DUSE_GTK4=ON"
|
| 159 | |
| 160 | "-DENABLE_MEDIA_STREAM=ON"
|
| 161 | "-DENABLE_WEB_RTC=ON"
|
| 162 | |
| 163 | |
| 164 | |
| 165 | "-DENABLE_MINIBROWSER=ON"
|
| 166 | "-DUSE_LIBBACKTRACE=OFF" |
| 167 | "-DUSE_SYSTEM_MALLOC=ON"
|
| 168 | |
| 169 | (string-append "-DLIB_INSTALL_DIR=" #$output "/lib")
|
| 170 | |
| 171 | |
| 172 | |
| 173 | |
| 174 | |
| 175 | (string-append "-DCMAKE_CXX_FLAGS=-I"
|
| 176 | (search-input-directory
|
| 177 | %build-inputs "include/elogind")))
|
| 178 | |
| 179 | |
| 180 | #:make-flags #~(list "-j" (number->string (max 2 (parallel-job-count))))
|
| 181 | #:phases
|
| 182 | #~(modify-phases %standard-phases
|
| 183 | (add-before 'build 'set-CC
|
| 184 | (lambda _
|
| 185 | |
| 186 | |
| 187 | (setenv "CC" #$(cc-for-target))))
|
| 188 | (add-after 'unpack 'configure-bubblewrap-store-directory
|
| 189 | (lambda _
|
| 190 | |
| 191 | |
| 192 | |
| 193 | (let ((store-directory (%store-directory)))
|
| 194 | (substitute*
|
| 195 | "Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp"
|
| 196 | (("@storedir@") store-directory)
|
| 197 | |
| 198 | |
| 199 | |
| 200 | |
| 201 | (("@localedir@") "/run/current-system/locale")))))
|
| 202 | (add-after 'unpack 'do-not-disable-new-dtags
|
| 203 | |
| 204 | |
| 205 | (lambda _
|
| 206 | (substitute* "Source/cmake/OptionsCommon.cmake"
|
| 207 | (("if \\(LD_SUPPORTS_DISABLE_NEW_DTAGS\\)")
|
| 208 | "if (FALSE)"))))
|
| 209 | (add-after 'unpack 'embed-absolute-wpebackend-reference
|
| 210 | (lambda* (#:key inputs #:allow-other-keys)
|
| 211 | (let ((wpebackend-fdo (assoc-ref inputs "wpebackend-fdo")))
|
| 212 | (substitute* "Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp"
|
| 213 | (("libWPEBackend-fdo-[\\.0-9]+\\.so" all)
|
| 214 | (search-input-file inputs (string-append "lib/" all)))))))
|
| 215 | #$@(if (target-x86-32?)
|
| 216 | |
| 217 | '((add-after 'unpack 'fix-headers
|
| 218 | (lambda _
|
| 219 | (substitute* "Source/ThirdParty/ANGLE/src/common/platform.h"
|
| 220 | (("\\|\\| defined\\(__i386__\\)") "")))))
|
| 221 | '())
|
| 222 | #$@(if (target-x86-64?)
|
| 223 | '()
|
| 224 | '((add-after 'unpack 'disable-sse2
|
| 225 | (lambda _
|
| 226 | (substitute* "Source/cmake/WebKitCompilerFlags.cmake"
|
| 227 | (("WTF_CPU_X86 AND NOT CMAKE_CROSSCOMPILING")
|
| 228 | "FALSE"))))))
|
| 229 | (add-after 'install 'move-doc-files
|
| 230 | (lambda* (#:key outputs #:allow-other-keys)
|
| 231 | (let ((doc (assoc-ref outputs "doc")))
|
| 232 | (mkdir-p (string-append doc "/share"))
|
| 233 | (rename-file (string-append #$output "/share/doc")
|
| 234 | (string-append doc "/share/doc"))))))))
|
| 235 | (native-inputs
|
| 236 | (list bison
|
| 237 | gettext-minimal
|
| 238 | `(,glib "bin") |
| 239 | gobject-introspection
|
| 240 | gperf
|
| 241 | perl
|
| 242 | pkg-config
|
| 243 | python-wrapper
|
| 244 | gi-docgen
|
| 245 | ruby
|
| 246 | unifdef))
|
| 247 | (propagated-inputs
|
| 248 | (list gtk libsoup))
|
| 249 | (inputs
|
| 250 | (list at-spi2-core
|
| 251 | bubblewrap
|
| 252 | elogind
|
| 253 | enchant
|
| 254 | flite
|
| 255 | geoclue
|
| 256 | gst-plugins-base
|
| 257 | gst-plugins-bad-minimal
|
| 258 | harfbuzz
|
| 259 | hyphen
|
| 260 | icu4c
|
| 261 | lcms
|
| 262 | libavif
|
| 263 | libgcrypt
|
| 264 | libgudev
|
| 265 | libjpeg-turbo
|
| 266 | libjxl
|
| 267 | libmanette
|
| 268 | libpng
|
| 269 | libseccomp
|
| 270 | libsecret
|
| 271 | libtasn1
|
| 272 | libwebp
|
| 273 | libwpe
|
| 274 | libxcomposite
|
| 275 | libxml2
|
| 276 | libxslt
|
| 277 | libxt
|
| 278 | mesa
|
| 279 | openjpeg
|
| 280 | openssl
|
| 281 | sqlite
|
| 282 | sysprof
|
| 283 | woff2
|
| 284 | wpebackend-fdo
|
| 285 | xdg-dbus-proxy))
|
| 286 | (properties '((timeout . 144000))) |
| 287 | (home-page "https://www.webkitgtk.org/")
|
| 288 | (synopsis "Web content engine for GTK+")
|
| 289 | (description "WebKitGTK+ is a full-featured port of the WebKit rendering engine,
|
| 290 | suitable for projects requiring any kind of web integration, from hybrid
|
| 291 | HTML/CSS applications to full-fledged web browsers. WebKitGTK+ video playing
|
| 292 | capabilities can be extended through the use of GStreamer plugins (not
|
| 293 | propagated by default) such as @code{gst-plugins-good} and
|
| 294 | @code{gst-plugins-bad}.")
|
| 295 | |
| 296 | |
| 297 | (license (list license:lgpl2.0
|
| 298 | license:lgpl2.1+
|
| 299 | license:bsd-2
|
| 300 | license:bsd-3))))
|
| 301 |
|
| 302 | (define-public webkitgtk-for-gtk3
|
| 303 | (package/inherit webkitgtk
|
| 304 | (name "webkitgtk-for-gtk3")
|
| 305 | (arguments
|
| 306 | (substitute-keyword-arguments arguments
|
| 307 | ((#:configure-flags flags)
|
| 308 | #~(cons* "-DUSE_GTK4=OFF"
|
| 309 | (delete "-DUSE_GTK4=ON" #$flags)))))
|
| 310 | (propagated-inputs
|
| 311 | (modify-inputs propagated-inputs
|
| 312 | (replace "gtk" gtk+)))
|
| 313 | (inputs
|
| 314 | (modify-inputs inputs
|
| 315 | (prepend libnotify)))))
|
| 316 |
|
| 317 | |
| 318 | |
| 319 | |
| 320 | (define-public webkitgtk-with-libsoup2
|
| 321 | (package/inherit webkitgtk-for-gtk3
|
| 322 | (name "webkitgtk-with-libsoup2")
|
| 323 | (arguments (substitute-keyword-arguments arguments
|
| 324 | ((#:configure-flags flags)
|
| 325 | #~(cons "-DUSE_SOUP2=ON" #$flags))))
|
| 326 | (propagated-inputs
|
| 327 | (modify-inputs propagated-inputs
|
| 328 | (replace "libsoup" libsoup-minimal-2)))))
|
| 329 |
|
| 330 | (define-public wpewebkit
|
| 331 | (package
|
| 332 | (inherit webkitgtk)
|
| 333 | (name "wpewebkit")
|
| 334 | (version "2.50.3")
|
| 335 | (source (origin
|
| 336 | (inherit (package-source webkitgtk))
|
| 337 | (uri (string-append "https://wpewebkit.org/releases/"
|
| 338 | name "-" version ".tar.xz"))
|
| 339 | (sha256
|
| 340 | (base32 "0bzv2h25qr7h0r8likdb8g248qvsilf41cj7prf1avghfr1pzjdg"))))
|
| 341 | (arguments
|
| 342 | (substitute-keyword-arguments arguments
|
| 343 | ((#:configure-flags flags)
|
| 344 | #~(cons "-DPORT=WPE"
|
| 345 | (delete "-DPORT=GTK" #$flags)))))
|
| 346 | (inputs (modify-inputs inputs
|
| 347 | (prepend libinput)))
|
| 348 | (synopsis "WebKit port optimized for embedded devices")
|
| 349 | (description "WPE WebKit allows embedders to create simple and performant
|
| 350 | systems based on Web platform technologies. It is designed with hardware
|
| 351 | acceleration in mind, leveraging common 3D graphics APIs for best performance.")
|
| 352 | (home-page "https://wpewebkit.org/")
|
| 353 | (properties '((cpe-name . "wpe_webkit")))))
|
| 354 |
|
| 355 | (define-public cog
|
| 356 | (package
|
| 357 | (name "cog")
|
| 358 | (version "0.18.5")
|
| 359 | (source
|
| 360 | (origin (method git-fetch)
|
| 361 | (uri (git-reference
|
| 362 | (url "https://github.com/Igalia/cog")
|
| 363 | (commit version)))
|
| 364 | (file-name (git-file-name name version))
|
| 365 | (sha256
|
| 366 | (base32
|
| 367 | "12r99jai7laxjir5zy46q87hl6mg391mf578lqrb6k2x6fli76zy"))))
|
| 368 | (build-system meson-build-system)
|
| 369 | (arguments
|
| 370 | (list
|
| 371 | #:configure-flags
|
| 372 | #~(list "-Ddocumentation=true"
|
| 373 | "-Dmanpages=true"
|
| 374 | "-Dplatforms=drm,headless,wayland,gtk4,x11")
|
| 375 | #:phases
|
| 376 | #~(modify-phases %standard-phases
|
| 377 | (add-after 'unpack 'embed-absolute-wpebackend-reference
|
| 378 | (lambda* (#:key inputs #:allow-other-keys)
|
| 379 | (for-each
|
| 380 | (lambda (file)
|
| 381 | (substitute* file
|
| 382 | (("libWPEBackend-fdo-[\\.0-9]+\\.so" all)
|
| 383 | (search-input-file inputs (string-append "lib/" all)))))
|
| 384 | (list "platform/drm/cog-platform-drm.c"
|
| 385 | "platform/gtk4/cog-platform-gtk4.c"
|
| 386 | "platform/headless/cog-platform-headless.c"
|
| 387 | "platform/wayland/cog-platform-wl.c"
|
| 388 | "platform/x11/cog-platform-x11.c")))))
|
| 389 | #:tests? #f)) |
| 390 | (native-inputs
|
| 391 | (list gi-docgen
|
| 392 | gobject-introspection
|
| 393 | pkg-config))
|
| 394 | (inputs
|
| 395 | (list libinput
|
| 396 | libwpe
|
| 397 | libxcb
|
| 398 | libxkbcommon
|
| 399 | wayland
|
| 400 | wayland-protocols
|
| 401 | wpebackend-fdo
|
| 402 | wpewebkit))
|
| 403 | (synopsis "Single-window launcher for WPE Webkit")
|
| 404 | (description
|
| 405 | "Cog is a small single \"window\" launcher for the WebKit WPE port. It is
|
| 406 | small, provides no user interface of its own, and is suitable to be used as a
|
| 407 | web application container. The \"window\" may be fullscreen or have UI elements
|
| 408 | depending on the WPE backend being used.")
|
| 409 | (home-page "https://github.com/Igalia/cog")
|
| 410 | (license license:expat)))
|