source: xsoft/graphweb/firefox.xml@ 2c5bbb8

11.0 11.1 11.2 lazarus qt5new trunk upgradedb xry111/intltool xry111/soup3 xry111/test-20220226
Last change on this file since 2c5bbb8 was 2c5bbb8, checked in by Ken Moffat <ken@…>, 18 months ago

Firefox-78.9.0 and JS78.9.0.

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

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