guix-more/more/packages/gnuzilla.scm

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 (gnu packages)
28
  #:use-module ((guix licenses) #:prefix license:)
29
  #:use-module (guix utils)
30
  #:use-module (guix packages)
31
  #:use-module (guix download)
32
  #:use-module (guix build-system cargo)
33
  #:use-module (guix build-system gnu)
34
  #:use-module (more packages google)
35
  #:use-module (gnu packages assembly)
36
  #:use-module (gnu packages autotools)
37
  #:use-module (gnu packages base)
38
  #:use-module (gnu packages bison)
39
  #:use-module (gnu packages cmake)
40
  #:use-module (gnu packages compression)
41
  #:use-module (gnu packages cups)
42
  #:use-module (gnu packages curl)
43
  #:use-module (gnu packages databases)
44
  #:use-module (gnu packages flex)
45
  #:use-module (gnu packages fontutils)
46
  #:use-module (gnu packages gl)
47
  #:use-module (gnu packages glib)
48
  #:use-module (gnu packages gnome)
49
  #:use-module (gnu packages gnuzilla)
50
  #:use-module (gnu packages gtk)
51
  #:use-module (gnu packages icu4c)
52
  #:use-module (gnu packages image)
53
  #:use-module (gnu packages libcanberra)
54
  #:use-module (gnu packages libevent)
55
  #:use-module (gnu packages libffi)
56
  #:use-module (gnu packages libreoffice)
57
  #:use-module (gnu packages linux)
58
  #:use-module (gnu packages perl)
59
  #:use-module (gnu packages pkg-config)
60
  #:use-module (gnu packages pulseaudio)
61
  #:use-module (gnu packages python)
62
  #:use-module (gnu packages rust)
63
  #:use-module (gnu packages version-control)
64
  #:use-module (gnu packages video)
65
  #:use-module (gnu packages xdisorg)
66
  #:use-module (gnu packages xorg))
67
68
(define-public icecat-skia
69
  (package
70
    (inherit icecat)
71
    (name "icecat-skia")
72
    (inputs
73
     `(("skia" ,skia)
74
       ,@(package-inputs icecat)))
75
    (arguments (substitute-keyword-arguments (package-arguments icecat)
76
                 ((#:configure-flags flags)
77
                  `(cons* "--enable-skia" ,flags))))))
