[f939f05] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[6732c094] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[f939f05] | 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 |
|
---|
[2eae5bc] | 7 | <!ENTITY firefox-download-http "&mozilla-http;/firefox/releases/&firefox-version;esr/source/firefox-&firefox-version;esr.source.tar.xz">
|
---|
[8dfc5c3] | 8 | <!ENTITY firefox-download-ftp " ">
|
---|
[ea5703f3] | 9 | <!ENTITY firefox-md5sum "93fb7e0baa3e99209e870f7c032ca513">
|
---|
| 10 | <!ENTITY firefox-size "482 MB">
|
---|
[86249d22] | 11 |
|
---|
[5c2b024] | 12 | <!-- NB with stylo, much of the build uses rust, and therefore cargo files.
|
---|
[9da4cc6f] | 13 | But the extra cached cargo files, if any, seem to be minimal -->
|
---|
[2601934] | 14 | <!ENTITY firefox-buildsize "6.3 GB (209 MB installed) without tests">
|
---|
[9a469bc] | 15 | <!-- editors: with ff63 and rust-1.29, ./mach build -j4 is probably the
|
---|
[fe5f563d] | 16 | most practical way to get a timing on a machine with more cores, if taking
|
---|
| 17 | cores offline is not practical. If in doubt, round up -->
|
---|
[ea5703f3] | 18 | <!ENTITY firefox-time "14.0 SBU using -j8, without tests">
|
---|
[f939f05] | 19 | ]>
|
---|
| 20 |
|
---|
[ffe47ca2] | 21 | <sect1 id="firefox" xreflabel="Firefox-&firefox-version;">
|
---|
[b81991e1] | 22 | <?dbhtml filename="firefox.html" ?>
|
---|
| 23 |
|
---|
| 24 |
|
---|
[689207c] | 25 | <!-- indicate this is the ESR variant,
|
---|
[b6cb36ff] | 26 | The point is that the stable release differs slightly.
|
---|
[b0540bce] | 27 | <title>Firefox-&firefox-version;</title>-->
|
---|
| 28 | <title>Firefox-&firefox-version;esr</title>
|
---|
[b81991e1] | 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 |
|
---|
[c1ae13c] | 37 | <para>
|
---|
| 38 | <application>Firefox</application> is a stand-alone browser based on the
|
---|
| 39 | <application>Mozilla</application> codebase.
|
---|
| 40 | </para>
|
---|
[b81991e1] | 41 |
|
---|
[24a928e] | 42 | &lfs120_checked;
|
---|
[76ae9a2] | 43 |
|
---|
[b81991e1] | 44 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 45 | <itemizedlist spacing="compact">
|
---|
| 46 | <listitem>
|
---|
[c1ae13c] | 47 | <para>
|
---|
| 48 | Download (HTTP): <ulink url="&firefox-download-http;"/>
|
---|
| 49 | </para>
|
---|
[b81991e1] | 50 | </listitem>
|
---|
| 51 | <listitem>
|
---|
[c1ae13c] | 52 | <para>
|
---|
| 53 | Download (FTP): <ulink url="&firefox-download-ftp;"/>
|
---|
| 54 | </para>
|
---|
[b81991e1] | 55 | </listitem>
|
---|
| 56 | <listitem>
|
---|
[c1ae13c] | 57 | <para>
|
---|
| 58 | Download MD5 sum: &firefox-md5sum;
|
---|
| 59 | </para>
|
---|
[b81991e1] | 60 | </listitem>
|
---|
| 61 | <listitem>
|
---|
[c1ae13c] | 62 | <para>
|
---|
| 63 | Download size: &firefox-size;
|
---|
| 64 | </para>
|
---|
[b81991e1] | 65 | </listitem>
|
---|
| 66 | <listitem>
|
---|
[c1ae13c] | 67 | <para>
|
---|
| 68 | Estimated disk space required: &firefox-buildsize;
|
---|
| 69 | </para>
|
---|
[b81991e1] | 70 | </listitem>
|
---|
| 71 | <listitem>
|
---|
[c1ae13c] | 72 | <para>
|
---|
| 73 | Estimated build time: &firefox-time;
|
---|
| 74 | </para>
|
---|
[b81991e1] | 75 | </listitem>
|
---|
| 76 | </itemizedlist>
|
---|
| 77 |
|
---|
[9403c3e] | 78 | <!--<bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
[bf5fb94] | 79 | <itemizedlist spacing="compact">
|
---|
[8dacd5e] | 80 | <listitem>
|
---|
| 81 | <para>
|
---|
| 82 | Required patch:
|
---|
[9d98701] | 83 | <ulink url="&patch-root;/firefox-&firefox-version;-consolidated-1.patch"/>
|
---|
[8dacd5e] | 84 | </para>
|
---|
| 85 | </listitem>
|
---|
[bca9385] | 86 | <listitem>
|
---|
| 87 | <para>
|
---|
| 88 | Required patch for new <xref linkend="ffmpeg"/> API:
|
---|
[51e9d68c] | 89 | <ulink url="&patch-root;/firefox-&firefox-version;-ffmpeg_6-1.patch"/>
|
---|
[bca9385] | 90 | </para>
|
---|
| 91 | </listitem>
|
---|
[9403c3e] | 92 | </itemizedlist>-->
|
---|
[bf5fb94] | 93 |
|
---|
[f06c692] | 94 | <note>
|
---|
[2eae5bc] | 95 | <para>
|
---|
| 96 | The directory name is firefox-&firefox-version;
|
---|
| 97 | </para>
|
---|
| 98 |
|
---|
[f06c692] | 99 | <para>
|
---|
[8d0bc761] | 100 | Extracting the tarball
|
---|
| 101 | will reset the permissions of the current directory to 0755 if you
|
---|
[765c2a7] | 102 | have permission to do that. If you do this in a directory where
|
---|
[37bf7b1] | 103 | the sticky bit is set, such
|
---|
[dc9a18a] | 104 | as <filename class="directory">/tmp</filename> it will end with error
|
---|
| 105 | messages:
|
---|
| 106 | </para>
|
---|
| 107 |
|
---|
| 108 | <literallayout>tar: .: Cannot utime: Operation not permitted
|
---|
| 109 | tar: .: Cannot change mode to rwxr-xr-t: Operation not permitted
|
---|
| 110 | tar: Exiting with failure status due to previous errors
|
---|
| 111 | </literallayout>
|
---|
| 112 |
|
---|
| 113 | <para>
|
---|
| 114 | This does finish with non-zero status, but it does
|
---|
| 115 | <emphasis>NOT</emphasis> mean there is a real problem.
|
---|
| 116 | Do not untar as the <systemitem class="username">root</systemitem> user
|
---|
| 117 | in a directory where the sticky bit is set - that will unset it.
|
---|
[f06c692] | 118 | </para>
|
---|
[8d0bc761] | 119 |
|
---|
| 120 | <para>
|
---|
[406e5ffe] | 121 | As with other large packages which use C++ (or rust), the SBU times
|
---|
[d5d7cd6] | 122 | to build this vary more widely than you might expect. The build times
|
---|
| 123 | will increase significantly if your machine has to swap.
|
---|
[8d0bc761] | 124 | </para>
|
---|
| 125 |
|
---|
| 126 | <para>
|
---|
| 127 | Although upstream prefer to use <application>PulseAudio</application>,
|
---|
| 128 | for the moment <application>Alsa</application> can still be used. Both
|
---|
| 129 | may need runtime configuration to get sound working.
|
---|
| 130 | </para>
|
---|
[f06c692] | 131 | </note>
|
---|
| 132 |
|
---|
[b81991e1] | 133 | <bridgehead renderas="sect3">Firefox Dependencies</bridgehead>
|
---|
| 134 |
|
---|
| 135 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
[c1ae13c] | 136 | <para role="required">
|
---|
[44cd41e] | 137 | <xref linkend="cbindgen"/>,
|
---|
[703f0ce] | 138 | <xref linkend="dbus-glib"/>,
|
---|
[6292849] | 139 | <xref linkend="gtk3"/>,
|
---|
[326f830] | 140 | <xref linkend="libnotify"/>,
|
---|
[f572dbb] | 141 | <xref linkend="llvm"/> (with clang, used for bindgen even if using gcc),
|
---|
[fe5f563d] | 142 | <xref linkend="nodejs"/>,
|
---|
[be0bd12] | 143 | <xref linkend="pulseaudio"/>
|
---|
[81b3e7fd] | 144 | (or
|
---|
[9da4cc6f] | 145 | <xref linkend="alsa-lib"/> if you edit the mozconfig;
|
---|
[326f830] | 146 | now deprecated by mozilla), in either case please read the
|
---|
| 147 | Configuration Information,
|
---|
[693f28e1] | 148 | <xref linkend="python3"/> (rebuilt after installing <xref linkend="sqlite"/>),
|
---|
[39eb0f1] | 149 | <xref linkend="six"/>,
|
---|
[7877690] | 150 | <xref linkend="startup-notification"/>, and
|
---|
| 151 | <xref linkend="unzip"/>
|
---|
[c1ae13c] | 152 | </para>
|
---|
| 153 |
|
---|
[1555d3d] | 154 | <bridgehead renderas="sect4">Recommended</bridgehead>
|
---|
[c1ae13c] | 155 | <para role="recommended">
|
---|
[b84fe71] | 156 | <xref linkend="icu"/>,
|
---|
[0e37869] | 157 | <xref linkend="libevent"/>,
|
---|
[569d3364] | 158 | <xref linkend="libvpx"/>,
|
---|
[e399c12] | 159 | <xref linkend="libwebp"/>,
|
---|
[f7fe3e6] | 160 | <xref linkend="nasm"/>, and
|
---|
[569d3364] | 161 | <xref linkend="nss"/>
|
---|
[c1ae13c] | 162 | </para>
|
---|
[1555d3d] | 163 |
|
---|
[0e37869] | 164 | <note>
|
---|
| 165 | <para>
|
---|
[b9f61df] | 166 | If you don't install recommended dependencies, then internal copies of
|
---|
| 167 | those packages will be used. They might be tested to work, but they can
|
---|
| 168 | be out of date or contain security holes.
|
---|
[0e37869] | 169 | </para>
|
---|
| 170 | </note>
|
---|
[8d0bc761] | 171 |
|
---|
[b81991e1] | 172 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
[c1ae13c] | 173 | <para role="optional">
|
---|
[6c64623f] | 174 | <xref linkend="curl"/>,
|
---|
[c1ae13c] | 175 | <xref linkend="doxygen"/>,
|
---|
[babf0a0] | 176 | <xref role="runtime" linkend="ffmpeg"/> (runtime, to play mov, mp3 or mp4 files),
|
---|
[fe30eab] | 177 | <xref linkend="liboauth"/>,
|
---|
[0bb7c72] | 178 | <xref role="runtime" linkend="pciutils"/> (runtime),
|
---|
[566fcae] | 179 | <xref linkend="valgrind"/>,
|
---|
[6000a3e] | 180 | <xref linkend="wget"/>,
|
---|
[73b06df] | 181 | <xref linkend="wireless_tools"/>,
|
---|
[7877690] | 182 | <xref linkend="yasm"/>,
|
---|
[d5d7cd6] | 183 | <ulink url="https://github.com/libproxy/libproxy">libproxy</ulink>
|
---|
[c1ae13c] | 184 | </para>
|
---|
| 185 |
|
---|
| 186 | <para condition="html" role="usernotes">
|
---|
[42ddc30] | 187 | Editor Notes: <ulink url="&blfs-wiki;/firefox"/>
|
---|
[c1ae13c] | 188 | </para>
|
---|
[b81991e1] | 189 | </sect2>
|
---|
| 190 |
|
---|
| 191 | <sect2 role="installation">
|
---|
| 192 | <title>Installation of Firefox</title>
|
---|
| 193 |
|
---|
[e86ded4] | 194 | <para>
|
---|
| 195 | The building system ships several internal copies of the Python 3
|
---|
| 196 | modules <application>setuptools</application> and
|
---|
| 197 | <filename>six.py</filename>. The shipped copies are too old
|
---|
| 198 | to work well with Python 3.12 or later. Replace them with the
|
---|
| 199 | symlinks to the LFS <application>setuptools</application> package and
|
---|
| 200 | <xref linkend='six'/> already installed on the system, and adapt the
|
---|
| 201 | building system for these updated Python modules. We also need to
|
---|
| 202 | rewrite the code based on the <filename>imp</filename> module removed
|
---|
| 203 | in Python 3.12 and later using the <filename>importlib</filename>
|
---|
| 204 | module:
|
---|
| 205 | </para>
|
---|
| 206 |
|
---|
| 207 | <screen><userinput>(for i in $(find -name six.py); do
|
---|
| 208 | ln -sfv /usr/lib/python&python3-majorver;/site-packages/six.py $i
|
---|
| 209 | [ $? = 0 ] || exit $?
|
---|
| 210 | done) &&
|
---|
| 211 |
|
---|
| 212 | sed '/ConfigParser/s/Safe//' \
|
---|
| 213 | -i testing/mozbase/mozprofile/mozprofile/prefs.py &&
|
---|
| 214 |
|
---|
| 215 | (for i in setuptools distutils-precedence.pth \
|
---|
| 216 | pkg_resources _distutils_hack; do
|
---|
| 217 | rm -rf third_party/python/setuptools/$i &&
|
---|
| 218 | ln -sv /usr/lib/python&python3-majorver;/site-packages/$i \
|
---|
| 219 | third_party/python/setuptools
|
---|
| 220 | [ $? = 0 ] || exit $?
|
---|
| 221 | done) &&
|
---|
| 222 |
|
---|
[248d350] | 223 | sed 's/distutils/setuptools._&/' \
|
---|
[e86ded4] | 224 | -i python/mozbuild/mozbuild/nodeutil.py &&
|
---|
| 225 |
|
---|
| 226 | sed -e '/^import/s/imp$/importlib.util/' \
|
---|
| 227 | -e 's/imp.new_module/__import__/' \
|
---|
| 228 | -e "s/imp.load_source\(.*\)/spec = \
|
---|
| 229 | importlib.util.spec_from_file_location\1; \
|
---|
| 230 | mod = importlib.util.module_from_spec(spec); \
|
---|
| 231 | spec.loader.exec_module(mod)/" -i python/mach/mach/main.py &&
|
---|
| 232 | sed '/import imp/d' -i netwerk/dns/prepare_tlds.py
|
---|
| 233 | </userinput></screen>
|
---|
| 234 |
|
---|
[b05b7e3] | 235 | <!-- https://bugzilla.mozilla.org/show_bug.cgi?id=1859752
|
---|
| 236 | https://hg.mozilla.org/try/rev/d5f3b0c4f08a -->
|
---|
[22819855] | 237 | <para>
|
---|
| 238 | If building with system ICU, adapt the line break mapping for ICU
|
---|
| 239 | 74 or later:
|
---|
| 240 | </para>
|
---|
| 241 |
|
---|
| 242 | <screen><userinput>(for i in {43..47}; do
|
---|
| 243 | sed '/ZWJ/s/}/,CLASS_CHARACTER&/' -i intl/lwbrk/LineBreaker.cpp || exit $?
|
---|
| 244 | done)</userinput></screen>
|
---|
| 245 |
|
---|
[f72a04a] | 246 | <para>
|
---|
[b9f61df] | 247 | The configuration of <application>Firefox</application> is accomplished
|
---|
| 248 | by creating a <filename>mozconfig</filename> file containing the desired
|
---|
| 249 | configuration options. A default <filename>mozconfig</filename> is
|
---|
| 250 | created below. To see the entire list of available configuration options
|
---|
[888e303] | 251 | (and an abbreviated description of some of them), issue <command>./mach
|
---|
[7f1e70b] | 252 | configure -- --help | less</command>. You may also
|
---|
[888e303] | 253 | wish to review the entire file and uncomment any other desired options.
|
---|
| 254 | Create the file by issuing the following command:
|
---|
[c1ae13c] | 255 | </para>
|
---|
[5a13c45] | 256 |
|
---|
[0e37869] | 257 | <screen><userinput>cat > mozconfig << "EOF"
|
---|
[dcb0fe6] | 258 | <literal># If you have a multicore machine, all cores will be used by default.
|
---|
| 259 |
|
---|
[703f0ce] | 260 | # If you have installed (or will install) wireless-tools, and you wish
|
---|
| 261 | # to use geolocation web services, comment out this line
|
---|
[6d1bf0e] | 262 | ac_add_options --disable-necko-wifi
|
---|
| 263 |
|
---|
[ad5a97d] | 264 | # API Keys for geolocation APIs - necko-wifi (above) is required for MLS
|
---|
| 265 | # Uncomment the following line if you wish to use Mozilla Location Service
|
---|
| 266 | #ac_add_options --with-mozilla-api-keyfile=$PWD/mozilla-key
|
---|
| 267 |
|
---|
[5f729f8] | 268 | # Uncomment the following line if you wish to use Google's geolocation API
|
---|
[ad5a97d] | 269 | # (needed for use with saved maps with Google Maps)
|
---|
[9116137c] | 270 | #ac_add_options --with-google-location-service-api-keyfile=$PWD/google-key
|
---|
[ad5a97d] | 271 |
|
---|
[d5d7cd6] | 272 | # startup-notification is required since firefox-78
|
---|
[495ebe07] | 273 |
|
---|
[87fa171] | 274 | # Uncomment the following option if you have not installed PulseAudio and
|
---|
[a72c6662] | 275 | # want to use alsa instead
|
---|
[87fa171] | 276 | #ac_add_options --enable-audio-backends=alsa
|
---|
[89cdb63d] | 277 |
|
---|
[0e37869] | 278 | # Comment out following options if you have not installed
|
---|
| 279 | # recommended dependencies:
|
---|
[569d3364] | 280 | ac_add_options --with-system-icu
|
---|
[0e37869] | 281 | ac_add_options --with-system-libevent
|
---|
[569d3364] | 282 | ac_add_options --with-system-libvpx
|
---|
[0e37869] | 283 | ac_add_options --with-system-nspr
|
---|
| 284 | ac_add_options --with-system-nss
|
---|
[569d3364] | 285 | ac_add_options --with-system-webp
|
---|
[9a469bc] | 286 |
|
---|
[02e19e03] | 287 | # Unlike with thunderbird, although using the gold linker can
|
---|
| 288 | # save four megabytes in the installed file it does not make
|
---|
| 289 | # the build faster.
|
---|
[9a469bc] | 290 |
|
---|
[a737350] | 291 | # The libdav1d library (av1 decoder) requires nasm. Uncomment this
|
---|
| 292 | # if nasm has not been installed. Do not uncomment this if you have
|
---|
[c528a3e] | 293 | # ffmpeg installed.
|
---|
[e399c12] | 294 | #ac_add_options --disable-av1
|
---|
[0a561d8] | 295 |
|
---|
[a737350] | 296 | # You cannot distribute the binary if you do this.
|
---|
[9a469bc] | 297 | ac_add_options --enable-official-branding
|
---|
[0e37869] | 298 |
|
---|
[14de4227] | 299 | # Stripping is now enabled by default.
|
---|
| 300 | # Uncomment these lines if you need to run a debugger:
|
---|
| 301 | #ac_add_options --disable-strip
|
---|
| 302 | #ac_add_options --disable-install-strip
|
---|
| 303 |
|
---|
[e399c12] | 304 | # Disabling debug symbols makes the build much smaller and a little
|
---|
[ec54fa5b] | 305 | # faster. Comment this if you need to run a debugger. Note: This is
|
---|
| 306 | # required for compilation on i686.
|
---|
[e399c12] | 307 | ac_add_options --disable-debug-symbols
|
---|
[9bfa685] | 308 | <!-- With Firefox ESR 128 we'd replace the following part with
|
---|
| 309 | "- -enable-elf-hack=relr", or remove it if relr becomes the default. -->
|
---|
[c9677a35] | 310 | # The elf-hack is reported to cause failed installs (after successful builds)
|
---|
| 311 | # on some machines. It is supposed to improve startup time and it shrinks
|
---|
[a737350] | 312 | # libxul.so by a few MB. With recent Binutils releases the linker already
|
---|
| 313 | # supports a much safer and generic way for this.
|
---|
[c9677a35] | 314 | ac_add_options --disable-elf-hack
|
---|
[a737350] | 315 | export LDFLAGS="$LDFLAGS -Wl,-z,pack-relative-relocs"
|
---|
[c9677a35] | 316 |
|
---|
[d5d7cd6] | 317 | # The BLFS editors recommend not changing anything below this line:
|
---|
| 318 | ac_add_options --prefix=/usr
|
---|
| 319 | ac_add_options --enable-application=browser
|
---|
[5f5dcc2] | 320 | ac_add_options --disable-crashreporter
|
---|
| 321 | ac_add_options --disable-updater
|
---|
[a737350] | 322 |
|
---|
| 323 | # Enabling the tests will use a lot more space and significantly
|
---|
[57a8df2] | 324 | # increase the build time, for no obvious benefit.
|
---|
[0e37869] | 325 | ac_add_options --disable-tests
|
---|
| 326 |
|
---|
[a737350] | 327 | # This enables SIMD optimization in the shipped encoding_rs crate.
|
---|
| 328 | ac_add_options --enable-rust-simd
|
---|
[0e37869] | 329 |
|
---|
[41f2e90] | 330 | ac_add_options --enable-system-ffi
|
---|
[0e37869] | 331 | ac_add_options --enable-system-pixman
|
---|
| 332 |
|
---|
[a0ace670] | 333 | ac_add_options --with-system-jpeg
|
---|
| 334 | ac_add_options --with-system-png
|
---|
| 335 | ac_add_options --with-system-zlib
|
---|
[aed37975] | 336 |
|
---|
[efe8cf09] | 337 | # Sandboxing works well on x86_64 but might cause issues on other
|
---|
| 338 | # platforms. If not on x86_64, e.g. i686, it is recommended to
|
---|
| 339 | # uncomment the following switch.
|
---|
| 340 | #ac_add_options --disable-sandbox
|
---|
| 341 |
|
---|
[e51466a] | 342 | # Using sandboxed wasm libraries has been moved to all builds instead
|
---|
| 343 | # of only mozilla automation builds. It requires extra llvm packages
|
---|
| 344 | # and was reported to seriously slow the build. Disable it.
|
---|
| 345 | ac_add_options --without-wasm-sandboxed-libraries
|
---|
| 346 |
|
---|
[1b0a207] | 347 | # The following option unsets Telemetry Reporting. With the Addons Fiasco,
|
---|
| 348 | # Mozilla was found to be collecting user's data, including saved passwords and
|
---|
| 349 | # web form data, without users consent. Mozilla was also found shipping updates
|
---|
| 350 | # to systems without the user's knowledge or permission.
|
---|
| 351 | # As a result of this, use the following command to permanently disable
|
---|
| 352 | # telemetry reporting in Firefox.
|
---|
| 353 | unset MOZ_TELEMETRY_REPORTING
|
---|
| 354 |
|
---|
[4def8b6] | 355 | mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/firefox-build-dir</literal>
|
---|
[0e37869] | 356 | EOF</userinput></screen>
|
---|
[b9b7146] | 357 |
|
---|
[c1ae13c] | 358 | <para>
|
---|
| 359 | Compile <application>Firefox</application> by issuing the following
|
---|
| 360 | commands:
|
---|
| 361 | </para>
|
---|
[9737271] | 362 | <!-- Not needed with clang. Upstream bug at
|
---|
[e51466a] | 363 | https://bugzilla.mozilla.org/show_bug.cgi?id=1729459
|
---|
| 364 |
|
---|
[d468e96] | 365 | <para>
|
---|
| 366 | If building on a 32 bit machine, the following sed works around
|
---|
[0a0e996] | 367 | an issue with an incompatible <quote>double</quote> type in one
|
---|
[d468e96] | 368 | header file:
|
---|
| 369 | </para>
|
---|
| 370 |
|
---|
| 371 | <screen><userinput>case "$(uname -m)" in
|
---|
| 372 | i?86) sed -e '/typedef[ ]*double/s/double/long double/' \
|
---|
| 373 | -i modules/fdlibm/src/math_private.h ;;
|
---|
| 374 | esac</userinput></screen>
|
---|
[9737271] | 375 | -->
|
---|
[ad5a97d] | 376 | <para>
|
---|
| 377 | If the geolocation APIs are needed:
|
---|
| 378 | </para>
|
---|
| 379 |
|
---|
[e5c8de01] | 380 | <note>
|
---|
| 381 | <para>
|
---|
| 382 | <!-- Taken from Arch Linux - an immensely helpful link - Thanks -->
|
---|
| 383 | The Google and Mozilla API Keys below are specific to LFS. If using
|
---|
| 384 | these instructions for another distro, or if you intend to distribute
|
---|
| 385 | binary copies of the software using these instructions, please obtain
|
---|
| 386 | your own keys following the instructions located at
|
---|
[75b1a338] | 387 | <ulink url="https://www.chromium.org/developers/how-tos/api-keys"/> and
|
---|
[e5c8de01] | 388 | <ulink url="https://location.services.mozilla.com/api"/> respectively.
|
---|
| 389 | <!-- BLFS Devs, register an account at Google with your
|
---|
| 390 | @linuxfromscratch.org email address, and I'll make you an administrator
|
---|
| 391 | for the 'Google APIs for LFS' project (where the API and OAuth keys
|
---|
| 392 | were created for use in the book).-->
|
---|
| 393 | </para>
|
---|
| 394 | </note>
|
---|
| 395 |
|
---|
[ad5a97d] | 396 | <screen><userinput>echo "AIzaSyDxKL42zsPjbke5O8_rPVpVrLrJ8aeE9rQ" > google-key
|
---|
[5f18b7a8] | 397 | echo "613364a7-9418-4c86-bcee-57e32fd70c23" > mozilla-key</userinput></screen>
|
---|
[ad5a97d] | 398 |
|
---|
[5b0a978e] | 399 | <note>
|
---|
| 400 |
|
---|
| 401 | <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
---|
| 402 | href="../../xincludes/mozshm.xml"/>
|
---|
| 403 |
|
---|
| 404 | <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
---|
| 405 | href="../../xincludes/mozmach.xml"/>
|
---|
| 406 |
|
---|
| 407 | </note>
|
---|
[686afa98] | 408 |
|
---|
[9403c3e] | 409 | <!--<para>
|
---|
[9d98701] | 410 | Fix building Firefox with Clang 16 or C++ headers from GCC 13.
|
---|
[fa47dacd] | 411 | And, work around a build failure with Rustc-1.70.0:
|
---|
[686afa98] | 412 | </para>
|
---|
| 413 |
|
---|
[9d98701] | 414 | <screen><userinput remap="pre">patch -Np1 -i ../firefox-&firefox-version;-consolidated-1.patch</userinput></screen>
|
---|
[bca9385] | 415 |
|
---|
| 416 | <para>
|
---|
| 417 | Apply the following patch so that firefox is able to play H.264 videos:
|
---|
| 418 | </para>
|
---|
| 419 |
|
---|
[9403c3e] | 420 | <screen><userinput remap="pre">patch -Np1 -i ../firefox-&firefox-version;-ffmpeg_6-1.patch</userinput></screen>-->
|
---|
[686afa98] | 421 |
|
---|
[29b0395] | 422 | <para>
|
---|
[8d70628] | 423 | Now invoke the Python <command>mach</command> script to compile the package.
|
---|
[29b0395] | 424 | </para>
|
---|
[e8d45427] | 425 |
|
---|
[16218efb] | 426 | <screen><userinput>export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=none &&
|
---|
[fce78fd] | 427 | export MOZBUILD_STATE_PATH=${PWD}/mozbuild &&
|
---|
| 428 | ./mach configure &&
|
---|
[f0b7ae67] | 429 | ./mach build</userinput></screen>
|
---|
[3bdfc9fd] | 430 |
|
---|
[0e37869] | 431 | <para>
|
---|
[57a8df2] | 432 | The <filename>mozconfig</filename> above disables the tests because
|
---|
| 433 | they use a lot more time and disk space for no obvious benefit. If
|
---|
[ecffcbbc] | 434 | you have nevertheless enabled them, you can run the tests by executing
|
---|
| 435 | <command>./mach gtest</command>. This will require a network connection,
|
---|
| 436 | and to be run from within an Xorg session - there is a popup dialog
|
---|
| 437 | when it fails to connect to ALSA (that does not create a failed test).
|
---|
| 438 | One or two tests will fail. To see the details of the failure(s) you
|
---|
| 439 | will need to log the output from that command so that you can review it.
|
---|
[0e37869] | 440 | </para>
|
---|
[01ce75f8] | 441 |
|
---|
[495ebe07] | 442 | <para>
|
---|
[b9f61df] | 443 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
[c1ae13c] | 444 | </para>
|
---|
[5a13c45] | 445 |
|
---|
[16218efb] | 446 | <screen role="root"><userinput>MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=none ./mach install</userinput></screen>
|
---|
[fe5f563d] | 447 |
|
---|
[a5708ba] | 448 | <para>
|
---|
[8d70628] | 449 | Empty the environment variables which were set above:
|
---|
[a5708ba] | 450 | </para>
|
---|
| 451 |
|
---|
[e51466a] | 452 | <screen><userinput>unset MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE MOZBUILD_STATE_PATH</userinput></screen>
|
---|
[01ce75f8] | 453 |
|
---|
[b81991e1] | 454 | </sect2>
|
---|
| 455 |
|
---|
[361df3e] | 456 | <sect2 role="commands">
|
---|
| 457 | <title>Command Explanations</title>
|
---|
[7d09fcb9] | 458 |
|
---|
[29b0395] | 459 | <!--<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
---|
| 460 | href="../../xincludes/SIOCGSTAMP.xml"/>-->
|
---|
[e8d45427] | 461 |
|
---|
[fe5f563d] | 462 | <para>
|
---|
| 463 | <command>export MOZBUILD_STATE_PATH=${PWD}/mozbuild</command>: The build
|
---|
| 464 | is now supposed to tell you that it intends to create <filename
|
---|
| 465 | class="directory">~/.mozbuild</filename>, and offer you an option to
|
---|
| 466 | press <ENTER> to accept this, or Ctrl-C to cancel and restart the
|
---|
| 467 | build after specifying the directory. In practice, the message may not
|
---|
| 468 | appear until after <ENTER> is keyed, i.e. the build stalls.
|
---|
| 469 | </para>
|
---|
| 470 |
|
---|
| 471 | <para>
|
---|
| 472 | That directory is used for a (probably random) telemetry identifier.
|
---|
| 473 | Creating this in the build directory, and deleting that after the
|
---|
| 474 | installation, prevents it being used. If you wish to participate in
|
---|
[883e376] | 475 | telemetry, export MOZBUILD_STATE_PATH to point to its default directory
|
---|
| 476 | and remove the entry from the <filename>mozconfig</filename>.
|
---|
| 477 | </para>
|
---|
| 478 |
|
---|
| 479 | <para>
|
---|
[16218efb] | 480 | <command>MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=none</command>: Use the
|
---|
[e51466a] | 481 | system python to create a virtual environment for <command>mach</command>
|
---|
[16218efb] | 482 | without downloading any python wheels nor using the system python modules.
|
---|
[9403c3e] | 483 | This prevents version mismatches between system modules and bundled ones.
|
---|
[883e376] | 484 | </para>
|
---|
| 485 |
|
---|
| 486 | <para>
|
---|
| 487 | <command>./mach configure</command>: This validates the supplied
|
---|
| 488 | dependencies and the <filename>mozconfig</filename>.
|
---|
[fe5f563d] | 489 | </para>
|
---|
| 490 |
|
---|
[c1ae13c] | 491 | <para>
|
---|
[326f830] | 492 | <option>./mach build --verbose</option>: Use this alternative if you
|
---|
| 493 | need details of which files are being compiled, together with any C or
|
---|
[648f873] | 494 | C++ flags being used. But do not add '--verbose' to the install command
|
---|
| 495 | since it is not accepted there.
|
---|
[c1ae13c] | 496 | </para>
|
---|
| 497 |
|
---|
[9a469bc] | 498 | <para>
|
---|
[fe5f563d] | 499 | <option>./mach build -jN</option>: The build should, by default, use
|
---|
[d5d7cd6] | 500 | all the online CPU cores. If using all the cores causes the build to swap
|
---|
| 501 | because you have insufficient memory, using fewer cores can be faster.
|
---|
[9a469bc] | 502 | </para>
|
---|
| 503 |
|
---|
[c1ae13c] | 504 | <para>
|
---|
[f572dbb] | 505 | <option><envar>CC=gcc CXX=g++</envar></option>: BLFS used to
|
---|
[e51466a] | 506 | prefer to use gcc and g++ instead of upstream's defaults of the
|
---|
| 507 | <application>clang</application> programs. With the release of
|
---|
| 508 | gcc-12 the build takes longer with gcc and g++, primarily because
|
---|
| 509 | of extra warnings, and is bigger. Set these environment variables
|
---|
| 510 | <emphasis>before you run the configure script</emphasis>
|
---|
[f572dbb] | 511 | if you wish to continue to use gcc, g++. Building
|
---|
| 512 | with GCC on i?86 is currently broken.
|
---|
[c1ae13c] | 513 | </para>
|
---|
[fa1bc3e] | 514 |
|
---|
[b81991e1] | 515 | </sect2>
|
---|
| 516 |
|
---|
[88cec02] | 517 | <sect2 role="configuration">
|
---|
| 518 | <title>Configuring Firefox</title>
|
---|
| 519 |
|
---|
[c1ae13c] | 520 | <para>
|
---|
| 521 | If you use a desktop environment like <application>Gnome</application> or
|
---|
[8dacd5e] | 522 | <application>KDE</application> you may want to create a
|
---|
[c1ae13c] | 523 | <filename>firefox.desktop</filename> file so that
|
---|
[1fe05eb] | 524 | <application>Firefox</application> appears in the panel's menus.
|
---|
[8dacd5e] | 525 | As the &root; user:
|
---|
[c1ae13c] | 526 | </para>
|
---|
[31de6e7] | 527 |
|
---|
[eb5f847a] | 528 | <screen role="root"><userinput>mkdir -pv /usr/share/applications &&
|
---|
[28909b72] | 529 | mkdir -pv /usr/share/pixmaps &&
|
---|
[74f73ede] | 530 |
|
---|
[8dacd5e] | 531 | MIMETYPE="text/xml;text/mml;text/html;" &&
|
---|
| 532 | MIMETYPE+="application/xhtml+xml;application/vnd.mozilla.xul+xml;" &&
|
---|
| 533 | MIMETYPE+="x-scheme-handler/http;x-scheme-handler/https" &&
|
---|
[28909b72] | 534 |
|
---|
| 535 | cat > /usr/share/applications/firefox.desktop << EOF &&
|
---|
[fcd66369] | 536 | <literal>[Desktop Entry]
|
---|
[31de6e7] | 537 | Encoding=UTF-8
|
---|
[0e37869] | 538 | Name=Firefox Web Browser
|
---|
| 539 | Comment=Browse the World Wide Web
|
---|
| 540 | GenericName=Web Browser
|
---|
| 541 | Exec=firefox %u
|
---|
| 542 | Terminal=false
|
---|
[31de6e7] | 543 | Type=Application
|
---|
| 544 | Icon=firefox
|
---|
[0e37869] | 545 | Categories=GNOME;GTK;Network;WebBrowser;
|
---|
[28909b72] | 546 | MimeType=$MIMETYPE
|
---|
[fcd66369] | 547 | StartupNotify=true</literal>
|
---|
[31de6e7] | 548 | EOF
|
---|
[74f73ede] | 549 |
|
---|
[28909b72] | 550 | unset MIMETYPE &&
|
---|
| 551 |
|
---|
[888e303] | 552 | ln -sfv /usr/lib/firefox/browser/chrome/icons/default/default128.png \
|
---|
[0e37869] | 553 | /usr/share/pixmaps/firefox.png</userinput></screen>
|
---|
| 554 |
|
---|
[326f830] | 555 | <sect3><title>Configuration Information</title>
|
---|
| 556 |
|
---|
| 557 | <para>
|
---|
| 558 | The application settings for firefox are accessible by keying
|
---|
| 559 | <command>about:config</command> in the address bar.
|
---|
| 560 | </para>
|
---|
| 561 |
|
---|
| 562 | <para>
|
---|
[d5d7cd6] | 563 | Occasionally, getting working sound in
|
---|
| 564 | <application>firefox</application> can be a problem. Although upstream
|
---|
| 565 | prefers pulseaudio,
|
---|
[326f830] | 566 | on balance using <application>Alsa</application> may be easier.
|
---|
| 567 | </para>
|
---|
| 568 |
|
---|
| 569 | <para>
|
---|
| 570 | If you enabled <application>Alsa</application> for sound, you may need
|
---|
| 571 | to alter one variable to get working sound. If you run
|
---|
[648f873] | 572 | <command>firefox</command> from a terminal and try to play something
|
---|
| 573 | with sound you might encounter error messages like:
|
---|
[326f830] | 574 | </para>
|
---|
| 575 |
|
---|
| 576 | <para>
|
---|
| 577 | <literal>Sandbox: seccomp sandbox violation: pid 3941, tid 4030,
|
---|
| 578 | syscall 16, args 48 2147767296 139909894784796 0 0 0.</literal>
|
---|
| 579 | </para>
|
---|
| 580 |
|
---|
| 581 | <para>
|
---|
| 582 | That was on x86_64, on i686 the syscall number is 54. To allow this
|
---|
| 583 | syscall, in <command>about:config</command> change
|
---|
| 584 | <command>security.sandbox.content.syscall_whitelist</command> to 16
|
---|
| 585 | (or 54 if using i686).
|
---|
| 586 | </para>
|
---|
| 587 |
|
---|
| 588 | <para>
|
---|
| 589 | If you use <command>pulseaudio</command> in a Desktop Environment, it
|
---|
| 590 | might already be started by that DE. But if it is not, although
|
---|
[7ebe22e] | 591 | firefox-57 managed to start it, firefox-58 did not. If you run
|
---|
[648f873] | 592 | <command>firefox</command> from a terminal and this problem is present,
|
---|
[7ebe22e] | 593 | trying to play sound will
|
---|
[326f830] | 594 | encounter error messages warning <literal>Can't get cubeb
|
---|
| 595 | context!</literal>
|
---|
| 596 | </para>
|
---|
| 597 |
|
---|
| 598 | <para>
|
---|
| 599 | The fix for this is to close firefox, start pulseaudio to check it
|
---|
| 600 | does start (if not, read the information on Configuring in <xref
|
---|
| 601 | linkend="pulseaudio"/>) and restart firefox to check it is working.
|
---|
| 602 | If it now works, add the following to your <filename>~/.xinitrc</filename>:
|
---|
| 603 | <phrase revision="sysv">
|
---|
| 604 | <literal>pulseaudio --verbose --log-target=syslog&</literal></phrase>
|
---|
| 605 | <phrase revision="systemd">
|
---|
| 606 | <literal>pulseaudio --verbose --log-target=journald&</literal></phrase>
|
---|
| 607 | (unfortunately, on some systems this does not work).
|
---|
| 608 | </para>
|
---|
| 609 |
|
---|
| 610 | <para>
|
---|
| 611 | You may wish to use multiple profiles within firefox. To do that, invoke
|
---|
| 612 | firefox as <command>firefox --ProfileManager</command>. You can also
|
---|
| 613 | check which profile is currently in use from
|
---|
| 614 | <command>about:profiles</command>.
|
---|
| 615 | </para>
|
---|
| 616 |
|
---|
[d5d7cd6] | 617 | <para>
|
---|
| 618 | Although WebRender (using the GPU for compositing) is not used by
|
---|
| 619 | default, it now appears to work well on supported hardware (ATI, Nvidia
|
---|
[648f873] | 620 | and Intel GPUs with Mesa-18 or later). For an explanation, please see
|
---|
[d5d7cd6] | 621 | <ulink
|
---|
| 622 | url="https://hacks.mozilla.org/2017/10/the-whole-web-at-maximum-fps-how-webrender-gets-rid-of-jank/">hacks.mozilla.org</ulink>.
|
---|
| 623 | The only downside seems to be that on a machine with limited RAM it might
|
---|
| 624 | use more RAM.
|
---|
| 625 | </para>
|
---|
| 626 |
|
---|
| 627 | <para>
|
---|
| 628 | To check if WebRender is being used, look in about:support. In the Graphics
|
---|
[648f873] | 629 | section, Compositing will either show 'Basic' (i.e. not in use) or
|
---|
[d5d7cd6] | 630 | 'WebRender'. To enable it, go to about:config and change gfx.webrender.all
|
---|
| 631 | to True. You will need to restart firefox.
|
---|
| 632 | </para>
|
---|
| 633 |
|
---|
| 634 | <para>
|
---|
| 635 | It may be useful to mention the processes from firefox which can appear in
|
---|
| 636 | <command>top</command> - as well as firefox itself, there may be multiple
|
---|
| 637 | Web Content processes, and now an RDD Process (Remote Data Decoder) which
|
---|
| 638 | appears when playing web videos encoded with av1 (libdav1d). If WebRender
|
---|
| 639 | has been enabled, a GPU Process will also appear when firefox has to
|
---|
| 640 | repaint (e.g. scrolling, opening a new tab, or playing a video).
|
---|
| 641 | </para>
|
---|
| 642 |
|
---|
[326f830] | 643 | </sect3>
|
---|
[88cec02] | 644 | </sect2>
|
---|
| 645 |
|
---|
[b81991e1] | 646 | <sect2 role="content">
|
---|
| 647 | <title>Contents</title>
|
---|
| 648 |
|
---|
| 649 | <segmentedlist>
|
---|
| 650 | <segtitle>Installed Programs</segtitle>
|
---|
| 651 | <segtitle>Installed Libraries</segtitle>
|
---|
[c5f005b] | 652 | <segtitle>Installed Directory</segtitle>
|
---|
[b81991e1] | 653 |
|
---|
| 654 | <seglistitem>
|
---|
[0e37869] | 655 | <seg>
|
---|
| 656 | firefox
|
---|
| 657 | </seg>
|
---|
[c1ae13c] | 658 | <seg>
|
---|
| 659 | Numerous libraries, browser components, plugins, extensions, and
|
---|
[8d0bc761] | 660 | helper modules installed in /usr/lib/firefox
|
---|
[c1ae13c] | 661 | </seg>
|
---|
[7498751] | 662 | <seg>
|
---|
[87fa171] | 663 | /usr/lib/firefox
|
---|
[7498751] | 664 | </seg>
|
---|
[b81991e1] | 665 | </seglistitem>
|
---|
| 666 | </segmentedlist>
|
---|
| 667 |
|
---|
| 668 | <variablelist>
|
---|
| 669 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 670 | <?dbfo list-presentation="list"?>
|
---|
| 671 | <?dbhtml list-presentation="table"?>
|
---|
| 672 |
|
---|
| 673 | <varlistentry id="firefox-prog">
|
---|
| 674 | <term><command>firefox</command></term>
|
---|
| 675 | <listitem>
|
---|
[c1ae13c] | 676 | <para>
|
---|
[4e207bb] | 677 | is a <application>GTK+-3</application> internet browser that uses
|
---|
| 678 | the Mozilla Gecko rendering engine
|
---|
[c1ae13c] | 679 | </para>
|
---|
[b81991e1] | 680 | <indexterm zone="firefox firefox-prog">
|
---|
| 681 | <primary sortas="b-firefox">firefox</primary>
|
---|
| 682 | </indexterm>
|
---|
| 683 | </listitem>
|
---|
| 684 | </varlistentry>
|
---|
[0e37869] | 685 |
|
---|
[b81991e1] | 686 | </variablelist>
|
---|
[0e37869] | 687 |
|
---|
[b81991e1] | 688 | </sect2>
|
---|
[0e37869] | 689 |
|
---|
[4d37129] | 690 | </sect1>
|
---|