mirror of
https://github.com/Zeckmathederg/glfs.git
synced 2025-02-01 04:52:12 +08:00
5c2b024156
git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@19698 af4574ff-66df-0310-9fd7-8a98e5e911e0
566 lines
20 KiB
XML
566 lines
20 KiB
XML
<?xml version="1.0" encoding="ISO-8859-1"?>
|
|
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
|
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
|
<!ENTITY % general-entities SYSTEM "../../general.ent">
|
|
%general-entities;
|
|
|
|
<!ENTITY firefox-download-http "&mozilla-http;/firefox/releases/&firefox-version;/source/firefox-&firefox-version;.source.tar.xz">
|
|
<!ENTITY firefox-download-ftp " ">
|
|
<!ENTITY firefox-md5sum "0d5b70d2cf074ed6716b13c3e8d43a18">
|
|
<!ENTITY firefox-size "236 MB">
|
|
<!-- NB with stylo, much of the build uses rust, and therefore cargo files.
|
|
But when building 58.0 on rustc-1.22.1 the extra files, if any, seem to be minimal -->
|
|
<!ENTITY firefox-buildsize "7.4 GB (152 MB installed) without tests">
|
|
<!ENTITY firefox-time "20 SBU (with parallelism=4) without tests">
|
|
]>
|
|
|
|
<sect1 id="firefox" xreflabel="Firefox-&firefox-version;">
|
|
<?dbhtml filename="firefox.html" ?>
|
|
|
|
<sect1info>
|
|
<othername>$LastChangedBy$</othername>
|
|
<date>$Date$</date>
|
|
</sect1info>
|
|
|
|
<title>Firefox-&firefox-version;</title>
|
|
|
|
<indexterm zone="firefox">
|
|
<primary sortas="a-Firefox">Firefox</primary>
|
|
</indexterm>
|
|
|
|
<sect2 role="package">
|
|
<title>Introduction to Firefox</title>
|
|
|
|
<para>
|
|
<application>Firefox</application> is a stand-alone browser based on the
|
|
<application>Mozilla</application> codebase.
|
|
</para>
|
|
|
|
&lfs81_checked;
|
|
|
|
<bridgehead renderas="sect3">Package Information</bridgehead>
|
|
<itemizedlist spacing="compact">
|
|
<listitem>
|
|
<para>
|
|
Download (HTTP): <ulink url="&firefox-download-http;"/>
|
|
</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>
|
|
Download (FTP): <ulink url="&firefox-download-ftp;"/>
|
|
</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>
|
|
Download MD5 sum: &firefox-md5sum;
|
|
</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>
|
|
Download size: &firefox-size;
|
|
</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>
|
|
Estimated disk space required: &firefox-buildsize;
|
|
</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>
|
|
Estimated build time: &firefox-time;
|
|
</para>
|
|
</listitem>
|
|
</itemizedlist>
|
|
|
|
<note>
|
|
<para>
|
|
The build times for this version of firefox (using stylo, the new CSS
|
|
rendering code) seem to vary widely between different machines. On one
|
|
old Intel i3 the build took considerably longer. The reason for this is
|
|
not understood. A build with stylo disabled is typically 1 or 2 SBU
|
|
quicker and needs 0.8GB less disk space.
|
|
</para>
|
|
|
|
<para>
|
|
Although upstream prefer to use <application>PulseAudio</application>,
|
|
for the moment <application>Alsa</application> can still be used. Both
|
|
may need runtime configuration to get sound working.
|
|
</para>
|
|
</note>
|
|
|
|
<bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
|
<itemizedlist spacing="compact">
|
|
<listitem>
|
|
<para>
|
|
Optional patch to allow system versions of <xref linkend="graphite2"/>
|
|
and <xref linkend="harfbuzz"/>:
|
|
<ulink url="&patch-root;/firefox-&firefox-version;-system_graphite2_harfbuzz-1.patch"/>
|
|
</para>
|
|
</listitem>
|
|
</itemizedlist>
|
|
|
|
<note>
|
|
<para>
|
|
The tarball <emphasis>firefox-&firefox-version;.source.tar.xz</emphasis>
|
|
will untar to <emphasis>firefox-&firefox-version;</emphasis> directory.
|
|
It will also reset the permissions of the current directory to 0755 if you
|
|
have permission to do that. If you do this in a directory where
|
|
the sticky bit is set, such
|
|
as <filename class="directory">/tmp</filename> it will end with error
|
|
messages:
|
|
</para>
|
|
|
|
<literallayout>tar: .: Cannot utime: Operation not permitted
|
|
tar: .: Cannot change mode to rwxr-xr-t: Operation not permitted
|
|
tar: Exiting with failure status due to previous errors
|
|
</literallayout>
|
|
|
|
<para>
|
|
This does finish with non-zero status, but it does
|
|
<emphasis>NOT</emphasis> mean there is a real problem.
|
|
Do not untar as the <systemitem class="username">root</systemitem> user
|
|
in a directory where the sticky bit is set - that will unset it.
|
|
</para>
|
|
</note>
|
|
|
|
<bridgehead renderas="sect3">Firefox Dependencies</bridgehead>
|
|
|
|
<bridgehead renderas="sect4">Required</bridgehead>
|
|
<para role="required">
|
|
<xref linkend="autoconf213"/>,
|
|
both <xref linkend="gtk3"/> and
|
|
<xref linkend="gtk2"/>,
|
|
<xref linkend="libnotify"/>,
|
|
<xref linkend="nss"/>,
|
|
<xref linkend="pulseaudio"/>
|
|
(or
|
|
<xref linkend="alsa-lib"/> if you edit the mozconfig;
|
|
now deprecated by mozilla), in either case please read the
|
|
Configuration Information,
|
|
<xref linkend="rust"/>,
|
|
<xref linkend="unzip"/>,
|
|
<xref linkend="yasm"/>, and
|
|
<xref linkend="zip"/>
|
|
</para>
|
|
|
|
<bridgehead renderas="sect4">Recommended</bridgehead>
|
|
<para role="recommended">
|
|
<xref linkend="icu"/>,
|
|
<xref linkend="libevent"/>,
|
|
<xref linkend="libvpx"/>,
|
|
<package>clang</package> from <xref linkend="llvm"/> (for stylo), and
|
|
<xref linkend="sqlite"/>
|
|
</para>
|
|
|
|
<note>
|
|
<para>
|
|
If you don't install recommended dependencies, then internal copies of
|
|
those packages will be used. They might be tested to work, but they can
|
|
be out of date or contain security holes.
|
|
</para>
|
|
</note>
|
|
|
|
<note>
|
|
<para>
|
|
With <application>Firefox-31.0</application> and later versions, you
|
|
must have installed <application>Openssl</application> before
|
|
<application>Python 2</application> or the build system will quickly
|
|
fail with output including "ImportError: cannot import name
|
|
HTTPSHandler". If you are in any doubt about this (e.g. upgrading from
|
|
an older version of Firefox), check if
|
|
<filename>/usr/lib/python&python2-majorver;/lib-dynload/_ssl.so</filename>
|
|
exists. If it does not, reinstall <xref linkend="python2"/> (after
|
|
installing <xref linkend="openssl"/>). The latest version of any
|
|
<emphasis>currently maintained</emphasis> version of Openssl should be
|
|
satisfactory if already installed.
|
|
</para>
|
|
</note>
|
|
|
|
<bridgehead renderas="sect4">Optional</bridgehead>
|
|
<para role="optional">
|
|
<xref linkend="curl"/>,
|
|
<xref linkend="dbus-glib"/>,
|
|
<xref linkend="doxygen"/>,
|
|
<xref linkend="GConf"/>,
|
|
<xref role="runtime" linkend="ffmpeg"/> (runtime, to play mov, mp3 or mp4 files),
|
|
<xref linkend="libwebp"/>,
|
|
<xref linkend="openjdk"/>,
|
|
<xref linkend="startup-notification"/>,
|
|
<xref linkend="valgrind"/>,
|
|
<xref linkend="wget"/>,
|
|
<xref linkend="wireless_tools"/>,
|
|
<ulink url="https://hunspell.github.io/">Hunspell</ulink>,
|
|
<phrase revision="sysv"><ulink url="http://sourceforge.net/projects/liboauth/files/">liboauth</ulink></phrase>
|
|
<phrase revision="systemd"><xref linkend="liboauth"/></phrase>,
|
|
<ulink url="https://github.com/libproxy/libproxy">libproxy</ulink>,
|
|
and (with the patch)
|
|
<xref linkend="graphite2"/> and
|
|
<xref linkend="harfbuzz"/>
|
|
</para>
|
|
|
|
<para condition="html" role="usernotes">
|
|
User Notes: <ulink url="&blfs-wiki;/firefox"/>
|
|
</para>
|
|
</sect2>
|
|
|
|
<sect2 role="installation">
|
|
<title>Installation of Firefox</title>
|
|
|
|
<para>
|
|
The configuration of <application>Firefox</application> is accomplished
|
|
by creating a <filename>mozconfig</filename> file containing the desired
|
|
configuration options. A default <filename>mozconfig</filename> is
|
|
created below. To see the entire list of available configuration options
|
|
(and an abbreviated description of some of them), issue <command>./configure
|
|
--help</command>. You may also wish to review the entire file and
|
|
uncomment any other desired options. Create the file by issuing the
|
|
following command:
|
|
</para>
|
|
|
|
<screen><userinput>cat > mozconfig << "EOF"
|
|
<literal># If you have a multicore machine, all cores will be used by default.
|
|
# You can change the number of non-rust jobs by setting a valid number
|
|
# of cores in this option, but when rust crates are being compiled
|
|
# jobs will be scheduled for all the online CPU cores.
|
|
#mk_add_options MOZ_MAKE_FLAGS="-j1"
|
|
|
|
# If you have installed dbus-glib, comment out this line:
|
|
ac_add_options --disable-dbus
|
|
|
|
# If you have installed dbus-glib, and you have installed (or will install)
|
|
# wireless-tools, and you wish to use geolocation web services, comment out
|
|
# this line
|
|
ac_add_options --disable-necko-wifi
|
|
|
|
# API Keys for geolocation APIs - necko-wifi (above) is required for MLS
|
|
# Uncomment the following line if you wish to use Mozilla Location Service
|
|
#ac_add_options --with-mozilla-api-keyfile=$PWD/mozilla-key
|
|
|
|
# Uncomment the following line if you wish to use Google's geolocaton API
|
|
# (needed for use with saved maps with Google Maps)
|
|
#ac_add_options --with-google-api-keyfile=$PWD/google-key
|
|
|
|
# Uncomment these lines if you have installed optional dependencies:
|
|
#ac_add_options --enable-system-hunspell
|
|
#ac_add_options --enable-startup-notification
|
|
|
|
# Uncomment the following option if you have not installed PulseAudio
|
|
#ac_add_options --disable-pulseaudio
|
|
# and uncomment this if you installed alsa-lib instead of PulseAudio
|
|
#ac_add_options --enable-alsa
|
|
|
|
# If you have installed GConf, comment out this line
|
|
ac_add_options --disable-gconf
|
|
|
|
# Stylo is the new CSS code, including the rust 'style'
|
|
# package. It is enabled by default but requires clang.
|
|
# Uncomment this if you do not wish to use stylo.
|
|
#ac_add_options --disable-stylo
|
|
|
|
# Comment out following options if you have not installed
|
|
# recommended dependencies:
|
|
ac_add_options --enable-system-sqlite
|
|
ac_add_options --with-system-libevent
|
|
ac_add_options --with-system-libvpx
|
|
ac_add_options --with-system-nspr
|
|
ac_add_options --with-system-nss
|
|
ac_add_options --with-system-icu
|
|
|
|
# If you are going to apply the patch for system graphite
|
|
# and system harfbuzz, uncomment these lines:
|
|
#ac_add_options --with-system-graphite2
|
|
#ac_add_options --with-system-harfbuzz
|
|
|
|
# Stripping is now enabled by default.
|
|
# Uncomment these lines if you need to run a debugger:
|
|
#ac_add_options --disable-strip
|
|
#ac_add_options --disable-install-strip
|
|
|
|
# The BLFS editors recommend not changing anything below this line:
|
|
ac_add_options --prefix=/usr
|
|
ac_add_options --enable-application=browser
|
|
|
|
ac_add_options --disable-crashreporter
|
|
ac_add_options --disable-updater
|
|
# enabling the tests will use a lot more space and significantly
|
|
# increase the build time, for no obvious benefit.
|
|
ac_add_options --disable-tests
|
|
|
|
# Optimization for size is broken with gcc7
|
|
ac_add_options --enable-optimize="-O2"
|
|
|
|
ac_add_options --enable-official-branding
|
|
|
|
# From firefox-40, using system cairo caused firefox to crash
|
|
# frequently when it was doing background rendering in a tab.
|
|
# This appears to again work in firefox-56
|
|
ac_add_options --enable-system-cairo
|
|
ac_add_options --enable-system-ffi
|
|
ac_add_options --enable-system-pixman
|
|
|
|
ac_add_options --with-pthreads
|
|
|
|
ac_add_options --with-system-bz2
|
|
ac_add_options --with-system-jpeg
|
|
ac_add_options --with-system-png
|
|
ac_add_options --with-system-zlib
|
|
|
|
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/firefox-build-dir</literal>
|
|
EOF</userinput></screen>
|
|
|
|
<para>
|
|
Compile <application>Firefox</application> by issuing the following
|
|
commands:
|
|
</para>
|
|
|
|
<para>
|
|
If you have installed system versions of graphite2 and harfbuzz and wish
|
|
firefox to use those instead of its shipped versions, apply the patch and
|
|
uncomment the appropriate entries in the <filename>mozconfig</filename>
|
|
file.
|
|
</para>
|
|
|
|
<screen><userinput>patch -Np1 -i ../firefox-&firefox-version;-system_graphite2_harfbuzz-1.patch</userinput></screen>
|
|
|
|
<para>
|
|
If the geolocation APIs are needed:
|
|
</para>
|
|
|
|
<note>
|
|
<para>
|
|
<!-- Taken from Arch Linux - an immensely helpful link - Thanks -->
|
|
The Google and Mozilla API Keys below are specific to LFS. If using
|
|
these instructions for another distro, or if you intend to distribute
|
|
binary copies of the software using these instructions, please obtain
|
|
your own keys following the instructions located at
|
|
<ulink url="http://www.chromium.org/developers/how-tos/api-keys"/> and
|
|
<ulink url="https://location.services.mozilla.com/api"/> respectively.
|
|
<!-- BLFS Devs, register an account at Google with your
|
|
@linuxfromscratch.org email address, and I'll make you an administrator
|
|
for the 'Google APIs for LFS' project (where the API and OAuth keys
|
|
were created for use in the book).-->
|
|
</para>
|
|
</note>
|
|
|
|
<screen><userinput>echo "AIzaSyDxKL42zsPjbke5O8_rPVpVrLrJ8aeE9rQ" > google-key
|
|
echo "d2284a20-0505-4927-a809-7ffaf4d91e55" > mozilla-key</userinput></screen>
|
|
|
|
<note><para>
|
|
If you are compiling <application>Firefox</application> in chroot, make
|
|
sure you have <envar>$SHELL</envar> environment variable set or prepend
|
|
<envar>SHELL=/bin/sh</envar>.
|
|
</para></note>
|
|
|
|
<!-- the BINDGEN_CFLAGS are to work around
|
|
https://bugzilla.mozilla.org/show_bug.cgi?id=1341234
|
|
which is reported to be fixed in ff58 -->
|
|
<screen><userinput>
|
|
./mach build
|
|
</userinput></screen>
|
|
|
|
<para>
|
|
The <filename>mozconfig</filename> above disables the tests because
|
|
they use a lot more time and disk space for no obvious benefit. If
|
|
you have nevertheless enabled them, you can run the tests by executing
|
|
<command>./mach gtest</command>. This will require a network connection,
|
|
and to be run from within an Xorg session - there is a popup dialog
|
|
when it fails to connect to ALSA (that does not create a failed test).
|
|
One or two tests will fail. To see the details of the failure(s) you
|
|
will need to log the output from that command so that you can review it.
|
|
</para>
|
|
|
|
<para>
|
|
Now, as the <systemitem class="username">root</systemitem> user:
|
|
</para>
|
|
|
|
<screen role="root"><userinput>./mach install &&
|
|
|
|
mkdir -pv /usr/lib/mozilla/plugins &&
|
|
ln -sfv ../../mozilla/plugins /usr/lib/firefox-&firefox-version;/browser</userinput></screen>
|
|
<!--
|
|
<para>
|
|
Set environment variables back to their values:
|
|
</para>
|
|
|
|
<screen><userinput>export CFLAGS=$CFLAGS_HOLD &&
|
|
export CXXFLAGS=$CXXFLAGS_HOLD &&
|
|
unset CFLAGS_HOLD CXXFLAGS_HOLD</userinput></screen>
|
|
-->
|
|
|
|
</sect2>
|
|
|
|
<sect2 role="commands">
|
|
<title>Command Explanations</title>
|
|
|
|
<para>
|
|
<command>./mach build</command>: <application>Firefox</application>
|
|
now uses this <application>python2</application> script to run the
|
|
build and install.
|
|
</para>
|
|
|
|
<para>
|
|
<option>./mach build --verbose</option>: Use this alternative if you
|
|
need details of which files are being compiled, together with any C or
|
|
C++ flags being used.
|
|
</para>
|
|
|
|
<para>
|
|
<command>mkdir -p /usr/lib/mozilla/plugins</command>: This checks
|
|
that <filename class="directory">/usr/lib/mozilla/plugins</filename>
|
|
exists.
|
|
</para>
|
|
|
|
<para>
|
|
<command>ln -sv ... /usr/lib/firefox-&firefox-version;/browser</command>:
|
|
This command creates a symbolic link to <filename
|
|
class="directory">/usr/lib/mozilla/plugins</filename>. It's not really
|
|
needed, as <application>Firefox</application> checks <filename
|
|
class="directory">/usr/lib/mozilla/plugins</filename> by default, but the
|
|
symbolic link is made to keep all the plugins installed in one folder.
|
|
</para>
|
|
|
|
</sect2>
|
|
|
|
<sect2 role="configuration">
|
|
<title>Configuring Firefox</title>
|
|
|
|
<para>
|
|
If you use a desktop environment like <application>Gnome</application> or
|
|
<application>KDE</application> you may like to create a
|
|
<filename>firefox.desktop</filename> file so that
|
|
<application>Firefox</application> appears in the panel's menus. If you
|
|
didn't enable startup-notification in your mozconfig change the
|
|
StartupNotify line to false. As the
|
|
<systemitem class="username">root</systemitem> user:
|
|
</para>
|
|
|
|
<screen role="root"><userinput>mkdir -pv /usr/share/applications &&
|
|
mkdir -pv /usr/share/pixmaps &&
|
|
|
|
cat > /usr/share/applications/firefox.desktop << "EOF" &&
|
|
<literal>[Desktop Entry]
|
|
Encoding=UTF-8
|
|
Name=Firefox Web Browser
|
|
Comment=Browse the World Wide Web
|
|
GenericName=Web Browser
|
|
Exec=firefox %u
|
|
Terminal=false
|
|
Type=Application
|
|
Icon=firefox
|
|
Categories=GNOME;GTK;Network;WebBrowser;
|
|
MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https;
|
|
StartupNotify=true</literal>
|
|
EOF
|
|
|
|
ln -sfv /usr/lib/firefox-&firefox-version;/browser/icons/mozicon128.png \
|
|
/usr/share/pixmaps/firefox.png</userinput></screen>
|
|
|
|
<sect3><title>Configuration Information</title>
|
|
|
|
<para>
|
|
The application settings for firefox are accessible by keying
|
|
<command>about:config</command> in the address bar.
|
|
</para>
|
|
|
|
<para>
|
|
With this version of <application>firefox</application>, getting
|
|
working sound can be a problem. Although upstream prefers pulseaudio,
|
|
on balance using <application>Alsa</application> may be easier.
|
|
</para>
|
|
|
|
<para>
|
|
If you enabled <application>Alsa</application> for sound, you may need
|
|
to alter one variable to get working sound. If you run
|
|
<command>firefox</command> from a term and try to play something with
|
|
sound you might encounter error messages like:
|
|
</para>
|
|
|
|
<para>
|
|
<literal>Sandbox: seccomp sandbox violation: pid 3941, tid 4030,
|
|
syscall 16, args 48 2147767296 139909894784796 0 0 0.</literal>
|
|
</para>
|
|
|
|
<para>
|
|
That was on x86_64, on i686 the syscall number is 54. To allow this
|
|
syscall, in <command>about:config</command> change
|
|
<command>security.sandbox.content.syscall_whitelist</command> to 16
|
|
(or 54 if using i686).
|
|
</para>
|
|
|
|
<para>
|
|
If you use <command>pulseaudio</command> in a Desktop Environment, it
|
|
might already be started by that DE. But if it is not, although
|
|
firefox-57 managed to start it, firefox-58 does not. If you run
|
|
<command>firefox</command> from a term, trying to play sound will
|
|
encounter error messages warning <literal>Can't get cubeb
|
|
context!</literal>
|
|
</para>
|
|
|
|
<para>
|
|
The fix for this is to close firefox, start pulseaudio to check it
|
|
does start (if not, read the information on Configuring in <xref
|
|
linkend="pulseaudio"/>) and restart firefox to check it is working.
|
|
If it now works, add the following to your <filename>~/.xinitrc</filename>:
|
|
<phrase revision="sysv">
|
|
<literal>pulseaudio --verbose --log-target=syslog&</literal></phrase>
|
|
<phrase revision="systemd">
|
|
<literal>pulseaudio --verbose --log-target=journald&</literal></phrase>
|
|
(unfortunately, on some systems this does not work).
|
|
</para>
|
|
|
|
<para>
|
|
You may wish to use multiple profiles within firefox. To do that, invoke
|
|
firefox as <command>firefox --ProfileManager</command>. You can also
|
|
check which profile is currently in use from
|
|
<command>about:profiles</command>.
|
|
</para>
|
|
|
|
</sect3>
|
|
</sect2>
|
|
|
|
<sect2 role="content">
|
|
<title>Contents</title>
|
|
|
|
<segmentedlist>
|
|
<segtitle>Installed Programs</segtitle>
|
|
<segtitle>Installed Libraries</segtitle>
|
|
<segtitle>Installed Directory</segtitle>
|
|
|
|
<seglistitem>
|
|
<seg>
|
|
firefox
|
|
</seg>
|
|
<seg>
|
|
Numerous libraries, browser components, plugins, extensions, and
|
|
helper modules installed in /usr/lib/firefox-&firefox-version;
|
|
</seg>
|
|
<seg>
|
|
/usr/lib/firefox-&firefox-version; and /usr/lib/mozilla
|
|
</seg>
|
|
</seglistitem>
|
|
</segmentedlist>
|
|
|
|
<variablelist>
|
|
<bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
|
<?dbfo list-presentation="list"?>
|
|
<?dbhtml list-presentation="table"?>
|
|
|
|
<varlistentry id="firefox-prog">
|
|
<term><command>firefox</command></term>
|
|
<listitem>
|
|
<para>
|
|
is a <application>GTK+-3</application> internet browser that uses
|
|
the Mozilla Gecko rendering engine.
|
|
</para>
|
|
<indexterm zone="firefox firefox-prog">
|
|
<primary sortas="b-firefox">firefox</primary>
|
|
</indexterm>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</sect2>
|
|
|
|
</sect1>
|