source: xsoft/graphweb/firefox.xml@ f9c80c9

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 f9c80c9 was f9c80c9, checked in by Ken Moffat <ken@…>, 6 years ago

Firefox on e.g. youtube is broken with ffmpeg-4.0.0 - thanks to Brendan L for the notification and testing, and to Markku Pesonen. It seems likely that seamonkey may also need a similar fix, but I will leave that to someone who uses that package.

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

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