source: xsoft/graphweb/firefox.xml@ 703f0ce

10.0 10.1 11.0 11.1 11.2 9.1 lazarus plabs/python-mods qt5new trunk upgradedb xry111/intltool xry111/soup3 xry111/test-20220226
Last change on this file since 703f0ce was 703f0ce, checked in by Ken Moffat <ken@…>, 3 years ago

firefox-69.0

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

  • Property mode set to 100644
File size: 23.6 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 "22e8ec79442d04cfc63c5822b321cd9c">
10 <!ENTITY firefox-size "309 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.2 GB (165 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 (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 &lfs90_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 <!-- with ff-69.0 the configure system was happy to continue to disable
142 dbus-glib, but linking libxul.so failed because rust code uses it, so
143 make it required and remove from mozconfig : ken -->
144 <xref linkend="dbus-glib"/>,
145 both <xref linkend="gtk3"/> and
146 <xref linkend="gtk2"/>,
147 <xref linkend="libnotify"/>,
148 <xref linkend="nodejs"/>,
149 <xref linkend="nss"/>,
150 <xref linkend="pulseaudio"/>
151 (or
152 <xref linkend="alsa-lib"/> if you edit the mozconfig;
153 now deprecated by mozilla), in either case please read the
154 Configuration Information,
155 <xref linkend="rust"/>,
156 <xref linkend="unzip"/>,
157 <xref linkend="yasm"/>, and
158 <xref linkend="zip"/>
159 </para>
160
161 <bridgehead renderas="sect4">Recommended</bridgehead>
162 <para role="recommended">
163 <xref linkend="icu"/>,
164 <xref linkend="libevent"/>,
165<!-- fails to build in 65.0 (headers changed)
166 <xref linkend="libvpx"/>, -->
167 <xref linkend="libwebp"/>,
168 <xref linkend="nasm"/>, and
169 <xref linkend="sqlite"/>
170 </para>
171
172 <note>
173 <para>
174 If you don't install recommended dependencies, then internal copies of
175 those packages will be used. They might be tested to work, but they can
176 be out of date or contain security holes.
177 </para>
178 </note>
179
180 <bridgehead renderas="sect4">Optional</bridgehead>
181 <para role="optional">
182 <xref linkend="curl"/>,
183 <xref linkend="doxygen"/>,
184 <xref role="runtime" linkend="ffmpeg"/> (runtime, to play mov, mp3 or mp4 files),
185 <!-- <phrase revision="sysv"><ulink url="http://sourceforge.net/projects/liboauth/files/">liboauth</ulink></phrase> -->
186 <xref linkend="liboauth"/>,
187 <xref linkend="openjdk"/>,
188 <xref linkend="startup-notification"/>,
189 <xref linkend="valgrind"/>,
190 <xref linkend="wget"/>,
191 <xref linkend="wireless_tools"/>,
192 <ulink url="https://github.com/libproxy/libproxy">libproxy</ulink>,
193 and (with the patch)
194 <xref linkend="graphite2"/> and
195 <xref linkend="harfbuzz"/>
196 </para>
197
198 <para condition="html" role="usernotes">
199 User Notes: <ulink url="&blfs-wiki;/firefox"/>
200 </para>
201 </sect2>
202
203 <sect2 role="installation">
204 <title>Installation of Firefox</title>
205
206 <para>
207 The configuration of <application>Firefox</application> is accomplished
208 by creating a <filename>mozconfig</filename> file containing the desired
209 configuration options. A default <filename>mozconfig</filename> is
210 created below. To see the entire list of available configuration options
211 (and an abbreviated description of some of them), issue <command>./mach
212 configure &amp;&amp; ./configure --help | less</command>. You may also
213 wish to review the entire file and uncomment any other desired options.
214 Create the file by issuing the following command:
215 </para>
216
217<screen><userinput>cat &gt; mozconfig &lt;&lt; "EOF"
218<literal># If you have a multicore machine, all cores will be used by default.
219
220# If you have installed (or will install) wireless-tools, and you wish
221# to use geolocation web services, comment out this line
222ac_add_options --disable-necko-wifi
223
224# API Keys for geolocation APIs - necko-wifi (above) is required for MLS
225# Uncomment the following line if you wish to use Mozilla Location Service
226#ac_add_options --with-mozilla-api-keyfile=$PWD/mozilla-key
227
228# Uncomment the following line if you wish to use Google's geolocaton API
229# (needed for use with saved maps with Google Maps)
230#ac_add_options --with-google-location-service-api-keyfile=$PWD/google-key
231
232# Uncomment this line if you have installed startup-notification:
233#ac_add_options --enable-startup-notification
234
235# Uncomment the following option if you have not installed PulseAudio
236#ac_add_options --disable-pulseaudio
237# or uncomment this if you installed alsa-lib instead of PulseAudio
238#ac_add_options --enable-alsa
239
240# Comment out following options if you have not installed
241# recommended dependencies:
242ac_add_options --enable-system-sqlite
243ac_add_options --with-system-libevent
244# firefox-65 understands webp and ships with an included copy
245ac_add_options --with-system-webp
246ac_add_options --with-system-nspr
247ac_add_options --with-system-nss
248ac_add_options --with-system-icu
249
250# Do not specify the gold linker which is not the default. It will take
251# longer and use more disk space when debug symbols are disabled.
252
253# libdavid (av1 decoder) requires nasm. Uncomment this if nasm
254# has not been installed.
255#ac_add_options --disable-av1
256
257# You cannot distribute the binary if you do this
258ac_add_options --enable-official-branding
259
260# If you are going to apply the patch for system graphite
261# and system harfbuzz, uncomment these lines:
262#ac_add_options --with-system-graphite2
263#ac_add_options --with-system-harfbuzz
264
265# Stripping is now enabled by default.
266# Uncomment these lines if you need to run a debugger:
267#ac_add_options --disable-strip
268#ac_add_options --disable-install-strip
269
270# Disabling debug symbols makes the build much smaller and a little
271# faster. Comment this if you need to run a debugger. Note: This is
272# required for compilation on i686.
273ac_add_options --disable-debug-symbols
274
275# The BLFS editors recommend not changing anything below this line:
276ac_add_options --prefix=/usr
277ac_add_options --enable-application=browser
278
279# The elf-hack is reported to cause failed installs (after successful builds)
280# on some machines. It is supposed to improve startup time and it shrinks
281# libxul.so by a few MB - comment this if you know your machine is not affected.
282ac_add_options --disable-elf-hack
283
284ac_add_options --disable-crashreporter
285ac_add_options --disable-updater
286# enabling the tests will use a lot more space and significantly
287# increase the build time, for no obvious benefit.
288ac_add_options --disable-tests
289
290# The default level of optimization again produces a working build with gcc.
291ac_add_options --enable-optimize
292
293# From firefox-61 system cairo is not supported
294
295ac_add_options --enable-system-ffi
296ac_add_options --enable-system-pixman
297
298# From firefox-62 --with-pthreads is not recognized
299
300ac_add_options --with-system-bz2
301ac_add_options --with-system-jpeg
302ac_add_options --with-system-png
303ac_add_options --with-system-zlib
304
305# The following option unsets Telemetry Reporting. With the Addons Fiasco,
306# Mozilla was found to be collecting user's data, including saved passwords and
307# web form data, without users consent. Mozilla was also found shipping updates
308# to systems without the user's knowledge or permission.
309# As a result of this, use the following command to permanently disable
310# telemetry reporting in Firefox.
311unset MOZ_TELEMETRY_REPORTING
312
313mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/firefox-build-dir</literal>
314EOF</userinput></screen>
315
316 <para>
317 Compile <application>Firefox</application> by issuing the following
318 commands:
319 </para>
320
321 <para>
322 If you have installed system versions of graphite2 and harfbuzz and wish
323 firefox to use those instead of its shipped versions, apply the patch and
324 uncomment the appropriate entries in the <filename>mozconfig</filename>
325 file.
326 </para>
327
328<screen><userinput>patch -Np1 -i ../firefox-&firefox-version;-system_graphite2_harfbuzz-1.patch</userinput></screen>
329
330 <para>
331 If the geolocation APIs are needed:
332 </para>
333
334 <note>
335 <para>
336 <!-- Taken from Arch Linux - an immensely helpful link - Thanks -->
337 The Google and Mozilla API Keys below are specific to LFS. If using
338 these instructions for another distro, or if you intend to distribute
339 binary copies of the software using these instructions, please obtain
340 your own keys following the instructions located at
341 <ulink url="http://www.chromium.org/developers/how-tos/api-keys"/> and
342 <ulink url="https://location.services.mozilla.com/api"/> respectively.
343 <!-- BLFS Devs, register an account at Google with your
344 @linuxfromscratch.org email address, and I'll make you an administrator
345 for the 'Google APIs for LFS' project (where the API and OAuth keys
346 were created for use in the book).-->
347 </para>
348 </note>
349
350<screen><userinput>echo "AIzaSyDxKL42zsPjbke5O8_rPVpVrLrJ8aeE9rQ" > google-key
351echo "d2284a20-0505-4927-a809-7ffaf4d91e55" > mozilla-key</userinput></screen>
352
353 <note><para>
354 If you are compiling <application>Firefox</application> in chroot, make
355 sure you have <envar>$SHELL</envar> environment variable set or prepend
356 <envar>SHELL=/bin/sh</envar>. Also ensure that <filename>/dev/shm</filename>
357 is mounted.
358 </para></note>
359
360 <para>
361 If you are building on i686, apply a fix to prevent Internal Compiler
362 Errors in GCC-7+:
363 </para>
364
365<screen><userinput remap="pre">case $(uname -m) in
366 i?86) sed -i "562 s/mips64/i386/" gfx/skia/skia/third_party/skcms/src/Transform_inl.h ;;
367esac</userinput></screen>
368
369 <para>
370 Now invoke the Python2 script to compile the package.
371 </para>
372
373<screen><userinput>export CC=gcc CXX=g++ &amp;&amp;
374export MOZBUILD_STATE_PATH=${PWD}/mozbuild &amp;&amp;
375./mach build</userinput></screen>
376
377 <para>
378 The <filename>mozconfig</filename> above disables the tests because
379 they use a lot more time and disk space for no obvious benefit. If
380 you have nevertheless enabled them, you can run the tests by executing
381 <command>./mach gtest</command>. This will require a network connection,
382 and to be run from within an Xorg session - there is a popup dialog
383 when it fails to connect to ALSA (that does not create a failed test).
384 One or two tests will fail. To see the details of the failure(s) you
385 will need to log the output from that command so that you can review it.
386 </para>
387
388 <para>
389 Now, as the <systemitem class="username">root</systemitem> user:
390 </para>
391
392<screen role="root"><userinput>./mach install &amp;&amp;
393
394mkdir -pv /usr/lib/mozilla/plugins &amp;&amp;
395ln -sfv ../../mozilla/plugins /usr/lib/firefox/browser/</userinput></screen>
396
397 <para>
398 Set environment variables back to their values:
399 </para>
400
401<screen><userinput>unset CC CXX MOZBUILD_STATE_PATH</userinput></screen>
402
403 </sect2>
404
405 <sect2 role="commands">
406 <title>Command Explanations</title>
407
408<!--<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
409 href="../../xincludes/SIOCGSTAMP.xml"/>-->
410
411 <para>
412 <command>sed -e 's/checkImpl/checkFFImpl/g' ...</command>: Although the
413 package ships with a modified version of <application>ICU-63</application>
414 and only tests that the system version, if used, is at least 63, changes
415 from upstream 63 cause builds with the system version to fail with an error
416 message <literal>no void JSContext::checkImpl_63 member function</literal>.
417 The sed renames the local function. Upstream ICU-64 works around this.
418 </para>
419
420 <para>
421 <command>export CC=gcc CXX=g++ ...</command>: Upstream now prefer
422 <application>clang</application>, but gcc is a more secure compiler and
423 now produces reasonably-sized builds.
424 </para>
425
426 <para>
427 <command>export MOZBUILD_STATE_PATH=${PWD}/mozbuild</command>: The build
428 is now supposed to tell you that it intends to create <filename
429 class="directory">~/.mozbuild</filename>, and offer you an option to
430 press &lt;ENTER&gt; to accept this, or Ctrl-C to cancel and restart the
431 build after specifying the directory. In practice, the message may not
432 appear until after &lt;ENTER&gt; is keyed, i.e. the build stalls.
433 </para>
434
435 <para>
436 That directory is used for a (probably random) telemetry identifier.
437 Creating this in the build directory, and deleting that after the
438 installation, prevents it being used. If you wish to participate in
439 telemetry, export MOZBUILD_STATE_PATH to point to its default directory.
440 </para>
441
442 <para>
443 <command>./mach build</command>: <application>Firefox</application>
444 now uses this <application>python2</application> script to run the
445 build and install.
446 </para>
447
448 <para>
449 <option>./mach build --verbose</option>: Use this alternative if you
450 need details of which files are being compiled, together with any C or
451 C++ flags being used.
452 </para>
453
454 <para>
455 <option>./mach build -jN</option>: The build should, by default, use
456 all the online CPU cores. There are two reasons to specify the number
457 of cores, e.g. -j4 for 4 cores: First, if using all the cores causes
458 the build to swap because you have insufficient memory (e.g. for 4 cores
459 a build without system graphite2 and harfbuzz now uses towards 8GB
460 of RAM). In such cases, using fewer cores can be faster. Second, on some
461 machines the middle part of the build can drag on as if only one core is
462 present. In those cases, specifying the number of cores may speed up the
463 build.
464 </para>
465
466 <para>
467 <command>mkdir -pv /usr/lib/mozilla/plugins</command>: This ensures
468 that <filename class="directory">/usr/lib/mozilla/plugins/</filename>
469 exists.
470 </para>
471
472 <para>
473 <command>ln -sv ... /usr/lib/firefox/browser</command>:
474 This command creates a symbolic link to <filename
475 class="directory">/usr/lib/mozilla/plugins</filename>. It's not really
476 needed, as <application>Firefox</application> checks <filename
477 class="directory">/usr/lib/mozilla/plugins</filename> by default, but the
478 symbolic link is made to keep all the plugins installed in one folder.
479 </para>
480
481 <para>
482 <option>export CC=clang CXX=clang++ AR=llvm-ar NM=llvm-nm RANLIB=llvm-ranlib</option>:
483 Use this as an alternative to building with gcc and g++ if you wish to use
484 the clang toolchain. Remember to unset these variables after the build.
485 </para>
486
487 </sect2>
488
489 <sect2 role="configuration">
490 <title>Configuring Firefox</title>
491
492 <para>
493 If you use a desktop environment like <application>Gnome</application> or
494 <application>KDE</application> you may like to create a
495 <filename>firefox.desktop</filename> file so that
496 <application>Firefox</application> appears in the panel's menus. If you
497 didn't enable startup-notification in your mozconfig change the
498 StartupNotify line to false. As the
499 <systemitem class="username">root</systemitem> user:
500 </para>
501
502<screen role="root"><userinput>mkdir -pv /usr/share/applications &amp;&amp;
503mkdir -pv /usr/share/pixmaps &amp;&amp;
504
505cat &gt; /usr/share/applications/firefox.desktop &lt;&lt; "EOF" &amp;&amp;
506<literal>[Desktop Entry]
507Encoding=UTF-8
508Name=Firefox Web Browser
509Comment=Browse the World Wide Web
510GenericName=Web Browser
511Exec=firefox %u
512Terminal=false
513Type=Application
514Icon=firefox
515Categories=GNOME;GTK;Network;WebBrowser;
516MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https;
517StartupNotify=true</literal>
518EOF
519
520ln -sfv /usr/lib/firefox/browser/chrome/icons/default/default128.png \
521 /usr/share/pixmaps/firefox.png</userinput></screen>
522
523 <sect3><title>Configuration Information</title>
524
525 <para>
526 The application settings for firefox are accessible by keying
527 <command>about:config</command> in the address bar.
528 </para>
529
530 <para>
531 With this version of <application>firefox</application>, getting
532 working sound can be a problem. Although upstream prefers pulseaudio,
533 on balance using <application>Alsa</application> may be easier.
534 </para>
535
536 <para>
537 If you enabled <application>Alsa</application> for sound, you may need
538 to alter one variable to get working sound. If you run
539 <command>firefox</command> from a term and try to play something with
540 sound you might encounter error messages like:
541 </para>
542
543 <para>
544 <literal>Sandbox: seccomp sandbox violation: pid 3941, tid 4030,
545 syscall 16, args 48 2147767296 139909894784796 0 0 0.</literal>
546 </para>
547
548 <para>
549 That was on x86_64, on i686 the syscall number is 54. To allow this
550 syscall, in <command>about:config</command> change
551 <command>security.sandbox.content.syscall_whitelist</command> to 16
552 (or 54 if using i686).
553 </para>
554
555 <para>
556 If you use <command>pulseaudio</command> in a Desktop Environment, it
557 might already be started by that DE. But if it is not, although
558 firefox-57 managed to start it, firefox-58 did not. If you run
559 <command>firefox</command> from a term and this problem is present,
560 trying to play sound will
561 encounter error messages warning <literal>Can't get cubeb
562 context!</literal>
563 </para>
564
565 <para>
566 The fix for this is to close firefox, start pulseaudio to check it
567 does start (if not, read the information on Configuring in <xref
568 linkend="pulseaudio"/>) and restart firefox to check it is working.
569 If it now works, add the following to your <filename>~/.xinitrc</filename>:
570<phrase revision="sysv">
571<literal>pulseaudio --verbose --log-target=syslog&amp;</literal></phrase>
572<phrase revision="systemd">
573<literal>pulseaudio --verbose --log-target=journald&amp;</literal></phrase>
574 (unfortunately, on some systems this does not work).
575 </para>
576
577 <para>
578 You may wish to use multiple profiles within firefox. To do that, invoke
579 firefox as <command>firefox --ProfileManager</command>. You can also
580 check which profile is currently in use from
581 <command>about:profiles</command>.
582 </para>
583
584 </sect3>
585 </sect2>
586
587 <sect2 role="content">
588 <title>Contents</title>
589
590 <segmentedlist>
591 <segtitle>Installed Programs</segtitle>
592 <segtitle>Installed Libraries</segtitle>
593 <segtitle>Installed Directory</segtitle>
594
595 <seglistitem>
596 <seg>
597 firefox
598 </seg>
599 <seg>
600 Numerous libraries, browser components, plugins, extensions, and
601 helper modules installed in /usr/lib/firefox
602 </seg>
603 <seg>
604 /usr/lib/firefox and /usr/lib/mozilla
605 </seg>
606 </seglistitem>
607 </segmentedlist>
608
609 <variablelist>
610 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
611 <?dbfo list-presentation="list"?>
612 <?dbhtml list-presentation="table"?>
613
614 <varlistentry id="firefox-prog">
615 <term><command>firefox</command></term>
616 <listitem>
617 <para>
618 is a <application>GTK+-3</application> internet browser that uses
619 the Mozilla Gecko rendering engine.
620 </para>
621 <indexterm zone="firefox firefox-prog">
622 <primary sortas="b-firefox">firefox</primary>
623 </indexterm>
624 </listitem>
625 </varlistentry>
626
627 </variablelist>
628
629 </sect2>
630
631</sect1>
Note: See TracBrowser for help on using the repository browser.