source: xsoft/graphweb/firefox.xml@ 512a8b2

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 512a8b2 was ece04000, checked in by Ken Moffat <ken@…>, 6 years ago

Now that Stylo is no-longer optional, and therefore not explained, minimally explain what it is in the mozconfig comment that it can no-longer be disabled.

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

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