source: xsoft/graphweb/firefox.xml@ 13a9b259

perl-modules
Last change on this file since 13a9b259 was 13a9b259, checked in by Ken Moffat <ken@…>, 5 years ago

perl modules branch: Merge trunk revisions 20626 to 20656.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/branches/perl-modules@20657 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 21.0 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 "17f6cea22026840dfa255190a7cec1e2">
10 <!ENTITY firefox-size "254 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.0 GB (153 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 in
16 doubt, round up -->
17 <!ENTITY firefox-time "22 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 &lfs83_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, 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 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 <application>Clang</application> (from <xref linkend="llvm"/>),
142 both <xref linkend="gtk3"/> and
143 <xref linkend="gtk2"/>,
144 <xref linkend="libnotify"/>,
145 <xref linkend="nss"/>,
146 <xref linkend="pulseaudio"/>
147 (or
148 <xref linkend="alsa-lib"/> if you edit the mozconfig;
149 now deprecated by mozilla), in either case please read the
150 Configuration Information,
151 <xref linkend="rust"/>,
152 <xref linkend="unzip"/>,
153 <xref linkend="yasm"/>, and
154 <xref linkend="zip"/>
155 </para>
156
157 <bridgehead renderas="sect4">Recommended</bridgehead>
158 <para role="recommended">
159<!-- <xref linkend="icu"/>, with icu <61 or >62, JSContext FTBFS -->
160 <xref linkend="libevent"/>,
161 <xref linkend="libvpx"/>,
162 <xref linkend="nodejs"/>, and
163 <xref linkend="sqlite"/>
164 </para>
165
166 <note>
167 <para>
168 If you don't install recommended dependencies, then internal copies of
169 those packages will be used. They might be tested to work, but they can
170 be out of date or contain security holes.
171 </para>
172 </note>
173
174 <bridgehead renderas="sect4">Optional</bridgehead>
175 <para role="optional">
176 <xref linkend="curl"/>,
177 <xref linkend="dbus-glib"/>,
178 <xref linkend="doxygen"/>,
179 <xref linkend="GConf"/>,
180 <xref role="runtime" linkend="ffmpeg"/> (runtime, to play mov, mp3 or mp4 files),
181 <xref linkend="libwebp"/>,
182 <xref linkend="openjdk"/>,
183 <xref linkend="startup-notification"/>,
184 <xref linkend="valgrind"/>,
185 <xref linkend="wget"/>,
186 <xref linkend="wireless_tools"/>,
187 <phrase revision="sysv"><ulink url="http://sourceforge.net/projects/liboauth/files/">liboauth</ulink></phrase>
188 <phrase revision="systemd"><xref linkend="liboauth"/></phrase>,
189 <ulink url="https://github.com/libproxy/libproxy">libproxy</ulink>,
190 and (with the patch)
191 <xref linkend="graphite2"/> and
192 <xref linkend="harfbuzz"/>
193 </para>
194
195 <para condition="html" role="usernotes">
196 User Notes: <ulink url="&blfs-wiki;/firefox"/>
197 </para>
198 </sect2>
199
200 <sect2 role="installation">
201 <title>Installation of Firefox</title>
202
203 <para>
204 The configuration of <application>Firefox</application> is accomplished
205 by creating a <filename>mozconfig</filename> file containing the desired
206 configuration options. A default <filename>mozconfig</filename> is
207 created below. To see the entire list of available configuration options
208 (and an abbreviated description of some of them), issue <command>./mach
209 configure &amp;&amp; ./configure --help | less</command>. You may also
210 wish to review the entire file and uncomment any other desired options.
211 Create the file by issuing the following command:
212 </para>
213
214<screen><userinput>cat &gt; mozconfig &lt;&lt; "EOF"
215<literal># If you have a multicore machine, all cores will be used by default.
216# You can change the number of non-rust jobs by setting a valid number
217# of cores in this option, but when rust crates are being compiled
218# jobs will be scheduled for all the available CPU cores.
219#mk_add_options MOZ_MAKE_FLAGS="-j1"
220
221# If you have installed dbus-glib, comment out this line:
222ac_add_options --disable-dbus
223
224# If you have installed dbus-glib, and you have installed (or will install)
225# wireless-tools, and you wish to use geolocation web services, comment out
226# this line
227ac_add_options --disable-necko-wifi
228
229# API Keys for geolocation APIs - necko-wifi (above) is required for MLS
230# Uncomment the following line if you wish to use Mozilla Location Service
231#ac_add_options --with-mozilla-api-keyfile=$PWD/mozilla-key
232
233# Uncomment the following line if you wish to use Google's geolocaton API
234# (needed for use with saved maps with Google Maps)
235#ac_add_options --with-google-api-keyfile=$PWD/google-key
236
237# Uncomment this line if you have installed startup-notification:
238#ac_add_options --enable-startup-notification
239
240# Uncomment the following option if you have not installed PulseAudio
241#ac_add_options --disable-pulseaudio
242# and uncomment this if you installed alsa-lib instead of PulseAudio
243#ac_add_options --enable-alsa
244
245# If you have installed GConf, comment out this line
246ac_add_options --disable-gconf
247
248# Uncomment this if you have not installed nodejs,
249# but note that nodejs will be required in firefox-64
250#ac_add_options --disable-nodejs
251
252# From firefox-61, the stylo CSS code can no-longer be disabled
253
254# Comment out following options if you have not installed
255# recommended dependencies:
256ac_add_options --enable-system-sqlite
257ac_add_options --with-system-libevent
258ac_add_options --with-system-libvpx
259ac_add_options --with-system-nspr
260ac_add_options --with-system-nss
261
262# Only enable system icu if the version is 61 or 62
263#ac_add_options --with-system-icu
264
265# The gold linker is no-longer the default
266ac_add_options --enable-linker=gold
267
268# You cannot distribute the binary if you do this
269ac_add_options --enable-official-branding
270
271# If you are going to apply the patch for system graphite
272# and system harfbuzz, uncomment these lines:
273#ac_add_options --with-system-graphite2
274#ac_add_options --with-system-harfbuzz
275
276# Stripping is now enabled by default.
277# Uncomment these lines if you need to run a debugger:
278#ac_add_options --disable-strip
279#ac_add_options --disable-install-strip
280
281# The BLFS editors recommend not changing anything below this line:
282ac_add_options --prefix=/usr
283ac_add_options --enable-application=browser
284
285ac_add_options --disable-crashreporter
286ac_add_options --disable-updater
287# enabling the tests will use a lot more space and significantly
288# increase the build time, for no obvious benefit.
289ac_add_options --disable-tests
290
291# Optimization for size is broken with gcc7 and later
292ac_add_options --enable-optimize="-O2"
293
294# From firefox-61 system cairo is not supported
295
296ac_add_options --enable-system-ffi
297ac_add_options --enable-system-pixman
298
299# From firefox-62 --with-pthreads is not recognized
300
301ac_add_options --with-system-bz2
302ac_add_options --with-system-jpeg
303ac_add_options --with-system-png
304ac_add_options --with-system-zlib
305
306mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/firefox-build-dir</literal>
307EOF</userinput></screen>
308
309 <para>
310 Compile <application>Firefox</application> by issuing the following
311 commands:
312 </para>
313
314 <para>
315 If you have installed system versions of graphite2 and harfbuzz and wish
316 firefox to use those instead of its shipped versions, apply the patch and
317 uncomment the appropriate entries in the <filename>mozconfig</filename>
318 file.
319 </para>
320
321<screen><userinput>patch -Np1 -i ../firefox-&firefox-version;-system_graphite2_harfbuzz-1.patch</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 "d2284a20-0505-4927-a809-7ffaf4d91e55" > mozilla-key</userinput></screen>
345
346 <note><para>
347 If you are compiling <application>Firefox</application> in chroot, make
348 sure you have <envar>$SHELL</envar> environment variable set or prepend
349 <envar>SHELL=/bin/sh</envar>.
350 </para></note>
351
352 <para>
353 Invoke the Python script to compile the package:
354 </para>
355
356<screen><userinput>export CC=clang CXX=clang++ AR=llvm-ar NM=llvm-nm RANLIB=llvm-ranlib &amp;&amp;
357./mach build &amp;&amp;
358unset CC CXX AR NM RANLIB</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>export CC=clang CXX=clang++ ...</command>: Upstream now use
396 <application>clang</application> and building with any recent version
397 saves a lot of space.
398 </para>
399
400 <para>
401 <command>./mach build</command>: <application>Firefox</application>
402 now uses this <application>python2</application> script to run the
403 build and install.
404 </para>
405
406 <para>
407 <option>./mach build --verbose</option>: Use this alternative if you
408 need details of which files are being compiled, together with any C or
409 C++ flags being used.
410 </para>
411
412 <para>
413 <option>./mach build -j4</option>: In theory, <command>mach</command>
414 will use the number of online CPU cores - but on some machines the bulk
415 of the build will drag on as if only 1 core is present. Specifying the
416 number of jobs (4 in this example) fixes that. Unlike traditional
417 recommendations for running <command>make</command>, the exact number
418 of cores is usually fastest - exceptionally, N+1 may be better on a
419 well-specified modern machine. But do NOT use this if building from a
420 term where <command>taskset</command> has been used to restrict the
421 available cores.
422 </para>
423
424 <para>
425 <command>mkdir -pv /usr/lib/mozilla/plugins</command>: This ensures
426 that <filename class="directory">/usr/lib/mozilla/plugins/</filename>
427 exists.
428 </para>
429
430 <para>
431 <command>ln -sv ... /usr/lib/firefox/browser</command>:
432 This command creates a symbolic link to <filename
433 class="directory">/usr/lib/mozilla/plugins</filename>. It's not really
434 needed, as <application>Firefox</application> checks <filename
435 class="directory">/usr/lib/mozilla/plugins</filename> by default, but the
436 symbolic link is made to keep all the plugins installed in one folder.
437 </para>
438
439 </sect2>
440
441 <sect2 role="configuration">
442 <title>Configuring Firefox</title>
443
444 <para>
445 If you use a desktop environment like <application>Gnome</application> or
446 <application>KDE</application> you may like to create a
447 <filename>firefox.desktop</filename> file so that
448 <application>Firefox</application> appears in the panel's menus. If you
449 didn't enable startup-notification in your mozconfig change the
450 StartupNotify line to false. As the
451 <systemitem class="username">root</systemitem> user:
452 </para>
453
454<screen role="root"><userinput>mkdir -pv /usr/share/applications &amp;&amp;
455mkdir -pv /usr/share/pixmaps &amp;&amp;
456
457cat &gt; /usr/share/applications/firefox.desktop &lt;&lt; "EOF" &amp;&amp;
458<literal>[Desktop Entry]
459Encoding=UTF-8
460Name=Firefox Web Browser
461Comment=Browse the World Wide Web
462GenericName=Web Browser
463Exec=firefox %u
464Terminal=false
465Type=Application
466Icon=firefox
467Categories=GNOME;GTK;Network;WebBrowser;
468MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https;
469StartupNotify=true</literal>
470EOF
471
472ln -sfv /usr/lib/firefox/browser/chrome/icons/default/default128.png \
473 /usr/share/pixmaps/firefox.png</userinput></screen>
474
475 <sect3><title>Configuration Information</title>
476
477 <para>
478 The application settings for firefox are accessible by keying
479 <command>about:config</command> in the address bar.
480 </para>
481
482 <para>
483 With this version of <application>firefox</application>, getting
484 working sound can be a problem. Although upstream prefers pulseaudio,
485 on balance using <application>Alsa</application> may be easier.
486 </para>
487
488 <para>
489 If you enabled <application>Alsa</application> for sound, you may need
490 to alter one variable to get working sound. If you run
491 <command>firefox</command> from a term and try to play something with
492 sound you might encounter error messages like:
493 </para>
494
495 <para>
496 <literal>Sandbox: seccomp sandbox violation: pid 3941, tid 4030,
497 syscall 16, args 48 2147767296 139909894784796 0 0 0.</literal>
498 </para>
499
500 <para>
501 That was on x86_64, on i686 the syscall number is 54. To allow this
502 syscall, in <command>about:config</command> change
503 <command>security.sandbox.content.syscall_whitelist</command> to 16
504 (or 54 if using i686).
505 </para>
506
507 <para>
508 If you use <command>pulseaudio</command> in a Desktop Environment, it
509 might already be started by that DE. But if it is not, although
510 firefox-57 managed to start it, firefox-58 does not. If you run
511 <command>firefox</command> from a term, trying to play sound will
512 encounter error messages warning <literal>Can't get cubeb
513 context!</literal>
514 </para>
515
516 <para>
517 The fix for this is to close firefox, start pulseaudio to check it
518 does start (if not, read the information on Configuring in <xref
519 linkend="pulseaudio"/>) and restart firefox to check it is working.
520 If it now works, add the following to your <filename>~/.xinitrc</filename>:
521<phrase revision="sysv">
522<literal>pulseaudio --verbose --log-target=syslog&amp;</literal></phrase>
523<phrase revision="systemd">
524<literal>pulseaudio --verbose --log-target=journald&amp;</literal></phrase>
525 (unfortunately, on some systems this does not work).
526 </para>
527
528 <para>
529 You may wish to use multiple profiles within firefox. To do that, invoke
530 firefox as <command>firefox --ProfileManager</command>. You can also
531 check which profile is currently in use from
532 <command>about:profiles</command>.
533 </para>
534
535 </sect3>
536 </sect2>
537
538 <sect2 role="content">
539 <title>Contents</title>
540
541 <segmentedlist>
542 <segtitle>Installed Programs</segtitle>
543 <segtitle>Installed Libraries</segtitle>
544 <segtitle>Installed Directory</segtitle>
545
546 <seglistitem>
547 <seg>
548 firefox
549 </seg>
550 <seg>
551 Numerous libraries, browser components, plugins, extensions, and
552 helper modules installed in /usr/lib/firefox
553 </seg>
554 <seg>
555 /usr/lib/firefox and /usr/lib/mozilla
556 </seg>
557 </seglistitem>
558 </segmentedlist>
559
560 <variablelist>
561 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
562 <?dbfo list-presentation="list"?>
563 <?dbhtml list-presentation="table"?>
564
565 <varlistentry id="firefox-prog">
566 <term><command>firefox</command></term>
567 <listitem>
568 <para>
569 is a <application>GTK+-3</application> internet browser that uses
570 the Mozilla Gecko rendering engine.
571 </para>
572 <indexterm zone="firefox firefox-prog">
573 <primary sortas="b-firefox">firefox</primary>
574 </indexterm>
575 </listitem>
576 </varlistentry>
577
578 </variablelist>
579
580 </sect2>
581
582</sect1>
Note: See TracBrowser for help on using the repository browser.