source: xsoft/graphweb/firefox.xml@ 3f54026

10.0 10.1 11.0 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind ken/refactor-virt lazarus perl-modules qt5new trunk xry111/git-date xry111/git-date-for-trunk xry111/git-date-test
Last change on this file since 3f54026 was 3f54026, checked in by Ken Moffat <ken@…>, 4 years ago

Firefox: Actually apply the ffmpeg4 patch. Thanks to Thanos Baloukas for reporting.

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

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