source: xsoft/graphweb/firefox.xml@ 60a2f00

11.3 12.0 12.1 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt plabs/newcss python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk xry111/llvm18 xry111/xf86-video-removal
Last change on this file since 60a2f00 was 60a2f00, checked in by Bruce Dubbs <bdubbs@…>, 15 months ago

Use an entity for md5sums that are used more than once

  • Property mode set to 100644
File size: 23.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;esr/source/firefox-&firefox-version;esr.source.tar.xz">
8 <!ENTITY firefox-download-ftp " ">
9 <!ENTITY firefox-md5sum "&firefox-md5;">
10 <!ENTITY firefox-size "458 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 "7.1 GB (199 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 "20 SBU using -j4, without tests">
18]>
19
20<sect1 id="firefox" xreflabel="Firefox-&firefox-version;">
21 <?dbhtml filename="firefox.html" ?>
22
23
24<!-- indicate this is the ESR variant,
25 The point was that the 102.0 stable release differed slightly.
26 <title>Firefox-&firefox-version;</title>-->
27 <title>Firefox-&firefox-version;esr</title>
28
29 <indexterm zone="firefox">
30 <primary sortas="a-Firefox">Firefox</primary>
31 </indexterm>
32
33 <sect2 role="package">
34 <title>Introduction to Firefox</title>
35
36 <para>
37 <application>Firefox</application> is a stand-alone browser based on the
38 <application>Mozilla</application> codebase.
39 </para>
40
41 &lfs112_checked;
42
43 <bridgehead renderas="sect3">Package Information</bridgehead>
44 <itemizedlist spacing="compact">
45 <listitem>
46 <para>
47 Download (HTTP): <ulink url="&firefox-download-http;"/>
48 </para>
49 </listitem>
50 <listitem>
51 <para>
52 Download (FTP): <ulink url="&firefox-download-ftp;"/>
53 </para>
54 </listitem>
55 <listitem>
56 <para>
57 Download MD5 sum: &firefox-md5sum;
58 </para>
59 </listitem>
60 <listitem>
61 <para>
62 Download size: &firefox-size;
63 </para>
64 </listitem>
65 <listitem>
66 <para>
67 Estimated disk space required: &firefox-buildsize;
68 </para>
69 </listitem>
70 <listitem>
71 <para>
72 Estimated build time: &firefox-time;
73 </para>
74 </listitem>
75 </itemizedlist>
76
77<!--<bridgehead renderas="sect3">Additional Downloads</bridgehead>
78 <itemizedlist spacing="compact">
79 <listitem>
80 <para>
81 Required patch:
82 <ulink url="&patch-root;/firefox-&firefox-version;esr-gcc12_fix-1.patch"/>
83 </para>
84 </listitem>
85 <listitem>
86 <para>
87 Recommended patch:
88 <ulink url="&patch-root;/firefox-&firefox-version;esr-disable_rust_test-1.patch"/>
89 </para>
90 </listitem>
91 </itemizedlist>-->
92
93 <note>
94 <para>
95 The directory name is firefox-&firefox-version;
96 </para>
97
98 <para>
99 Extracting the tarball
100 will reset the permissions of the current directory to 0755 if you
101 have permission to do that. If you do this in a directory where
102 the sticky bit is set, such
103 as <filename class="directory">/tmp</filename> it will end with error
104 messages:
105 </para>
106
107<literallayout>tar: .: Cannot utime: Operation not permitted
108tar: .: Cannot change mode to rwxr-xr-t: Operation not permitted
109tar: Exiting with failure status due to previous errors
110</literallayout>
111
112 <para>
113 This does finish with non-zero status, but it does
114 <emphasis>NOT</emphasis> mean there is a real problem.
115 Do not untar as the <systemitem class="username">root</systemitem> user
116 in a directory where the sticky bit is set - that will unset it.
117 </para>
118
119 <para>
120 As with other large packages which use C++ (or rust), the SBU times
121 to build this vary more widely than you might expect. The build times
122 will increase significantly if your machine has to swap.
123 </para>
124
125 <para>
126 Although upstream prefer to use <application>PulseAudio</application>,
127 for the moment <application>Alsa</application> can still be used. Both
128 may need runtime configuration to get sound working.
129 </para>
130 </note>
131
132 <bridgehead renderas="sect3">Firefox Dependencies</bridgehead>
133
134 <bridgehead renderas="sect4">Required</bridgehead>
135 <para role="required">
136 <xref linkend="autoconf213"/>,
137 <xref linkend="cbindgen"/>,
138 <xref linkend="dbus-glib"/>,
139 <xref linkend="gtk3"/>,
140 <xref linkend="libnotify"/>,
141 <xref linkend="llvm"/> (with clang, used for bindgen even if using gcc),
142 <xref linkend="nodejs"/>,
143 <xref linkend="pulseaudio"/>
144 (or
145 <xref linkend="alsa-lib"/> if you edit the mozconfig;
146 now deprecated by mozilla), in either case please read the
147 Configuration Information,
148 <xref linkend="python3"/> (rebuilt after installing <xref linkend="sqlite"/>),
149 <xref linkend="startup-notification"/>,
150 <xref linkend="unzip"/>,
151 <xref linkend="yasm"/>, and
152 <xref linkend="zip"/>
153 </para>
154
155 <bridgehead renderas="sect4">Recommended</bridgehead>
156 <para role="recommended">
157 <xref linkend="icu"/>,
158 <xref linkend="libevent"/>,
159 <xref linkend="libvpx"/>,
160 <xref linkend="libwebp"/>,
161 <xref linkend="nasm"/>,
162 <xref linkend="nss"/>
163 </para>
164
165 <note>
166 <para>
167 If you don't install recommended dependencies, then internal copies of
168 those packages will be used. They might be tested to work, but they can
169 be out of date or contain security holes.
170 </para>
171 </note>
172
173 <bridgehead renderas="sect4">Optional</bridgehead>
174 <para role="optional">
175 <xref linkend="curl"/>,
176 <xref linkend="doxygen"/>,
177 <xref role="runtime" linkend="ffmpeg"/> (runtime, to play mov, mp3 or mp4 files),
178 <xref linkend="liboauth"/>,
179 <xref linkend="valgrind"/>,
180 <xref linkend="wget"/>,
181 <xref linkend="wireless_tools"/>,
182 <ulink url="https://github.com/libproxy/libproxy">libproxy</ulink>
183 </para>
184
185 <para condition="html" role="usernotes">
186 User Notes: <ulink url="&blfs-wiki;/firefox"/>
187 </para>
188 </sect2>
189
190 <sect2 role="installation">
191 <title>Installation of Firefox</title>
192
193 <para>
194 The configuration of <application>Firefox</application> is accomplished
195 by creating a <filename>mozconfig</filename> file containing the desired
196 configuration options. A default <filename>mozconfig</filename> is
197 created below. To see the entire list of available configuration options
198 (and an abbreviated description of some of them), issue <command>./mach
199 configure &amp;&amp; ./configure --help | less</command>. You may also
200 wish to review the entire file and uncomment any other desired options.
201 Create the file by issuing the following command:
202 </para>
203
204<screen><userinput>cat &gt; mozconfig &lt;&lt; "EOF"
205<literal># If you have a multicore machine, all cores will be used by default.
206
207# If you have installed (or will install) wireless-tools, and you wish
208# to use geolocation web services, comment out this line
209ac_add_options --disable-necko-wifi
210
211# API Keys for geolocation APIs - necko-wifi (above) is required for MLS
212# Uncomment the following line if you wish to use Mozilla Location Service
213#ac_add_options --with-mozilla-api-keyfile=$PWD/mozilla-key
214
215# Uncomment the following line if you wish to use Google's geolocation API
216# (needed for use with saved maps with Google Maps)
217#ac_add_options --with-google-location-service-api-keyfile=$PWD/google-key
218
219# startup-notification is required since firefox-78
220
221# Uncomment the following option if you have not installed PulseAudio and
222# want to use alsa instead
223#ac_add_options --enable-audio-backends=alsa
224
225# Comment out following options if you have not installed
226# recommended dependencies:
227ac_add_options --with-system-icu
228ac_add_options --with-system-libevent
229ac_add_options --with-system-libvpx
230ac_add_options --with-system-nspr
231ac_add_options --with-system-nss
232ac_add_options --with-system-webp
233
234# Unlike with thunderbird, although using the gold linker can
235# save four megabytes in the installed file it does not make
236# the build faster.
237
238# libdavid (av1 decoder) requires nasm. Uncomment this if nasm
239# has not been installed. Do not uncomment this if you have
240# ffmpeg-5 installed.
241#ac_add_options --disable-av1
242
243# You cannot distribute the binary if you do this
244ac_add_options --enable-official-branding
245
246# Stripping is now enabled by default.
247# Uncomment these lines if you need to run a debugger:
248#ac_add_options --disable-strip
249#ac_add_options --disable-install-strip
250
251# Disabling debug symbols makes the build much smaller and a little
252# faster. Comment this if you need to run a debugger. Note: This is
253# required for compilation on i686.
254ac_add_options --disable-debug-symbols
255
256# The elf-hack is reported to cause failed installs (after successful builds)
257# on some machines. It is supposed to improve startup time and it shrinks
258# libxul.so by a few MB - comment this if you know your machine is not affected.
259ac_add_options --disable-elf-hack
260
261# The BLFS editors recommend not changing anything below this line:
262ac_add_options --prefix=/usr
263ac_add_options --enable-application=browser
264ac_add_options --disable-crashreporter
265ac_add_options --disable-updater
266# enabling the tests will use a lot more space and significantly
267# increase the build time, for no obvious benefit.
268ac_add_options --disable-tests
269
270# The default level of optimization again produces a working build with gcc.
271ac_add_options --enable-optimize
272
273ac_add_options --enable-system-ffi
274ac_add_options --enable-system-pixman
275
276ac_add_options --with-system-jpeg
277ac_add_options --with-system-png
278ac_add_options --with-system-zlib
279
280# Using sandboxed wasm libraries has been moved to all builds instead
281# of only mozilla automation builds. It requires extra llvm packages
282# and was reported to seriously slow the build. Disable it.
283ac_add_options --without-wasm-sandboxed-libraries
284
285# The following option unsets Telemetry Reporting. With the Addons Fiasco,
286# Mozilla was found to be collecting user's data, including saved passwords and
287# web form data, without users consent. Mozilla was also found shipping updates
288# to systems without the user's knowledge or permission.
289# As a result of this, use the following command to permanently disable
290# telemetry reporting in Firefox.
291unset MOZ_TELEMETRY_REPORTING
292
293mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/firefox-build-dir</literal>
294EOF</userinput></screen>
295
296 <para>
297 Compile <application>Firefox</application> by issuing the following
298 commands:
299 </para>
300
301 <para>
302 A change in cbindgen-0.24.2 causes a symbol to now be output by
303 cbindgen, but it has already been defined in a header. This sed
304 prevents the build from eventually failing:
305 </para>
306
307<screen><userinput>sed -i '/ROOT_CLIP_CHAIN/d' gfx/webrender_bindings/webrender_ffi.h</userinput></screen>
308
309<!-- Not needed with clang. Upstream bug at
310 https://bugzilla.mozilla.org/show_bug.cgi?id=1729459
311
312 <para>
313 If building on a 32 bit machine, the following sed works around
314 an issue with an incompatible <quote>double</quote> type in one
315 header file:
316 </para>
317
318<screen><userinput>case "$(uname -m)" in
319 i?86) sed -e '/typedef[ ]*double/s/double/long double/' \
320 -i modules/fdlibm/src/math_private.h ;;
321esac</userinput></screen>
322-->
323 <para>
324 If the geolocation APIs are needed:
325 </para>
326
327 <note>
328 <para>
329 <!-- Taken from Arch Linux - an immensely helpful link - Thanks -->
330 The Google and Mozilla API Keys below are specific to LFS. If using
331 these instructions for another distro, or if you intend to distribute
332 binary copies of the software using these instructions, please obtain
333 your own keys following the instructions located at
334 <ulink url="http://www.chromium.org/developers/how-tos/api-keys"/> and
335 <ulink url="https://location.services.mozilla.com/api"/> respectively.
336 <!-- BLFS Devs, register an account at Google with your
337 @linuxfromscratch.org email address, and I'll make you an administrator
338 for the 'Google APIs for LFS' project (where the API and OAuth keys
339 were created for use in the book).-->
340 </para>
341 </note>
342
343<screen><userinput>echo "AIzaSyDxKL42zsPjbke5O8_rPVpVrLrJ8aeE9rQ" > google-key
344echo "613364a7-9418-4c86-bcee-57e32fd70c23" > mozilla-key</userinput></screen>
345
346 <note>
347
348 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
349 href="../../xincludes/mozshm.xml"/>
350
351 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
352 href="../../xincludes/mozmach.xml"/>
353
354 </note>
355
356 <para>
357 First remove an obsolete flag in python code, that has been removed
358 in python-3.11:
359 </para>
360
361<screen><userinput>grep -rl \"rU\" | xargs sed -i 's/"rU"/"r"/'</userinput></screen>
362
363 <para>
364 Then fix an issue with regular expressions in python-3.11:
365 </para>
366
367<screen><userinput>sed -e 's/?s)\./?s:.)/' \
368 -e '/?m)/{s/?m)/?m:/;s/\$"/$)"/}' \
369 -e '/?s)%/{s/?s)/?s:/;s/?"/?)"/}' \
370 -i xpcom/idl-parser/xpidl/xpidl.py</userinput></screen>
371
372 <para>
373 Now invoke the Python <command>mach</command> script to compile the package.
374 </para>
375
376<screen><userinput>export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=none &amp;&amp;
377export MOZBUILD_STATE_PATH=${PWD}/mozbuild &amp;&amp;
378./mach configure &amp;&amp;
379./mach build</userinput></screen>
380
381 <para>
382 The <filename>mozconfig</filename> above disables the tests because
383 they use a lot more time and disk space for no obvious benefit. If
384 you have nevertheless enabled them, you can run the tests by executing
385 <command>./mach gtest</command>. This will require a network connection,
386 and to be run from within an Xorg session - there is a popup dialog
387 when it fails to connect to ALSA (that does not create a failed test).
388 One or two tests will fail. To see the details of the failure(s) you
389 will need to log the output from that command so that you can review it.
390 </para>
391
392 <para>
393 Now, as the <systemitem class="username">root</systemitem> user:
394 </para>
395
396<screen role="root"><userinput>MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=none ./mach install</userinput></screen>
397
398 <para>
399 Empty the environment variables which were set above:
400 </para>
401
402<screen><userinput>unset MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE MOZBUILD_STATE_PATH</userinput></screen>
403
404 </sect2>
405
406 <sect2 role="commands">
407 <title>Command Explanations</title>
408
409<!--<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
410 href="../../xincludes/SIOCGSTAMP.xml"/>-->
411
412 <para>
413 <command>export MOZBUILD_STATE_PATH=${PWD}/mozbuild</command>: The build
414 is now supposed to tell you that it intends to create <filename
415 class="directory">~/.mozbuild</filename>, and offer you an option to
416 press &lt;ENTER&gt; to accept this, or Ctrl-C to cancel and restart the
417 build after specifying the directory. In practice, the message may not
418 appear until after &lt;ENTER&gt; is keyed, i.e. the build stalls.
419 </para>
420
421 <para>
422 That directory is used for a (probably random) telemetry identifier.
423 Creating this in the build directory, and deleting that after the
424 installation, prevents it being used. If you wish to participate in
425 telemetry, export MOZBUILD_STATE_PATH to point to its default directory
426 and remove the entry from the <filename>mozconfig</filename>.
427 </para>
428
429 <para>
430 <command>MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=none</command>: Use the
431 system python to create a virtual environment for <command>mach</command>
432 without downloading any python wheels nor using the system python modules.
433 This prevent version mismatches between system modules and bundled ones.
434 </para>
435
436 <para>
437 <command>./mach configure</command>: This validates the supplied
438 dependencies and the <filename>mozconfig</filename>.
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 since 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 <option><envar>CC=gcc CXX=g++</envar></option>: BLFS used to
456 prefer to use gcc and g++ instead of upstream's defaults of the
457 <application>clang</application> programs. With the release of
458 gcc-12 the build takes longer with gcc and g++, primarily because
459 of extra warnings, and is bigger. Set these environment variables
460 <emphasis>before you run the configure script</emphasis>
461 if you wish to continue to use gcc, g++. Building
462 with GCC on i?86 is currently broken.
463 </para>
464
465 </sect2>
466
467 <sect2 role="configuration">
468 <title>Configuring Firefox</title>
469
470 <para>
471 If you use a desktop environment like <application>Gnome</application> or
472 <application>KDE</application> you may want to create a
473 <filename>firefox.desktop</filename> file so that
474 <application>Firefox</application> appears in the panel's menus.
475 As the &root; user:
476 </para>
477
478<screen role="root"><userinput>mkdir -pv /usr/share/applications &amp;&amp;
479mkdir -pv /usr/share/pixmaps &amp;&amp;
480
481MIMETYPE="text/xml;text/mml;text/html;" &amp;&amp;
482MIMETYPE+="application/xhtml+xml;application/vnd.mozilla.xul+xml;" &amp;&amp;
483MIMETYPE+="x-scheme-handler/http;x-scheme-handler/https" &amp;&amp;
484
485cat &gt; /usr/share/applications/firefox.desktop &lt;&lt; EOF &amp;&amp;
486<literal>[Desktop Entry]
487Encoding=UTF-8
488Name=Firefox Web Browser
489Comment=Browse the World Wide Web
490GenericName=Web Browser
491Exec=firefox %u
492Terminal=false
493Type=Application
494Icon=firefox
495Categories=GNOME;GTK;Network;WebBrowser;
496MimeType=$MIMETYPE
497StartupNotify=true</literal>
498EOF
499
500unset MIMETYPE &amp;&amp;
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 terminal and try to play something
523 with 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 terminal 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
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.