source: xsoft/graphweb/firefox.xml@ d5d7cd6

10.0 10.1 11.0 ken/refactor-virt lazarus qt5new trunk upgradedb xry111/git-date xry111/git-date-for-trunk xry111/git-date-test
Last change on this file since d5d7cd6 was d5d7cd6, checked in by Ken Moffat <ken@…>, 18 months ago

Firefox-78.0esr.

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

  • Property mode set to 100644
File size: 23.0 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;esr/source/firefox-&firefox-version;esr.source.tar.xz">
8 <!ENTITY firefox-download-ftp " ">
9 <!ENTITY firefox-md5sum "0a095e672a2e1e468a21a0d0c9a328ae">
10 <!ENTITY firefox-size "318 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 "4.9 GB (184 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 "32 SBU (on a 4-core machine) 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 &lfs91_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 <note>
79 <para>
80 The directory name is firefox-&firefox-version;
81 </para>
82
83 <para>
84 Extracting the tarball
85 will reset the permissions of the current directory to 0755 if you
86 have permission to do that. If you do this in a directory where
87 the sticky bit is set, such
88 as <filename class="directory">/tmp</filename> it will end with error
89 messages:
90 </para>
91
92<literallayout>tar: .: Cannot utime: Operation not permitted
93tar: .: Cannot change mode to rwxr-xr-t: Operation not permitted
94tar: Exiting with failure status due to previous errors
95</literallayout>
96
97 <para>
98 This does finish with non-zero status, but it does
99 <emphasis>NOT</emphasis> mean there is a real problem.
100 Do not untar as the <systemitem class="username">root</systemitem> user
101 in a directory where the sticky bit is set - that will unset it.
102 </para>
103
104 <para>
105 As with other large packages which use C++ (or rust), the SBU times
106 to build this vary more widely than you might expect. The build times
107 will increase significantly if your machine has to swap.
108 </para>
109
110 <!-- commented, by 78.0 it seems to work reliably
111 <para>
112 The mach build system (Python scripts) can be somewhat unreliable: if
113 the build fails and reports an Error, it can still return a status of
114 success, causing a scripted build to try to install (which does not rerun
115 the build), fail during the preparations for installing, but still exit
116 with a status of success. Also, on occasion it may limit itself to only
117 running one set of jobs - that will make the build take about 3 times as
118 long as running with four sets of jobs.
119 </para>-->
120
121 <para>
122 Although upstream prefer to use <application>PulseAudio</application>,
123 for the moment <application>Alsa</application> can still be used. Both
124 may need runtime configuration to get sound working.
125 </para>
126 </note>
127
128 <bridgehead renderas="sect3">Firefox Dependencies</bridgehead>
129
130 <bridgehead renderas="sect4">Required</bridgehead>
131 <para role="required">
132 <xref linkend="autoconf213"/>,
133 <xref linkend="cbindgen"/>,
134 <xref linkend="dbus-glib"/>,
135 both <xref linkend="gtk3"/> and
136 <xref linkend="gtk2"/>,
137 <xref linkend="libnotify"/>,
138 <xref linkend="nodejs"/>,
139 <xref linkend="nss"/>,
140 <xref linkend="pulseaudio"/>
141 (or
142 <xref linkend="alsa-lib"/> if you edit the mozconfig;
143 now deprecated by mozilla), in either case please read the
144 Configuration Information,
145 <!-- rustc is required by cbindgen so not needed here
146 <xref linkend="rust"/>,-->
147 <xref linkend="startup-notification"/>,
148 <xref linkend="unzip"/>,
149 <xref linkend="yasm"/>, and
150 <xref linkend="zip"/>
151 </para>
152
153 <bridgehead renderas="sect4">Recommended</bridgehead>
154 <para role="recommended">
155 <xref linkend="icu"/>,
156 <xref linkend="libevent"/>,
157 <xref linkend="libwebp"/>,
158 <xref linkend="nasm"/>
159 </para>
160
161 <note>
162 <para>
163 If you don't install recommended dependencies, then internal copies of
164 those packages will be used. They might be tested to work, but they can
165 be out of date or contain security holes.
166 </para>
167 </note>
168
169 <bridgehead renderas="sect4">Optional</bridgehead>
170 <para role="optional">
171 <xref linkend="curl"/>,
172 <xref linkend="doxygen"/>,
173 <xref role="runtime" linkend="ffmpeg"/> (runtime, to play mov, mp3 or mp4 files),
174 <!-- <phrase revision="sysv"><ulink url="http://sourceforge.net/projects/liboauth/files/">liboauth</ulink></phrase> -->
175 <xref linkend="liboauth"/>,
176 <xref linkend="openjdk"/>,
177 <xref linkend="valgrind"/>,
178 <xref linkend="wget"/>,
179 <xref linkend="wireless_tools"/>,
180 <ulink url="https://github.com/libproxy/libproxy">libproxy</ulink>
181 </para>
182
183 <para condition="html" role="usernotes">
184 User Notes: <ulink url="&blfs-wiki;/firefox"/>
185 </para>
186 </sect2>
187
188 <sect2 role="installation">
189 <title>Installation of Firefox</title>
190
191 <para>
192 The configuration of <application>Firefox</application> is accomplished
193 by creating a <filename>mozconfig</filename> file containing the desired
194 configuration options. A default <filename>mozconfig</filename> is
195 created below. To see the entire list of available configuration options
196 (and an abbreviated description of some of them), issue <command>./mach
197 configure &amp;&amp; ./configure --help | less</command>. You may also
198 wish to review the entire file and uncomment any other desired options.
199 Create the file by issuing the following command:
200 </para>
201
202<screen><userinput>cat &gt; mozconfig &lt;&lt; "EOF"
203<literal># If you have a multicore machine, all cores will be used by default.
204
205# If you have installed (or will install) wireless-tools, and you wish
206# to use geolocation web services, comment out this line
207ac_add_options --disable-necko-wifi
208
209# API Keys for geolocation APIs - necko-wifi (above) is required for MLS
210# Uncomment the following line if you wish to use Mozilla Location Service
211#ac_add_options --with-mozilla-api-keyfile=$PWD/mozilla-key
212
213# Uncomment the following line if you wish to use Google's geolocaton API
214# (needed for use with saved maps with Google Maps)
215#ac_add_options --with-google-location-service-api-keyfile=$PWD/google-key
216
217# startup-notification is required since firefox-78
218
219# Uncomment the following option if you have not installed PulseAudio
220#ac_add_options --disable-pulseaudio
221# or uncomment this if you installed alsa-lib instead of PulseAudio
222#ac_add_options --enable-alsa
223
224# Comment out following options if you have not installed
225# recommended dependencies:
226ac_add_options --with-system-libevent
227ac_add_options --with-system-webp
228ac_add_options --with-system-nspr
229ac_add_options --with-system-nss
230ac_add_options --with-system-icu
231
232# Do not specify the gold linker which is not the default. It will take
233# longer and use more disk space when debug symbols are disabled.
234
235# libdavid (av1 decoder) requires nasm. Uncomment this if nasm
236# has not been installed.
237#ac_add_options --disable-av1
238
239# You cannot distribute the binary if you do this
240ac_add_options --enable-official-branding
241
242# Stripping is now enabled by default.
243# Uncomment these lines if you need to run a debugger:
244#ac_add_options --disable-strip
245#ac_add_options --disable-install-strip
246
247# Disabling debug symbols makes the build much smaller and a little
248# faster. Comment this if you need to run a debugger. Note: This is
249# required for compilation on i686.
250ac_add_options --disable-debug-symbols
251
252# The elf-hack is reported to cause failed installs (after successful builds)
253# on some machines. It is supposed to improve startup time and it shrinks
254# libxul.so by a few MB - comment this if you know your machine is not affected.
255ac_add_options --disable-elf-hack
256
257# The BLFS editors recommend not changing anything below this line:
258ac_add_options --prefix=/usr
259ac_add_options --enable-application=browser
260ac_add_options --disable-crashreporter
261ac_add_options --disable-updater
262# enabling the tests will use a lot more space and significantly
263# increase the build time, for no obvious benefit.
264ac_add_options --disable-tests
265
266# The default level of optimization again produces a working build with gcc.
267ac_add_options --enable-optimize
268
269ac_add_options --enable-system-ffi
270ac_add_options --enable-system-pixman
271
272# --with-system-bz2 was removed in firefox-78
273ac_add_options --with-system-jpeg
274ac_add_options --with-system-png
275ac_add_options --with-system-zlib
276
277# The following option unsets Telemetry Reporting. With the Addons Fiasco,
278# Mozilla was found to be collecting user's data, including saved passwords and
279# web form data, without users consent. Mozilla was also found shipping updates
280# to systems without the user's knowledge or permission.
281# As a result of this, use the following command to permanently disable
282# telemetry reporting in Firefox.
283unset MOZ_TELEMETRY_REPORTING
284
285mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/firefox-build-dir</literal>
286EOF</userinput></screen>
287
288 <para>
289 Compile <application>Firefox</application> by issuing the following
290 commands:
291 </para>
292
293 <para>
294 In the esr version of firefox-78, the code to ensure that add-ons
295 are signed by the trused root has been disabled, presumably for
296 organizations which require their own add-ons. To enable it as an
297 added security measure issue the following command:
298 </para>
299
300<screen><userinput>sed -i -e 's/Disable/Enable/' \
301 -e '/^MOZ_REQUIRE_SIGNING/s/0/1/' \
302 build/mozconfig.common</userinput></screen>
303
304 <para>
305 If the geolocation APIs are needed:
306 </para>
307
308 <note>
309 <para>
310 <!-- Taken from Arch Linux - an immensely helpful link - Thanks -->
311 The Google and Mozilla API Keys below are specific to LFS. If using
312 these instructions for another distro, or if you intend to distribute
313 binary copies of the software using these instructions, please obtain
314 your own keys following the instructions located at
315 <ulink url="http://www.chromium.org/developers/how-tos/api-keys"/> and
316 <ulink url="https://location.services.mozilla.com/api"/> respectively.
317 <!-- BLFS Devs, register an account at Google with your
318 @linuxfromscratch.org email address, and I'll make you an administrator
319 for the 'Google APIs for LFS' project (where the API and OAuth keys
320 were created for use in the book).-->
321 </para>
322 </note>
323
324<screen><userinput>echo "AIzaSyDxKL42zsPjbke5O8_rPVpVrLrJ8aeE9rQ" > google-key
325echo "613364a7-9418-4c86-bcee-57e32fd70c23" > mozilla-key</userinput></screen>
326
327 <note>
328
329 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
330 href="../../xincludes/mozshm.xml"/>
331
332 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
333 href="../../xincludes/mozmach.xml"/>
334
335 </note>
336 <!--
337 <para>
338 If you are building on i686, apply a fix to prevent Internal Compiler
339 Errors in GCC-7+:
340 </para>
341
342<screen><userinput remap="pre">case $(uname -m) in
343 i?86) sed -i "562 s/mips64/i386/" gfx/skia/skia/third_party/skcms/src/Transform_inl.h ;;
344esac</userinput></screen>
345 -->
346
347 <para>
348 Now invoke the Python script to compile the package.
349 </para>
350
351<screen><userinput>export CC=gcc CXX=g++ &amp;&amp;
352export MOZBUILD_STATE_PATH=${PWD}/mozbuild &amp;&amp;
353./mach build</userinput></screen>
354
355 <para>
356 The <filename>mozconfig</filename> above disables the tests because
357 they use a lot more time and disk space for no obvious benefit. If
358 you have nevertheless enabled them, you can run the tests by executing
359 <command>./mach gtest</command>. This will require a network connection,
360 and to be run from within an Xorg session - there is a popup dialog
361 when it fails to connect to ALSA (that does not create a failed test).
362 One or two tests will fail. To see the details of the failure(s) you
363 will need to log the output from that command so that you can review it.
364 </para>
365
366 <para>
367 Now, as the <systemitem class="username">root</systemitem> user:
368 </para>
369
370<screen role="root"><userinput>./mach install &amp;&amp;
371
372mkdir -pv /usr/lib/mozilla/plugins &amp;&amp;
373ln -sfv ../../mozilla/plugins /usr/lib/firefox/browser/</userinput></screen>
374
375 <para>
376 Set environment variables back to their values:
377 </para>
378
379<screen><userinput>unset CC CXX MOZBUILD_STATE_PATH</userinput></screen>
380
381 </sect2>
382
383 <sect2 role="commands">
384 <title>Command Explanations</title>
385
386<!--<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
387 href="../../xincludes/SIOCGSTAMP.xml"/>-->
388
389 <para>
390 <command>export CC=gcc CXX=g++ ...</command>: Upstream now prefer
391 <application>clang</application> so that they can use one compiler
392 everywhere. On the X86 architectures <application>clang</application>
393 now appears to support the same security-hardening options as
394 <application>GCC</application>. With the current versions,
395 <application>GCC</application> creates a marginally bigger build but
396 takes typically 2 SBU less time on a 4-core machine using the mozconfig
397 above.
398 </para>
399
400 <para>
401 <command>export MOZBUILD_STATE_PATH=${PWD}/mozbuild</command>: The build
402 is now supposed to tell you that it intends to create <filename
403 class="directory">~/.mozbuild</filename>, and offer you an option to
404 press &lt;ENTER&gt; to accept this, or Ctrl-C to cancel and restart the
405 build after specifying the directory. In practice, the message may not
406 appear until after &lt;ENTER&gt; is keyed, i.e. the build stalls.
407 </para>
408
409 <para>
410 That directory is used for a (probably random) telemetry identifier.
411 Creating this in the build directory, and deleting that after the
412 installation, prevents it being used. If you wish to participate in
413 telemetry, export MOZBUILD_STATE_PATH to point to its default directory.
414 </para>
415
416 <para>
417 <command>./mach build</command>: <application>Firefox</application>
418 now uses this <application>python</application> script to run the
419 build and install.
420 </para>
421
422 <para>
423 <option>./mach build --verbose</option>: Use this alternative if you
424 need details of which files are being compiled, together with any C or
425 C++ flags being used. But do not add '--verbose' to the install command,
426 it is not accepted there.
427 </para>
428
429 <para>
430 <option>./mach build -jN</option>: The build should, by default, use
431 all the online CPU cores. If using all the cores causes the build to swap
432 because you have insufficient memory, using fewer cores can be faster.
433 </para>
434
435 <para>
436 <command>mkdir -pv /usr/lib/mozilla/plugins</command>: This ensures
437 that <filename class="directory">/usr/lib/mozilla/plugins/</filename>
438 exists.
439 </para>
440
441 <para>
442 <command>ln -sv ... /usr/lib/firefox/browser</command>:
443 This command creates a symbolic link to <filename
444 class="directory">/usr/lib/mozilla/plugins</filename>. It's not really
445 needed, as <application>Firefox</application> checks <filename
446 class="directory">/usr/lib/mozilla/plugins</filename> by default, but the
447 symbolic link is made to keep all the plugins installed in one folder.
448 </para>
449
450 </sect2>
451
452 <sect2 role="configuration">
453 <title>Configuring Firefox</title>
454
455 <para>
456 If you use a desktop environment like <application>Gnome</application> or
457 <application>KDE</application> you may like to create a
458 <filename>firefox.desktop</filename> file so that
459 <application>Firefox</application> appears in the panel's menus. If you
460 didn't enable startup-notification in your mozconfig change the
461 StartupNotify line to false. As the
462 <systemitem class="username">root</systemitem> user:
463 </para>
464
465<screen role="root"><userinput>mkdir -pv /usr/share/applications &amp;&amp;
466mkdir -pv /usr/share/pixmaps &amp;&amp;
467
468cat &gt; /usr/share/applications/firefox.desktop &lt;&lt; "EOF" &amp;&amp;
469<literal>[Desktop Entry]
470Encoding=UTF-8
471Name=Firefox Web Browser
472Comment=Browse the World Wide Web
473GenericName=Web Browser
474Exec=firefox %u
475Terminal=false
476Type=Application
477Icon=firefox
478Categories=GNOME;GTK;Network;WebBrowser;
479MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https;
480StartupNotify=true</literal>
481EOF
482
483ln -sfv /usr/lib/firefox/browser/chrome/icons/default/default128.png \
484 /usr/share/pixmaps/firefox.png</userinput></screen>
485
486 <sect3><title>Configuration Information</title>
487
488 <para>
489 The application settings for firefox are accessible by keying
490 <command>about:config</command> in the address bar.
491 </para>
492
493 <para>
494 Occasionally, getting working sound in
495 <application>firefox</application> can be a problem. Although upstream
496 prefers pulseaudio,
497 on balance using <application>Alsa</application> may be easier.
498 </para>
499
500 <para>
501 If you enabled <application>Alsa</application> for sound, you may need
502 to alter one variable to get working sound. If you run
503 <command>firefox</command> from a term and try to play something with
504 sound you might encounter error messages like:
505 </para>
506
507 <para>
508 <literal>Sandbox: seccomp sandbox violation: pid 3941, tid 4030,
509 syscall 16, args 48 2147767296 139909894784796 0 0 0.</literal>
510 </para>
511
512 <para>
513 That was on x86_64, on i686 the syscall number is 54. To allow this
514 syscall, in <command>about:config</command> change
515 <command>security.sandbox.content.syscall_whitelist</command> to 16
516 (or 54 if using i686).
517 </para>
518
519 <para>
520 If you use <command>pulseaudio</command> in a Desktop Environment, it
521 might already be started by that DE. But if it is not, although
522 firefox-57 managed to start it, firefox-58 did not. If you run
523 <command>firefox</command> from a term and this problem is present,
524 trying to play sound will
525 encounter error messages warning <literal>Can't get cubeb
526 context!</literal>
527 </para>
528
529 <para>
530 The fix for this is to close firefox, start pulseaudio to check it
531 does start (if not, read the information on Configuring in <xref
532 linkend="pulseaudio"/>) and restart firefox to check it is working.
533 If it now works, add the following to your <filename>~/.xinitrc</filename>:
534<phrase revision="sysv">
535<literal>pulseaudio --verbose --log-target=syslog&amp;</literal></phrase>
536<phrase revision="systemd">
537<literal>pulseaudio --verbose --log-target=journald&amp;</literal></phrase>
538 (unfortunately, on some systems this does not work).
539 </para>
540
541 <para>
542 You may wish to use multiple profiles within firefox. To do that, invoke
543 firefox as <command>firefox --ProfileManager</command>. You can also
544 check which profile is currently in use from
545 <command>about:profiles</command>.
546 </para>
547
548 <para>
549 Although WebRender (using the GPU for compositing) is not used by
550 default, it now appears to work well on supported hardware (ATI, Nvidia
551 and Intel GPUs with Mesa-18 or later. For an explanation, please see
552 <ulink
553 url="https://hacks.mozilla.org/2017/10/the-whole-web-at-maximum-fps-how-webrender-gets-rid-of-jank/">hacks.mozilla.org</ulink>.
554 The only downside seems to be that on a machine with limited RAM it might
555 use more RAM.
556 </para>
557
558 <para>
559 To check if WebRender is being used, look in about:support. In the Graphics
560 section Compositing will either show 'Basic' (i.e. not in use) or
561 'WebRender'. To enable it, go to about:config and change gfx.webrender.all
562 to True. You will need to restart firefox.
563 </para>
564
565 <para>
566 It may be useful to mention the processes from firefox which can appear in
567 <command>top</command> - as well as firefox itself, there may be multiple
568 Web Content processes, and now an RDD Process (Remote Data Decoder) which
569 appears when playing web videos encoded with av1 (libdav1d). If WebRender
570 has been enabled, a GPU Process will also appear when firefox has to
571 repaint (e.g. scrolling, opening a new tab, or playing a video).
572 </para>
573
574 </sect3>
575 </sect2>
576
577 <sect2 role="content">
578 <title>Contents</title>
579
580 <segmentedlist>
581 <segtitle>Installed Programs</segtitle>
582 <segtitle>Installed Libraries</segtitle>
583 <segtitle>Installed Directory</segtitle>
584
585 <seglistitem>
586 <seg>
587 firefox
588 </seg>
589 <seg>
590 Numerous libraries, browser components, plugins, extensions, and
591 helper modules installed in /usr/lib/firefox
592 </seg>
593 <seg>
594 /usr/lib/firefox and /usr/lib/mozilla
595 </seg>
596 </seglistitem>
597 </segmentedlist>
598
599 <variablelist>
600 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
601 <?dbfo list-presentation="list"?>
602 <?dbhtml list-presentation="table"?>
603
604 <varlistentry id="firefox-prog">
605 <term><command>firefox</command></term>
606 <listitem>
607 <para>
608 is a <application>GTK+-3</application> internet browser that uses
609 the Mozilla Gecko rendering engine.
610 </para>
611 <indexterm zone="firefox firefox-prog">
612 <primary sortas="b-firefox">firefox</primary>
613 </indexterm>
614 </listitem>
615 </varlistentry>
616
617 </variablelist>
618
619 </sect2>
620
621</sect1>
Note: See TracBrowser for help on using the repository browser.