gnuzilla.scm
| 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr> |
| 3 | ;;; Copyright © 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org> |
| 4 | ;;; Copyright © 2014, 2015, 2016, 2017 Mark H Weaver <mhw@netris.org> |
| 5 | ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com> |
| 6 | ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il> |
| 7 | ;;; Copyright © 2016 Alex Griffin <a@ajgrf.com> |
| 8 | ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu> |
| 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 (more packages gnuzilla) |
| 26 | #:use-module ((srfi srfi-1) #:hide (zip)) |
| 27 | #:use-module ((srfi srfi-26)) |
| 28 | #:use-module (gnu packages) |
| 29 | #:use-module ((guix licenses) #:prefix license:) |
| 30 | #:use-module (guix utils) |
| 31 | #:use-module (guix packages) |
| 32 | #:use-module (guix download) |
| 33 | #:use-module (guix build-system cargo) |
| 34 | #:use-module (guix build-system gnu) |
| 35 | #:use-module (more packages google) |
| 36 | #:use-module (gnu packages assembly) |
| 37 | #:use-module (gnu packages autotools) |
| 38 | #:use-module (gnu packages base) |
| 39 | #:use-module (gnu packages bison) |
| 40 | #:use-module (gnu packages cmake) |
| 41 | #:use-module (gnu packages compression) |
| 42 | #:use-module (gnu packages cups) |
| 43 | #:use-module (gnu packages curl) |
| 44 | #:use-module (gnu packages databases) |
| 45 | #:use-module (gnu packages flex) |
| 46 | #:use-module (gnu packages fontutils) |
| 47 | #:use-module (gnu packages gl) |
| 48 | #:use-module (gnu packages glib) |
| 49 | #:use-module (gnu packages gnome) |
| 50 | #:use-module (gnu packages gnuzilla) |
| 51 | #:use-module (gnu packages gtk) |
| 52 | #:use-module (gnu packages icu4c) |
| 53 | #:use-module (gnu packages image) |
| 54 | #:use-module (gnu packages libcanberra) |
| 55 | #:use-module (gnu packages libevent) |
| 56 | #:use-module (gnu packages libffi) |
| 57 | #:use-module (gnu packages libreoffice) |
| 58 | #:use-module (gnu packages linux) |
| 59 | #:use-module (gnu packages llvm) |
| 60 | #:use-module (gnu packages perl) |
| 61 | #:use-module (gnu packages pkg-config) |
| 62 | #:use-module (gnu packages pulseaudio) |
| 63 | #:use-module (gnu packages python) |
| 64 | #:use-module (gnu packages rust) |
| 65 | #:use-module (gnu packages version-control) |
| 66 | #:use-module (gnu packages video) |
| 67 | #:use-module (gnu packages xdisorg) |
| 68 | #:use-module (gnu packages xorg) |
| 69 | #:use-module (ice-9 match)) |
| 70 | |
| 71 | (define-public icecat-skia |
| 72 | (package |
| 73 | (inherit icecat) |
| 74 | (name "icecat-skia") |
| 75 | (inputs |
| 76 | `(("skia" ,skia) |
| 77 | ,@(package-inputs icecat))) |
| 78 | (arguments (substitute-keyword-arguments (package-arguments icecat) |
| 79 | ((#:configure-flags flags) |
| 80 | `(cons* "--enable-skia" ,flags)))))) |
| 81 | |
| 82 | (define-public icu4c-for-firefox |
| 83 | (package |
| 84 | (inherit icu4c) |
| 85 | (name "icu4c") |
| 86 | (version "59.1") |
| 87 | (source (origin |
| 88 | (method url-fetch) |
| 89 | (uri (string-append |
| 90 | "http://download.icu-project.org/files/icu4c/" |
| 91 | version |
| 92 | "/icu4c-" |
| 93 | (string-map (lambda (x) (if (char=? x #\.) #\_ x)) version) |
| 94 | "-src.tgz")) |
| 95 | (sha256 |
| 96 | (base32 "1zkmbg2932ggvpgjp8pys0cj6z8bw087y8858009shkrjfpzscki")))))) |
| 97 | |
| 98 | (define nss-for-firefox |
| 99 | (package |
| 100 | (inherit nss) |
| 101 | (name "nss") |
| 102 | (version "3.34.1") |
| 103 | (source (origin |
| 104 | (method url-fetch) |
| 105 | (uri (let ((version-with-underscores |
| 106 | (string-join (string-split version #\.) "_"))) |
| 107 | (string-append |
| 108 | "https://ftp.mozilla.org/pub/mozilla.org/security/nss/" |
| 109 | "releases/NSS_" version-with-underscores "_RTM/src/" |
| 110 | "nss-" version ".tar.gz"))) |
| 111 | (sha256 |
| 112 | (base32 |
| 113 | "186x33wsk4mzjz7dzbn8p0py9a0nzkgzpfkdv4rlyy5gghv5vhd3")) |
| 114 | ;; Create nss.pc and nss-config. |
| 115 | (patches (search-patches "nss-pkgconfig.patch" |
| 116 | "nss-increase-test-timeout.patch")))))) |
| 117 | (define-public libpng-apng-for-firefox |
| 118 | (package |
| 119 | (inherit libpng-apng) |
| 120 | (name "libpng-apng") |
| 121 | (version "1.6.34") |
| 122 | (source |
| 123 | (origin |
| 124 | (method url-fetch) |
| 125 | (uri (list (string-append "mirror://sourceforge/libpng/libpng16/" |
| 126 | version "/libpng-" version ".tar.xz") |
| 127 | (string-append |
| 128 | "ftp://ftp.simplesystems.org/pub/libpng/png/src" |
| 129 | "/libpng16/libpng-" version ".tar.xz") |
| 130 | (string-append |
| 131 | "ftp://ftp.simplesystems.org/pub/libpng/png/src/history" |
| 132 | "/libpng16/libpng-" version ".tar.xz"))) |
| 133 | (sha256 |
| 134 | (base32 |
| 135 | "1xjr0v34fyjgnhvaa1zixcpx5yvxcg4zwvfh0fyklfyfj86rc7ig")))) |
| 136 | (inputs |
| 137 | `(("apng" ,(origin |
| 138 | (method url-fetch) |
| 139 | (uri |
| 140 | (string-append "mirror://sourceforge/libpng-apng/libpng16/" |
| 141 | version "/libpng-" version "-apng.patch.gz")) |
| 142 | (sha256 |
| 143 | (base32 |
| 144 | "1ha4npf9mfrzp0srg8a5amks5ww84xzfpjbsj8k3yjjpai798qg6")))))))) |
| 145 | |
| 146 | (define-public sqlite-for-firefox |
| 147 | (package |
| 148 | (inherit sqlite) |
| 149 | (name "sqlite") |
| 150 | (version "3.21.0") |
| 151 | (source (origin |
| 152 | (method url-fetch) |
| 153 | (uri (let ((numeric-version |
| 154 | (match (string-split version #\.) |
| 155 | ((first-digit other-digits ...) |
| 156 | (string-append first-digit |
| 157 | (string-pad-right |
| 158 | (string-concatenate |
| 159 | (map (cut string-pad <> 2 #\0) |
| 160 | other-digits)) |
| 161 | 6 #\0)))))) |
| 162 | (string-append "https://sqlite.org/2017/sqlite-autoconf-" |
| 163 | numeric-version ".tar.gz"))) |
| 164 | (sha256 |
| 165 | (base32 |
| 166 | "1qxvzdjwzw6k0kqjfabj86rnq87xdbwbca7laxxdhnh0fmkm3pfp")))))) |
| 167 | |
| 168 | (define-public firefox |
| 169 | (package |
| 170 | (name "firefox") |
| 171 | (version "58.0") |
| 172 | (source (origin |
| 173 | (method url-fetch) |
| 174 | (uri (string-append "https://archive.mozilla.org/pub/firefox/" |
| 175 | "releases/" version "/source/firefox-" |
| 176 | version ".source.tar.xz")) |
| 177 | (sha256 |
| 178 | (base32 |
| 179 | "1zxapyir31zr1k7qrixqayzafh3kkvx0hh5vv1kp8kgrmg53j2hf")) |
| 180 | (modules '((guix build utils))) |
| 181 | (snippet |
| 182 | '(begin |
| 183 | (use-modules (ice-9 ftw)) |
| 184 | ;; Remove bundled libraries that we don't use, since they may |
| 185 | ;; contain unpatched security flaws, they waste disk space and |
| 186 | ;; network bandwidth, and may cause confusion. |
| 187 | (for-each delete-file-recursively |
| 188 | '(;; FIXME: Removing the bundled icu breaks configure. |
| 189 | ;; * The bundled icu headers are used in some places. |
| 190 | ;; * The version number is taken from the bundled copy. |
| 191 | ;;"intl/icu" |
| 192 | ;; |
| 193 | ;; FIXME: A script from the bundled nspr is used. |
| 194 | ;;"nsprpub" |
| 195 | ;; |
| 196 | ;; TODO: Use system media libraries. Waiting for: |
| 197 | ;; <https://bugzilla.mozilla.org/show_bug.cgi?id=517422> |
| 198 | ;; * libogg |
| 199 | ;; * libtheora |
| 200 | ;; * libvorbis |
| 201 | ;; * libtremor (not yet in guix) |
| 202 | ;; * libopus |
| 203 | ;; * speex |
| 204 | ;; * soundtouch (not yet in guix) |
| 205 | ;; |
| 206 | ;; TODO: Use system harfbuzz. Waiting for: |
| 207 | ;; <https://bugzilla.mozilla.org/show_bug.cgi?id=847568> |
| 208 | ;; |
| 209 | ;; TODO: Use system graphite2. |
| 210 | ;; |
| 211 | "modules/freetype2" |
| 212 | "modules/zlib" |
| 213 | "modules/libbz2" |
| 214 | "ipc/chromium/src/third_party/libevent" |
| 215 | "media/libjpeg" |
| 216 | "media/libvpx" |
| 217 | "security/nss" |
| 218 | "gfx/cairo" |
| 219 | "js/src/ctypes/libffi" |
| 220 | "db/sqlite3")) |
| 221 | ;; Delete this file that has incorrect checksums |
| 222 | (for-each delete-file (find-files "." "\\.cargo-checksum.json")) |
| 223 | ;; Delete .pyc files, typically present in icecat source tarballs |
| 224 | (for-each delete-file (find-files "." "\\.pyc$")) |
| 225 | ;; Delete obj-* directories, sometimes present in icecat tarballs |
| 226 | (for-each delete-file-recursively |
| 227 | (scandir "." (lambda (name) |
| 228 | (string-prefix? "obj-" name)))) |
| 229 | #t)))) |
| 230 | (build-system gnu-build-system) |
| 231 | (arguments |
| 232 | `(#:out-of-source? #t |
| 233 | #:tests? #f |
| 234 | #:configure-flags (list "--disable-necko-wifi" |
| 235 | "--disable-stylo" |
| 236 | "--disable-crashreporter" |
| 237 | "--disable-updater" |
| 238 | "--disable-tests"; Remove if we want to test |
| 239 | "--enable-application=browser" |
| 240 | "--enable-optimize=-O2" |
| 241 | "--with-pthreads" |
| 242 | ;; use system libraries |
| 243 | "--enable-system-hunspell" |
| 244 | "--enable-startup-notification" |
| 245 | "--enable-alsa" "--enable-pulseaudio" |
| 246 | "--enable-system-sqlite" |
| 247 | "--with-system-libevent" |
| 248 | "--with-system-libvpx" |
| 249 | "--with-system-nspr" |
| 250 | "--with-system-nss" |
| 251 | "--with-system-icu" |
| 252 | "--enable-system-cairo" |
| 253 | "--enable-system-ffi" |
| 254 | "--enable-system-pixman" |
| 255 | "--with-system-bz2" |
| 256 | "--with-system-jpeg" |
| 257 | "--with-system-png" |
| 258 | "--with-system-zlib") |
| 259 | ;; clang is not found because it is assumed to be in |
| 260 | ;; the same location as llvm. |
| 261 | ;(string-append "--with-clang-path=" |
| 262 | ; (assoc-ref %build-inputs "clang-3.9.1") |
| 263 | ; "/bin/clang")) |
| 264 | ;(string-append "--with-libclang-path=" |
| 265 | ; (assoc-ref %build-inputs "clang-3.9.1") |
| 266 | ; "/lib")) |
| 267 | ;; Race condition in python? |
| 268 | ;; EOFError: EOF read where object expected |
| 269 | #:parallel-build? #f |
| 270 | #:phases |
| 271 | (modify-phases %standard-phases |
| 272 | (replace |
| 273 | 'configure |
| 274 | ;; configure does not work followed by both "SHELL=..." and |
| 275 | ;; "CONFIG_SHELL=..."; set environment variables instead |
| 276 | (lambda* (#:key outputs configure-flags #:allow-other-keys) |
| 277 | (let* ((out (assoc-ref outputs "out")) |
| 278 | (bash (which "bash")) |
| 279 | (abs-srcdir (getcwd)) |
| 280 | (srcdir (string-append "../" (basename abs-srcdir))) |
| 281 | (flags `(,(string-append "--prefix=" out) |
| 282 | ,(string-append "--with-l10n-base=" |
| 283 | abs-srcdir "/intl/l10n") |
| 284 | ,@configure-flags))) |
| 285 | ;; We removed the embedded sqlite, so don't reference it. |
| 286 | (substitute* '("storage/moz.build" "dom/indexedDB/moz.build") |
| 287 | (("'/db/sqlite3/src',") "")) |
| 288 | (setenv "SHELL" bash) |
| 289 | (setenv "CONFIG_SHELL" bash) |
| 290 | (setenv "AUTOCONF" (which "autoconf")) ; must be autoconf-2.13 |
| 291 | (mkdir "../build") |
| 292 | (chdir "../build") |
| 293 | (format #t "build directory: ~s~%" (getcwd)) |
| 294 | (format #t "configure flags: ~s~%" flags) |
| 295 | (zero? (apply system* bash |
| 296 | (string-append srcdir "/configure") |
| 297 | flags)))))))) |
| 298 | (inputs |
| 299 | `(("alsa-lib" ,alsa-lib) |
| 300 | ("bzip2" ,bzip2) |
| 301 | ("cairo" ,cairo) |
| 302 | ("cups" ,cups) |
| 303 | ("dbus-glib" ,dbus-glib) |
| 304 | ("gdk-pixbuf" ,gdk-pixbuf) |
| 305 | ("glib" ,glib) |
| 306 | ("gtk+" ,gtk+) |
| 307 | ("gtk+-2" ,gtk+-2) |
| 308 | ("pango" ,pango) |
| 309 | ("freetype" ,freetype) |
| 310 | ("hunspell" ,hunspell) |
| 311 | ("libcanberra" ,libcanberra) |
| 312 | ("libgnome" ,libgnome) |
| 313 | ("libjpeg-turbo" ,libjpeg-turbo) |
| 314 | ("libxft" ,libxft) |
| 315 | ("libevent" ,libevent-2.0) |
| 316 | ("libxinerama" ,libxinerama) |
| 317 | ("libxscrnsaver" ,libxscrnsaver) |
| 318 | ("libxcomposite" ,libxcomposite) |
| 319 | ("libxt" ,libxt) |
| 320 | ("libffi" ,libffi) |
| 321 | ("ffmpeg" ,ffmpeg) |
| 322 | ("libpng-apng" ,libpng-apng-for-firefox) |
| 323 | ("libvpx" ,libvpx) |
| 324 | ("icu4c" ,icu4c-for-firefox) |
| 325 | ("pixman" ,pixman) |
| 326 | ("pulseaudio" ,pulseaudio) |
| 327 | ("mesa" ,mesa) |
| 328 | ("nspr" ,nspr) |
| 329 | ("nss" ,nss-for-firefox) |
| 330 | ("sqlite" ,sqlite-for-firefox) |
| 331 | ("startup-notification" ,startup-notification) |
| 332 | ("unzip" ,unzip) |
| 333 | ("zip" ,zip) |
| 334 | ("zlib" ,zlib))) |
| 335 | (native-inputs |
| 336 | `(("perl" ,perl) |
| 337 | ("python" ,python-2) ; Python 3 not supported |
| 338 | ("python2-pysqlite" ,python2-pysqlite) |
| 339 | ("yasm" ,yasm) |
| 340 | ("pkg-config" ,pkg-config) |
| 341 | ("autoconf" ,autoconf-2.13) |
| 342 | ("which" ,which) |
| 343 | ("rust" ,rust) |
| 344 | ("cargo" ,cargo) |
| 345 | ("clang-3.9.1" ,clang-3.9.1) |
| 346 | ("llvm-3.9.1" ,llvm-3.9.1))) |
| 347 | (home-page "https://mozilla.org") |
| 348 | (synopsis "Web browser") |
| 349 | (description "") |
| 350 | (license (package-license icecat)))) |
| 351 |