78
79
(define-public firefox
80
  (package
81
    (name "firefox")
82
    (version "57.0")
83
    (source (origin
84
              (method url-fetch)
85
              (uri (string-append "https://archive.mozilla.org/pub/firefox/"
86
                                  "releases/" version "/source/firefox-"
87
                                  version ".source.tar.xz"))
88
              (sha256
89
               (base32
90
                "13xvxzpp5l3amrd6jcpnn7d1q7wpf80dsiw0qp4z51xyal0z0fk0"))
91
      (modules '((guix build utils)))
92
      (snippet
93
       '(begin
94
          (use-modules (ice-9 ftw))
95
          ;; Remove bundled libraries that we don't use, since they may
96
          ;; contain unpatched security flaws, they waste disk space and
97
          ;; network bandwidth, and may cause confusion.
98
          (for-each delete-file-recursively
99
                    '(;; FIXME: Removing the bundled icu breaks configure.
100
                      ;;   * The bundled icu headers are used in some places.
101
                      ;;   * The version number is taken from the bundled copy.
102
                      ;;"intl/icu"
103
                      ;;
104
                      ;; FIXME: A script from the bundled nspr is used.
105
                      ;;"nsprpub"
106
                      ;;
107
                      ;; TODO: Use system media libraries.  Waiting for:
108
                      ;; <https://bugzilla.mozilla.org/show_bug.cgi?id=517422>
109
                      ;;   * libogg
110
                      ;;   * libtheora
111
                      ;;   * libvorbis
112
                      ;;   * libtremor (not yet in guix)
113
                      ;;   * libopus
114
                      ;;   * speex
115
                      ;;   * soundtouch (not yet in guix)
116
                      ;;
117
                      ;; TODO: Use system harfbuzz.  Waiting for:
118
                      ;; <https://bugzilla.mozilla.org/show_bug.cgi?id=847568>
119
                      ;;
120
                      ;; TODO: Use system graphite2.
121
                      ;;
122
                      "modules/freetype2"
123
                      "modules/zlib"
124
                      "modules/libbz2"
125
                      "ipc/chromium/src/third_party/libevent"
126
                      "media/libjpeg"
127
                      "media/libvpx"
128
                      "security/nss"
129
                      "gfx/cairo"
130
                      "js/src/ctypes/libffi"
131
                      "db/sqlite3"))
132
          ;; Delete .pyc files, typically present in icecat source tarballs
133
          (for-each delete-file (find-files "." "\\.pyc$"))
134
          ;; Delete obj-* directories, sometimes present in icecat tarballs
135
          (for-each delete-file-recursively
136
                    (scandir "." (lambda (name)
137
                                   (string-prefix? "obj-" name))))
138
          #t))))
139
    (build-system gnu-build-system)
140
    (arguments
141
     `(#:out-of-source? #t
142
       #:tests? #f
143
       #:make-flags (list "--disable-necko-wifi"
144
                          "--disable-stylo"
145
                          "--disable-crashreporter"
146
                          "--disable-updater"
147
                          "--disable-tests"; Remove if we want to test
148
                          "--enable-application=browser"
149
                          "--enable-optimize=-O2"
150
                          "--with-pthreads"
151
                          ;; use system libraries
152
                          "--enable-system-hunspell"
153
                          "--enable-startup-notification"
154
                          "--enable-alsa" "--enable-pulseaudio"
155
                          "--enable-system-sqlite"
156
                          "--with-system-libevent"
157
                          "--with-system-libvpx"
158
                          "--with-system-nspr"
159
                          "--with-system-nss"
160
                          "--with-system-icu"
161
                          "--with-system-graphite2"
162
                          "--with-system-harfbuzz"
163
                          "--enable-system-cairo"
164
                          "--enable-system-ffi"
165
                          "--enable-system-pixman"
166
                          "--with-system-bz2"
167
                          "--with-system-jpeg"
168
                          "--with-system-png"
169
                          "--with-system-zlib")
170
       #:phases
171
       (modify-phases %standard-phases
172
         (replace
173
          'configure
174
          ;; configure does not work followed by both "SHELL=..." and
175
          ;; "CONFIG_SHELL=..."; set environment variables instead
176
          (lambda* (#:key outputs configure-flags #:allow-other-keys)
177
            (let* ((out (assoc-ref outputs "out"))
178
                   (bash (which "bash"))
179
                   (abs-srcdir (getcwd))
180
                   (srcdir (string-append "../" (basename abs-srcdir)))
181
                   (flags `(,(string-append "--prefix=" out)
182
                            ,(string-append "--with-l10n-base="
183
                                            abs-srcdir "/l10n")
184
                            ,@configure-flags)))
185
              (setenv "SHELL" bash)
186
              (setenv "CONFIG_SHELL" bash)
187
              (setenv "AUTOCONF" (which "autoconf")) ; must be autoconf-2.13
188
              (mkdir "../build")
189
              (chdir "../build")
190
              (format #t "build directory: ~s~%" (getcwd))
191
              (format #t "configure flags: ~s~%" flags)
192
              (zero? (apply system* bash
193
                            (string-append srcdir "/configure")
194
                            flags))))))))
195
    (inputs
196
     `(("alsa-lib" ,alsa-lib)
197
       ("bzip2" ,bzip2)
198
       ("cairo" ,cairo)
199
       ("cups" ,cups)
200
       ("dbus-glib" ,dbus-glib)
201
       ("gdk-pixbuf" ,gdk-pixbuf)
202
       ("glib" ,glib)
203
       ("gtk+" ,gtk+)
204
       ("gtk+-2" ,gtk+-2)
205
       ("pango" ,pango)
206
       ("freetype" ,freetype)
207
       ("hunspell" ,hunspell)
208
       ("libcanberra" ,libcanberra)
209
       ("libgnome" ,libgnome)
210
       ("libjpeg-turbo" ,libjpeg-turbo)
211
       ("libxft" ,libxft)
212
       ("libevent" ,libevent-2.0)
213
       ("libxinerama" ,libxinerama)
214
       ("libxscrnsaver" ,libxscrnsaver)
215
       ("libxcomposite" ,libxcomposite)
216
       ("libxt" ,libxt)
217
       ("libffi" ,libffi)
218
       ("ffmpeg" ,ffmpeg)
219
       ("libvpx" ,libvpx)
220
       ("icu4c" ,icu4c)
221
       ("pixman" ,pixman)
222
       ("pulseaudio" ,pulseaudio)
223
       ("mesa" ,mesa)
224
       ("nspr" ,nspr)
225
       ("nss" ,nss)
226
       ("sqlite" ,sqlite)
227
       ("startup-notification" ,startup-notification)
228
       ("unzip" ,unzip)
229
       ("zip" ,zip)
230
       ("zlib" ,zlib)))
231
    (native-inputs
232
     `(("perl" ,perl)
233
       ("python" ,python-2) ; Python 3 not supported
234
       ("python2-pysqlite" ,python2-pysqlite)
235
       ("yasm" ,yasm)
236
       ("pkg-config" ,pkg-config)
237
       ("autoconf" ,autoconf-2.13)
238
       ("which" ,which)
239
       ("rust" ,rustc)
240
       ("cargo" ,cargo)))
241
    (home-page "https://mozilla.org")
242
    (synopsis "Web browser")
243
    (description "")
244
    (license (package-license icecat))))
245