source: xsoft/graphweb/firefox.xml@ fe30eab

10.0 10.1 11.0 8.4 9.0 9.1 ken/refactor-virt lazarus qt5new trunk xry111/git-date xry111/git-date-for-trunk xry111/git-date-test
Last change on this file since fe30eab was fe30eab, checked in by Ken Moffat <ken@…>, 3 years ago

Firefox: Remove the lingering libwebp from the optional dependencies, now that it is recommended, and move liboauth into correct order now it is in the book.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@21059 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 22.3 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
7 <!ENTITY firefox-download-http "&mozilla-http;/firefox/releases/&firefox-version;/source/firefox-&firefox-version;.source.tar.xz">
8 <!ENTITY firefox-download-ftp " ">
9 <!ENTITY firefox-md5sum "b5f952cbb1b1edbae43f6a469059099b">
10 <!ENTITY firefox-size "266 MB">
11 <!-- NB with stylo, much of the build uses rust, and therefore cargo files.
12 But the extra cached cargo files, if any, seem to be minimal -->
13 <!ENTITY firefox-buildsize "9.4 GB (147 MB installed) without tests">
14 <!-- editors: with ff63 and rust-1.29, ./mach build -j4 is probably the
15 most practical way to get a timing on a machine with more cores, if taking
16 cores offline is not practical. If in doubt, round up -->
17 <!ENTITY firefox-time "31 SBU (with parallelism=4) without tests">
18]>
19
20<sect1 id="firefox" xreflabel="Firefox-&firefox-version;">
21 <?dbhtml filename="firefox.html" ?>
22
23 <sect1info>
24 <othername>$LastChangedBy$</othername>
25 <date>$Date$</date>
26 </sect1info>
27
28 <title>Firefox-&firefox-version;</title>
29
30 <indexterm zone="firefox">
31 <primary sortas="a-Firefox">Firefox</primary>
32 </indexterm>
33
34 <sect2 role="package">
35 <title>Introduction to Firefox</title>
36
37 <para>
38 <application>Firefox</application> is a stand-alone browser based on the
39 <application>Mozilla</application> codebase.
40 </para>
41
42 &lfs83_checked;
43
44 <bridgehead renderas="sect3">Package Information</bridgehead>
45 <itemizedlist spacing="compact">
46 <listitem>
47 <para>
48 Download (HTTP): <ulink url="&firefox-download-http;"/>
49 </para>
50 </listitem>
51 <listitem>
52 <para>
53 Download (FTP): <ulink url="&firefox-download-ftp;"/>
54 </para>
55 </listitem>
56 <listitem>
57 <para>
58 Download MD5 sum: &firefox-md5sum;
59 </para>
60 </listitem>
61 <listitem>
62 <para>
63 Download size: &firefox-size;
64 </para>
65 </listitem>
66 <listitem>
67 <para>
68 Estimated disk space required: &firefox-buildsize;
69 </para>
70 </listitem>
71 <listitem>
72 <para>
73 Estimated build time: &firefox-time;
74 </para>
75 </listitem>
76 </itemizedlist>
77
78 <bridgehead renderas="sect3">Additional Downloads</bridgehead>
79 <itemizedlist spacing="compact">
80 <listitem>
81 <para>
82 Optional patch to allow system versions of <xref linkend="graphite2"/>
83 and <xref linkend="harfbuzz"/>:
84 <ulink url="&patch-root;/firefox-&firefox-version;-system_graphite2_harfbuzz-1.patch"/>
85 </para>
86 </listitem>
87 </itemizedlist>
88
89 <note>
90 <para>
91 Extracting the tarball
92 will reset the permissions of the current directory to 0755 if you
93 have permission to do that. If you do this in a directory where
94 the sticky bit is set, such
95 as <filename class="directory">/tmp</filename> it will end with error
96 messages:
97 </para>
98
99<literallayout>tar: .: Cannot utime: Operation not permitted
100tar: .: Cannot change mode to rwxr-xr-t: Operation not permitted
101tar: Exiting with failure status due to previous errors
102</literallayout>
103
104 <para>
105 This does finish with non-zero status, but it does
106 <emphasis>NOT</emphasis> mean there is a real problem.
107 Do not untar as the <systemitem class="username">root</systemitem> user
108 in a directory where the sticky bit is set - that will unset it.
109 </para>
110
111 <para>
112 As with other large packages which use C++ (or rust), the SBU times
113 to build this vary more widely than you might expect. Also, 6GB
114 of real memory is used during the final link and the SBUs can increase
115 significantly if the machine has to swap.
116 </para>
117
118 <para>
119 The mach build system (Python scripts) can be somewhat unreliable: if
120 the build fails and reports an Error, it can still return a status of
121 success, causing a scripted build to try to install (which does not rerun
122 the build), fail during the preparations for installing, but still exit
123 with a status of success. Also, on occasion it may limit itself to only
124 running one set of jobs - that will make the build take about 3 times as
125 long as running with four sets of jobs.
126 </para>
127
128 <para>
129 Although upstream prefer to use <application>PulseAudio</application>,
130 for the moment <application>Alsa</application> can still be used. Both
131 may need runtime configuration to get sound working.
132 </para>
133 </note>
134
135 <bridgehead renderas="sect3">Firefox Dependencies</bridgehead>
136
137 <bridgehead renderas="sect4">Required</bridgehead>
138 <para role="required">
139 <xref linkend="autoconf213"/>,
140 <xref linkend="cbindgen"/>,
141 <application>Clang</application> (from <xref linkend="llvm"/>),
142 both <xref linkend="gtk3"/> and
143 <xref linkend="gtk2"/>,
144 <xref linkend="libnotify"/>,
145 <xref linkend="nodejs"/>,
146 <xref linkend="nss"/>,
147 <xref linkend="pulseaudio"/>
148 (or
149 <xref linkend="alsa-lib"/> if you edit the mozconfig;
150 now deprecated by mozilla), in either case please read the
151 Configuration Information,
152 <xref linkend="rust"/>,
153 <xref linkend="unzip"/>,
154 <xref linkend="yasm"/>, and
155 <xref linkend="zip"/>
156 </para>
157
158 <bridgehead renderas="sect4">Recommended</bridgehead>
159 <para role="recommended">
160 <xref linkend="icu"/>,
161 <xref linkend="libevent"/>,
162 <xref linkend="libvpx"/>,
163 <xref linkend="libwebp"/>, and
164 <xref linkend="sqlite"/>
165 </para>
166
167 <note>
168 <para>
169 If you don't install recommended dependencies, then internal copies of
170 those packages will be used. They might be tested to work, but they can
171 be out of date or contain security holes.
172 </para>
173 </note>
174
175 <bridgehead renderas="sect4">Optional</bridgehead>
176 <para role="optional">
177 <xref linkend="curl"/>,
178 <xref linkend="dbus-glib"/>,
179 <xref linkend="doxygen"/>,
180 <xref linkend="GConf"/>,
181 <xref role="runtime" linkend="ffmpeg"/> (runtime, to play mov, mp3 or mp4 files),
182 <!-- <phrase revision="sysv"><ulink url="http://sourceforge.net/projects/liboauth/files/">liboauth</ulink></phrase> -->
183 <xref linkend="liboauth"/>,
184 <xref linkend="openjdk"/>,
185 <xref linkend="startup-notification"/>,
186 <xref linkend="valgrind"/>,
187 <xref linkend="wget"/>,
188 <xref linkend="wireless_tools"/>,
189 <ulink url="https://github.com/libproxy/libproxy">libproxy</ulink>,
190 and (with the patch)
191 <xref linkend="graphite2"/> and
192 <xref linkend="harfbuzz"/>
193 </para>
194
195 <para condition="html" role="usernotes">
196 User Notes: <ulink url="&blfs-wiki;/firefox"/>
197 </para>
198 </sect2>
199
200 <sect2 role="installation">
201 <title>Installation of Firefox</title>
202
203 <para>
204 The configuration of <application>Firefox</application> is accomplished
205 by creating a <filename>mozconfig</filename> file containing the desired
206 configuration options. A default <filename>mozconfig</filename> is
207 created below. To see the entire list of available configuration options
208 (and an abbreviated description of some of them), issue <command>./mach
209 configure &amp;&amp; ./configure --help | less</command>. You may also
210 wish to review the entire file and uncomment any other desired options.
211 Create the file by issuing the following command:
212 </para>
213
214<screen><userinput>cat &gt; mozconfig &lt;&lt; "EOF"
215<literal># If you have a multicore machine, all cores will be used by default.
216
217# If you have installed dbus-glib, comment out this line:
218ac_add_options --disable-dbus
219
220# If you have installed dbus-glib, and you have installed (or will install)
221# wireless-tools, and you wish to use geolocation web services, comment out
222# this line
223ac_add_options --disable-necko-wifi
224
225# API Keys for geolocation APIs - necko-wifi (above) is required for MLS
226# Uncomment the following line if you wish to use Mozilla Location Service
227#ac_add_options --with-mozilla-api-keyfile=$PWD/mozilla-key
228
229# Uncomment the following line if you wish to use Google's geolocaton API
230# (needed for use with saved maps with Google Maps)
231#ac_add_options --with-google-api-keyfile=$PWD/google-key
232
233# Uncomment this line if you have installed startup-notification:
234#ac_add_options --enable-startup-notification
235
236# Uncomment the following option if you have not installed PulseAudio
237#ac_add_options --disable-pulseaudio
238# and uncomment this if you installed alsa-lib instead of PulseAudio
239#ac_add_options --enable-alsa
240
241# If you have installed GConf, comment out this line
242ac_add_options --disable-gconf
243
244# From firefox-61, the stylo CSS code can no-longer be disabled
245
246# Comment out following options if you have not installed
247# recommended dependencies:
248ac_add_options --enable-system-sqlite
249ac_add_options --with-system-libevent
250ac_add_options --with-system-libvpx
251ac_add_options --with-system-nspr
252ac_add_options --with-system-nss
253ac_add_options --with-system-icu
254
255# The gold linker is no-longer the default
256ac_add_options --enable-linker=gold
257
258# You cannot distribute the binary if you do this
259ac_add_options --enable-official-branding
260
261# If you are going to apply the patch for system graphite
262# and system harfbuzz, uncomment these lines:
263#ac_add_options --with-system-graphite2
264#ac_add_options --with-system-harfbuzz
265
266# Stripping is now enabled by default.
267# Uncomment these lines if you need to run a debugger:
268#ac_add_options --disable-strip
269#ac_add_options --disable-install-strip
270
271# The BLFS editors recommend not changing anything below this line:
272ac_add_options --prefix=/usr
273ac_add_options --enable-application=browser
274
275ac_add_options --disable-crashreporter
276ac_add_options --disable-updater
277# enabling the tests will use a lot more space and significantly
278# increase the build time, for no obvious benefit.
279ac_add_options --disable-tests
280
281# Optimization for size is broken with gcc7 and later
282ac_add_options --enable-optimize="-O2"
283
284# From firefox-61 system cairo is not supported
285
286ac_add_options --enable-system-ffi
287ac_add_options --enable-system-pixman
288
289# From firefox-62 --with-pthreads is not recognized
290
291ac_add_options --with-system-bz2
292ac_add_options --with-system-jpeg
293ac_add_options --with-system-png
294ac_add_options --with-system-zlib
295
296mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/firefox-build-dir</literal>
297EOF</userinput></screen>
298
299 <para>
300 Compile <application>Firefox</application> by issuing the following
301 commands:
302 </para>
303
304 <para>
305 If you have installed system versions of graphite2 and harfbuzz and wish
306 firefox to use those instead of its shipped versions, apply the patch and
307 uncomment the appropriate entries in the <filename>mozconfig</filename>
308 file.
309 </para>
310
311<screen><userinput>patch -Np1 -i ../firefox-&firefox-version;-system_graphite2_harfbuzz-1.patch</userinput></screen>
312
313 <para>
314 If the geolocation APIs are needed:
315 </para>
316
317 <note>
318 <para>
319 <!-- Taken from Arch Linux - an immensely helpful link - Thanks -->
320 The Google and Mozilla API Keys below are specific to LFS. If using
321 these instructions for another distro, or if you intend to distribute
322 binary copies of the software using these instructions, please obtain
323 your own keys following the instructions located at
324 <ulink url="http://www.chromium.org/developers/how-tos/api-keys"/> and
325 <ulink url="https://location.services.mozilla.com/api"/> respectively.
326 <!-- BLFS Devs, register an account at Google with your
327 @linuxfromscratch.org email address, and I'll make you an administrator
328 for the 'Google APIs for LFS' project (where the API and OAuth keys
329 were created for use in the book).-->
330 </para>
331 </note>
332
333<screen><userinput>echo "AIzaSyDxKL42zsPjbke5O8_rPVpVrLrJ8aeE9rQ" > google-key
334echo "d2284a20-0505-4927-a809-7ffaf4d91e55" > mozilla-key</userinput></screen>
335
336 <note><para>
337 If you are compiling <application>Firefox</application> in chroot, make
338 sure you have <envar>$SHELL</envar> environment variable set or prepend
339 <envar>SHELL=/bin/sh</envar>. Also ensure that <filename>/dev/shm</filename>
340 is mounted.
341 </para></note>
342
343 <para>
344<!-- Invoke the Python script to compile the package: -->
345 To use the system version of ICU, run a sed to avoid a conflict between
346 upstream ICU's use of <literal>CheckImpl()</literal> in their public headers
347 and firefox's internal use of a different <literal>CheckImpl()</literal>.
348 Then invoke the Python2 script to compile the package.
349 </para>
350
351<screen><userinput>sed -e 's/checkImpl/checkFFImpl/g' -i js/src/vm/JSContext*.h &amp;&amp;
352export CC=clang CXX=clang++ AR=llvm-ar NM=llvm-nm RANLIB=llvm-ranlib &amp;&amp;
353export MOZBUILD_STATE_PATH=${PWD}/mozbuild &amp;&amp;
354./mach build</userinput></screen>
355
356 <para>
357 The <filename>mozconfig</filename> above disables the tests because
358 they use a lot more time and disk space for no obvious benefit. If
359 you have nevertheless enabled them, you can run the tests by executing
360 <command>./mach gtest</command>. This will require a network connection,
361 and to be run from within an Xorg session - there is a popup dialog
362 when it fails to connect to ALSA (that does not create a failed test).
363 One or two tests will fail. To see the details of the failure(s) you
364 will need to log the output from that command so that you can review it.
365 </para>
366
367 <para>
368 Now, as the <systemitem class="username">root</systemitem> user:
369 </para>
370
371<screen role="root"><userinput>./mach install &amp;&amp;
372
373mkdir -pv /usr/lib/mozilla/plugins &amp;&amp;
374ln -sfv ../../mozilla/plugins /usr/lib/firefox/browser/</userinput></screen>
375
376 <para>
377 Set environment variables back to their values:
378 </para>
379
380<screen><userinput>unset CC CXX AR NM RANLIB MOZBUILD_STATE_PATH</userinput></screen>
381
382 </sect2>
383
384 <sect2 role="commands">
385 <title>Command Explanations</title>
386
387 <para>
388 <command>sed -e 's/checkImpl/checkFFImpl/g' ...</command>: Although the
389 package ships with a modified version of <application>ICU-59</application>
390 and only tests that the system version, if requested, is at least 59,
391 changes in <emphasis>some</emphasis> versions cause builds with the system
392 version to fail with error messages of the form <literal>no void
393 JSContext::checkImpl_NN member function</literal> where NN is the system
394 <application>ICU</application> version. The sed renames the local function.
395 </para>
396
397 <para>
398 <command>export CC=clang CXX=clang++ ...</command>: Upstream now use
399 <application>clang</application> and building with any recent version
400 saves a lot of space.
401 </para>
402
403 <para>
404 <command>export MOZBUILD_STATE_PATH=${PWD}/mozbuild</command>: The build
405 is now supposed to tell you that it intends to create <filename
406 class="directory">~/.mozbuild</filename>, and offer you an option to
407 press &lt;ENTER&gt; to accept this, or Ctrl-C to cancel and restart the
408 build after specifying the directory. In practice, the message may not
409 appear until after &lt;ENTER&gt; is keyed, i.e. the build stalls.
410 </para>
411
412 <para>
413 That directory is used for a (probably random) telemetry identifier.
414 Creating this in the build directory, and deleting that after the
415 installation, prevents it being used. If you wish to participate in
416 telemetry, export MOZBUILD_STATE_PATH to point to its default directory.
417 </para>
418
419 <para>
420 <command>./mach build</command>: <application>Firefox</application>
421 now uses this <application>python2</application> script to run the
422 build and install.
423 </para>
424
425 <para>
426 <option>./mach build --verbose</option>: Use this alternative if you
427 need details of which files are being compiled, together with any C or
428 C++ flags being used.
429 </para>
430
431 <para>
432 <option>./mach build -jN</option>: The build should, by default, use
433 all the online CPU cores. There are two reasons to specify the number
434 of cores, e.g. -j4 for 4 cores: First, if using all the cores causes
435 the build to swap because you have insufficient memory (e.g. for 4 cores
436 a build without system graphite2 and harfbuzz now uses slightly over 8GB
437 of RAM). In such cases, using fewer cores can be faster. Second, on some
438 machines the middle part of the build can drag on as if only one core is
439 present. In those cases, specifying the number of cores may speed up the
440 build.
441 </para>
442
443 <para>
444 <command>mkdir -pv /usr/lib/mozilla/plugins</command>: This ensures
445 that <filename class="directory">/usr/lib/mozilla/plugins/</filename>
446 exists.
447 </para>
448
449 <para>
450 <command>ln -sv ... /usr/lib/firefox/browser</command>:
451 This command creates a symbolic link to <filename
452 class="directory">/usr/lib/mozilla/plugins</filename>. It's not really
453 needed, as <application>Firefox</application> checks <filename
454 class="directory">/usr/lib/mozilla/plugins</filename> by default, but the
455 symbolic link is made to keep all the plugins installed in one folder.
456 </para>
457
458 </sect2>
459
460 <sect2 role="configuration">
461 <title>Configuring Firefox</title>
462
463 <para>
464 If you use a desktop environment like <application>Gnome</application> or
465 <application>KDE</application> you may like to create a
466 <filename>firefox.desktop</filename> file so that
467 <application>Firefox</application> appears in the panel's menus. If you
468 didn't enable startup-notification in your mozconfig change the
469 StartupNotify line to false. As the
470 <systemitem class="username">root</systemitem> user:
471 </para>
472
473<screen role="root"><userinput>mkdir -pv /usr/share/applications &amp;&amp;
474mkdir -pv /usr/share/pixmaps &amp;&amp;
475
476cat &gt; /usr/share/applications/firefox.desktop &lt;&lt; "EOF" &amp;&amp;
477<literal>[Desktop Entry]
478Encoding=UTF-8
479Name=Firefox Web Browser
480Comment=Browse the World Wide Web
481GenericName=Web Browser
482Exec=firefox %u
483Terminal=false
484Type=Application
485Icon=firefox
486Categories=GNOME;GTK;Network;WebBrowser;
487MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https;
488StartupNotify=true</literal>
489EOF
490
491ln -sfv /usr/lib/firefox/browser/chrome/icons/default/default128.png \
492 /usr/share/pixmaps/firefox.png</userinput></screen>
493
494 <sect3><title>Configuration Information</title>
495
496 <para>
497 The application settings for firefox are accessible by keying
498 <command>about:config</command> in the address bar.
499 </para>
500
501 <para>
502 With this version of <application>firefox</application>, getting
503 working sound can be a problem. Although upstream prefers pulseaudio,
504 on balance using <application>Alsa</application> may be easier.
505 </para>
506
507 <para>
508 If you enabled <application>Alsa</application> for sound, you may need
509 to alter one variable to get working sound. If you run
510 <command>firefox</command> from a term and try to play something with
511 sound you might encounter error messages like:
512 </para>
513
514 <para>
515 <literal>Sandbox: seccomp sandbox violation: pid 3941, tid 4030,
516 syscall 16, args 48 2147767296 139909894784796 0 0 0.</literal>
517 </para>
518
519 <para>
520 That was on x86_64, on i686 the syscall number is 54. To allow this
521 syscall, in <command>about:config</command> change
522 <command>security.sandbox.content.syscall_whitelist</command> to 16
523 (or 54 if using i686).
524 </para>
525
526 <para>
527 If you use <command>pulseaudio</command> in a Desktop Environment, it
528 might already be started by that DE. But if it is not, although
529 firefox-57 managed to start it, firefox-58 did not. If you run
530 <command>firefox</command> from a term and this problem is present,
531 trying to play sound will
532 encounter error messages warning <literal>Can't get cubeb
533 context!</literal>
534 </para>
535
536 <para>
537 The fix for this is to close firefox, start pulseaudio to check it
538 does start (if not, read the information on Configuring in <xref
539 linkend="pulseaudio"/>) and restart firefox to check it is working.
540 If it now works, add the following to your <filename>~/.xinitrc</filename>:
541<phrase revision="sysv">
542<literal>pulseaudio --verbose --log-target=syslog&amp;</literal></phrase>
543<phrase revision="systemd">
544<literal>pulseaudio --verbose --log-target=journald&amp;</literal></phrase>
545 (unfortunately, on some systems this does not work).
546 </para>
547
548 <para>
549 You may wish to use multiple profiles within firefox. To do that, invoke
550 firefox as <command>firefox --ProfileManager</command>. You can also
551 check which profile is currently in use from
552 <command>about:profiles</command>.
553 </para>
554
555 </sect3>
556 </sect2>
557
558 <sect2 role="content">
559 <title>Contents</title>
560
561 <segmentedlist>
562 <segtitle>Installed Programs</segtitle>
563 <segtitle>Installed Libraries</segtitle>
564 <segtitle>Installed Directory</segtitle>
565
566 <seglistitem>
567 <seg>
568 firefox
569 </seg>
570 <seg>
571 Numerous libraries, browser components, plugins, extensions, and
572 helper modules installed in /usr/lib/firefox
573 </seg>
574 <seg>
575 /usr/lib/firefox and /usr/lib/mozilla
576 </seg>
577 </seglistitem>
578 </segmentedlist>
579
580 <variablelist>
581 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
582 <?dbfo list-presentation="list"?>
583 <?dbhtml list-presentation="table"?>
584
585 <varlistentry id="firefox-prog">
586 <term><command>firefox</command></term>
587 <listitem>
588 <para>
589 is a <application>GTK+-3</application> internet browser that uses
590 the Mozilla Gecko rendering engine.
591 </para>
592 <indexterm zone="firefox firefox-prog">
593 <primary sortas="b-firefox">firefox</primary>
594 </indexterm>
595 </listitem>
596 </varlistentry>
597
598 </variablelist>
599
600 </sect2>
601
602</sect1>
Note: See TracBrowser for help on using the repository browser.