webkit.scm 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  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>
  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. (define-module (gnu packages webkit)
  24. #:use-module ((guix licenses) #:prefix license:)
  25. #:use-module (guix packages)
  26. #:use-module (guix download)
  27. #:use-module (guix utils)
  28. #:use-module (guix build-system cmake)
  29. #:use-module (guix build-system gnu)
  30. #:use-module (gnu packages)
  31. #:use-module (gnu packages base)
  32. #:use-module (gnu packages bison)
  33. #:use-module (gnu packages docbook)
  34. #:use-module (gnu packages enchant)
  35. #:use-module (gnu packages flex)
  36. #:use-module (gnu packages gcc)
  37. #:use-module (gnu packages gettext)
  38. #:use-module (gnu packages gl)
  39. #:use-module (gnu packages glib)
  40. #:use-module (gnu packages gnome)
  41. #:use-module (gnu packages gnupg)
  42. #:use-module (gnu packages gperf)
  43. #:use-module (gnu packages gstreamer)
  44. #:use-module (gnu packages gtk)
  45. #:use-module (gnu packages icu4c)
  46. #:use-module (gnu packages image)
  47. #:use-module (gnu packages libreoffice)
  48. #:use-module (gnu packages perl)
  49. #:use-module (gnu packages pkg-config)
  50. #:use-module (gnu packages python)
  51. #:use-module (gnu packages ruby)
  52. #:use-module (gnu packages sqlite)
  53. #:use-module (gnu packages tls)
  54. #:use-module (gnu packages video)
  55. #:use-module (gnu packages xml)
  56. #:use-module (gnu packages xorg))
  57. (define-public webkitgtk
  58. (package
  59. (name "webkitgtk")
  60. (version "2.20.5")
  61. (source (origin
  62. (method url-fetch)
  63. (uri (string-append "https://www.webkitgtk.org/releases/"
  64. name "-" version ".tar.xz"))
  65. (sha256
  66. (base32
  67. "147r7an41920zl4x9srdva7fxvw2znjin5ldjkhay1cndv9gih0m"))))
  68. (build-system cmake-build-system)
  69. (outputs '("out" "doc"))
  70. (arguments
  71. '(#:tests? #f ; no tests
  72. #:build-type "Release" ; turn off debugging symbols to save space
  73. #:configure-flags (list
  74. "-DPORT=GTK"
  75. "-DENABLE_GTKDOC=ON" ; No doc by default
  76. (string-append ; uses lib64 by default
  77. "-DLIB_INSTALL_DIR="
  78. (assoc-ref %outputs "out") "/lib")
  79. ;; XXX Adding GStreamer GL support would apparently
  80. ;; require adding gst-plugins-bad to the inputs,
  81. ;; which might entail a security risk as a result of
  82. ;; the plugins of dubious code quality that are
  83. ;; included. More investigation is needed. For
  84. ;; now, we explicitly disable it to prevent an error
  85. ;; at configuration time.
  86. "-DUSE_GSTREAMER_GL=OFF"
  87. ;; XXX Disable WOFF2 ‘web fonts’. These were never
  88. ;; supported in our previous builds. Enabling them
  89. ;; requires building libwoff2 and possibly woff2dec.
  90. "-DUSE_WOFF2=OFF")
  91. #:phases
  92. (modify-phases %standard-phases
  93. (add-after 'unpack 'patch-gtk-doc-scan
  94. (lambda* (#:key inputs #:allow-other-keys)
  95. (for-each (lambda (file)
  96. (substitute* file
  97. (("http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd")
  98. (string-append (assoc-ref inputs "docbook-xml")
  99. "/xml/dtd/docbook/docbookx.dtd"))))
  100. (find-files "Source" "\\.sgml$"))
  101. #t))
  102. (add-after 'install 'move-doc-files
  103. (lambda* (#:key outputs #:allow-other-keys)
  104. (let ((out (assoc-ref outputs "out"))
  105. (doc (assoc-ref outputs "doc")))
  106. (mkdir-p (string-append doc "/share"))
  107. (rename-file (string-append out "/share/gtk-doc")
  108. (string-append doc "/share/gtk-doc"))
  109. #t))))))
  110. (native-inputs
  111. `(("bison" ,bison)
  112. ("gettext" ,gettext-minimal)
  113. ("glib:bin" ,glib "bin") ; for glib-mkenums, etc.
  114. ("gobject-introspection" ,gobject-introspection)
  115. ("gperf" ,gperf)
  116. ("perl" ,perl)
  117. ("pkg-config" ,pkg-config)
  118. ("python" ,python-2) ; incompatible with Python 3 (print syntax)
  119. ("gtk-doc" ,gtk-doc) ; For documentation generation
  120. ("docbook-xml" ,docbook-xml) ; For documentation generation
  121. ("ruby" ,ruby)))
  122. (propagated-inputs
  123. `(("gtk+" ,gtk+)
  124. ("libsoup" ,libsoup)))
  125. (inputs
  126. `(("at-spi2-core" ,at-spi2-core)
  127. ("enchant" ,enchant)
  128. ("geoclue" ,geoclue)
  129. ("gst-plugins-base" ,gst-plugins-base)
  130. ("gtk+-2" ,gtk+-2)
  131. ("harfbuzz" ,harfbuzz)
  132. ("hyphen" ,hyphen)
  133. ("icu4c" ,icu4c)
  134. ("libgcrypt" ,libgcrypt)
  135. ("libjpeg" ,libjpeg)
  136. ("libnotify" ,libnotify)
  137. ("libpng" ,libpng)
  138. ("libsecret" ,libsecret)
  139. ("libtasn1" ,libtasn1)
  140. ("libwebp" ,libwebp)
  141. ("libxcomposite" ,libxcomposite)
  142. ("libxml2" ,libxml2)
  143. ("libxslt" ,libxslt)
  144. ("libxt" ,libxt)
  145. ("mesa" ,mesa)
  146. ("sqlite" ,sqlite)))
  147. (home-page "https://www.webkitgtk.org/")
  148. (synopsis "Web content engine for GTK+")
  149. (description
  150. "WebKitGTK+ is a full-featured port of the WebKit rendering engine,
  151. suitable for projects requiring any kind of web integration, from hybrid
  152. HTML/CSS applications to full-fledged web browsers.")
  153. ;; WebKit's JavaScriptCore and WebCore components are available under
  154. ;; the GNU LGPL, while the rest is available under a BSD-style license.
  155. (license (list license:lgpl2.0
  156. license:lgpl2.1+
  157. license:bsd-2
  158. license:bsd-3))))
  159. ;; This version of webkitgtk needs to be kept separate, because it requires a
  160. ;; newer version of GCC than our default compiler, and this causes problems
  161. ;; when linked with C++ libraries built using our default compiler. For now,
  162. ;; we use this newer webkitgtk only for selected packages, e.g. epiphany.
  163. (define-public webkitgtk-2.22
  164. (package/inherit webkitgtk
  165. (name "webkitgtk")
  166. (version "2.22.6")
  167. (source (origin
  168. (method url-fetch)
  169. (uri (string-append "https://www.webkitgtk.org/releases/"
  170. name "-" version ".tar.xz"))
  171. (sha256
  172. (base32
  173. "0ny8azipr2dmdk79qrf4hvb2p4k5b3af38szjhmhg8mh1nfdp46z"))))
  174. (native-inputs
  175. `(("gcc" ,gcc-7) ; webkitgtk-2.22 requires gcc-6 or newer
  176. ,@(package-native-inputs webkitgtk)))
  177. (arguments
  178. (substitute-keyword-arguments (package-arguments webkitgtk)
  179. ((#:phases phases)
  180. `(modify-phases ,phases
  181. (add-before 'configure 'work-around-gcc-7-include-path-issue
  182. ;; FIXME: Work around a problem with gcc-7 includes (see
  183. ;; <https://bugs.gnu.org/30756>).
  184. (lambda _
  185. (unsetenv "C_INCLUDE_PATH")
  186. (unsetenv "CPLUS_INCLUDE_PATH")
  187. #t))))))))