[ab4fdfc] | 1 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
[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 " ">
|
---|
[657c8a0] | 9 | <!ENTITY firefox-md5sum "8d2e8b9115580dcbdeafeee60699ec81">
|
---|
| 10 | <!ENTITY firefox-size "537 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 -->
|
---|
[801d1d1] | 14 | <!ENTITY firefox-buildsize "6.8 GB (222 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 -->
|
---|
[657c8a0] | 18 | <!ENTITY firefox-time "14 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 |
|
---|
[0d715637] | 42 | &lfs122_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"/>,
|
---|
[6292849] | 138 | <xref linkend="gtk3"/>,
|
---|
[326f830] | 139 | <xref linkend="libnotify"/>,
|
---|
[f572dbb] | 140 | <xref linkend="llvm"/> (with clang, used for bindgen even if using gcc),
|
---|
[fe5f563d] | 141 | <xref linkend="nodejs"/>,
|
---|
[be0bd12] | 142 | <xref linkend="pulseaudio"/>
|
---|
[81b3e7fd] | 143 | (or
|
---|
[9da4cc6f] | 144 | <xref linkend="alsa-lib"/> if you edit the mozconfig;
|
---|
[326f830] | 145 | now deprecated by mozilla), in either case please read the
|
---|
| 146 | Configuration Information,
|
---|
[3c0d58e] | 147 | <xref linkend="python3"/> (after installing <xref linkend="sqlite"/>),
|
---|
[7877690] | 148 | <xref linkend="startup-notification"/>, and
|
---|
| 149 | <xref linkend="unzip"/>
|
---|
[c1ae13c] | 150 | </para>
|
---|
| 151 |
|
---|
[1555d3d] | 152 | <bridgehead renderas="sect4">Recommended</bridgehead>
|
---|
[c1ae13c] | 153 | <para role="recommended">
|
---|
[b84fe71] | 154 | <xref linkend="icu"/>,
|
---|
[0e37869] | 155 | <xref linkend="libevent"/>,
|
---|
[569d3364] | 156 | <xref linkend="libvpx"/>,
|
---|
[e399c12] | 157 | <xref linkend="libwebp"/>,
|
---|
[f7fe3e6] | 158 | <xref linkend="nasm"/>, and
|
---|
[569d3364] | 159 | <xref linkend="nss"/>
|
---|
[c1ae13c] | 160 | </para>
|
---|
[1555d3d] | 161 |
|
---|
[0e37869] | 162 | <note>
|
---|
| 163 | <para>
|
---|
[b9f61df] | 164 | If you don't install recommended dependencies, then internal copies of
|
---|
| 165 | those packages will be used. They might be tested to work, but they can
|
---|
| 166 | be out of date or contain security holes.
|
---|
[0e37869] | 167 | </para>
|
---|
| 168 | </note>
|
---|
[8d0bc761] | 169 |
|
---|
[b81991e1] | 170 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
[c1ae13c] | 171 | <para role="optional">
|
---|
[6c64623f] | 172 | <xref linkend="curl"/>,
|
---|
[c1ae13c] | 173 | <xref linkend="doxygen"/>,
|
---|
[babf0a0] | 174 | <xref role="runtime" linkend="ffmpeg"/> (runtime, to play mov, mp3 or mp4 files),
|
---|
[53cd9807] | 175 | <xref role="runtime" linkend="geoclue2"/> (runtime),
|
---|
[fe30eab] | 176 | <xref linkend="liboauth"/>,
|
---|
[0bb7c72] | 177 | <xref role="runtime" linkend="pciutils"/> (runtime),
|
---|
[566fcae] | 178 | <xref linkend="valgrind"/>,
|
---|
[6000a3e] | 179 | <xref linkend="wget"/>,
|
---|
[73b06df] | 180 | <xref linkend="wireless_tools"/>,
|
---|
[7877690] | 181 | <xref linkend="yasm"/>,
|
---|
[d5d7cd6] | 182 | <ulink url="https://github.com/libproxy/libproxy">libproxy</ulink>
|
---|
[c1ae13c] | 183 | </para>
|
---|
| 184 |
|
---|
| 185 | <para condition="html" role="usernotes">
|
---|
[42ddc30] | 186 | Editor Notes: <ulink url="&blfs-wiki;/firefox"/>
|
---|
[c1ae13c] | 187 | </para>
|
---|
[b81991e1] | 188 | </sect2>
|
---|
| 189 |
|
---|
| 190 | <sect2 role="installation">
|
---|
| 191 | <title>Installation of Firefox</title>
|
---|
| 192 |
|
---|
[f72a04a] | 193 | <para>
|
---|
[b9f61df] | 194 | The configuration of <application>Firefox</application> is accomplished
|
---|
| 195 | by creating a <filename>mozconfig</filename> file containing the desired
|
---|
| 196 | configuration options. A default <filename>mozconfig</filename> is
|
---|
| 197 | created below. To see the entire list of available configuration options
|
---|
[888e303] | 198 | (and an abbreviated description of some of them), issue <command>./mach
|
---|
[7f1e70b] | 199 | configure -- --help | less</command>. You may also
|
---|
[888e303] | 200 | wish to review the entire file and uncomment any other desired options.
|
---|
| 201 | Create the file by issuing the following command:
|
---|
[c1ae13c] | 202 | </para>
|
---|
[5a13c45] | 203 |
|
---|
[0e37869] | 204 | <screen><userinput>cat > mozconfig << "EOF"
|
---|
[dcb0fe6] | 205 | <literal># If you have a multicore machine, all cores will be used by default.
|
---|
| 206 |
|
---|
[703f0ce] | 207 | # If you have installed (or will install) wireless-tools, and you wish
|
---|
| 208 | # to use geolocation web services, comment out this line
|
---|
[6d1bf0e] | 209 | ac_add_options --disable-necko-wifi
|
---|
| 210 |
|
---|
[83c67d14] | 211 | # Comment out the following line if you wish not to use Google's Location
|
---|
| 212 | # Service (GLS). Note that if Geoclue is installed and configured to use
|
---|
| 213 | # GLS (as the BLFS instruction does), Firefox can access GLS via Geoclue
|
---|
| 214 | # anyway. On the other hand if Geoclue is not installed (or not properly
|
---|
| 215 | # configured) and this line is commented out, the website requiring a
|
---|
| 216 | # location service will not function properly.
|
---|
[72beb00] | 217 | ac_add_options --with-google-location-service-api-keyfile=$PWD/google-key
|
---|
[ad5a97d] | 218 |
|
---|
[d5d7cd6] | 219 | # startup-notification is required since firefox-78
|
---|
[495ebe07] | 220 |
|
---|
[87fa171] | 221 | # Uncomment the following option if you have not installed PulseAudio and
|
---|
[a72c6662] | 222 | # want to use alsa instead
|
---|
[87fa171] | 223 | #ac_add_options --enable-audio-backends=alsa
|
---|
[89cdb63d] | 224 |
|
---|
[0e37869] | 225 | # Comment out following options if you have not installed
|
---|
| 226 | # recommended dependencies:
|
---|
[569d3364] | 227 | ac_add_options --with-system-icu
|
---|
[0e37869] | 228 | ac_add_options --with-system-libevent
|
---|
[569d3364] | 229 | ac_add_options --with-system-libvpx
|
---|
[0e37869] | 230 | ac_add_options --with-system-nspr
|
---|
| 231 | ac_add_options --with-system-nss
|
---|
[569d3364] | 232 | ac_add_options --with-system-webp
|
---|
[9a469bc] | 233 |
|
---|
[a737350] | 234 | # The libdav1d library (av1 decoder) requires nasm. Uncomment this
|
---|
| 235 | # if nasm has not been installed. Do not uncomment this if you have
|
---|
[c528a3e] | 236 | # ffmpeg installed.
|
---|
[e399c12] | 237 | #ac_add_options --disable-av1
|
---|
[0a561d8] | 238 |
|
---|
[a737350] | 239 | # You cannot distribute the binary if you do this.
|
---|
[9a469bc] | 240 | ac_add_options --enable-official-branding
|
---|
[0e37869] | 241 |
|
---|
[14de4227] | 242 | # Stripping is now enabled by default.
|
---|
| 243 | # Uncomment these lines if you need to run a debugger:
|
---|
| 244 | #ac_add_options --disable-strip
|
---|
| 245 | #ac_add_options --disable-install-strip
|
---|
| 246 |
|
---|
[e399c12] | 247 | # Disabling debug symbols makes the build much smaller and a little
|
---|
[7f44495] | 248 | # faster. Comment this if you need to run a debugger.
|
---|
[e399c12] | 249 | ac_add_options --disable-debug-symbols
|
---|
[c9677a35] | 250 |
|
---|
[d5d7cd6] | 251 | # The BLFS editors recommend not changing anything below this line:
|
---|
| 252 | ac_add_options --prefix=/usr
|
---|
| 253 | ac_add_options --enable-application=browser
|
---|
[5f5dcc2] | 254 | ac_add_options --disable-crashreporter
|
---|
| 255 | ac_add_options --disable-updater
|
---|
[a737350] | 256 |
|
---|
| 257 | # Enabling the tests will use a lot more space and significantly
|
---|
[57a8df2] | 258 | # increase the build time, for no obvious benefit.
|
---|
[0e37869] | 259 | ac_add_options --disable-tests
|
---|
| 260 |
|
---|
[c025978] | 261 | # This enables SIMD optimization in the shipped encoding_rs crate.
|
---|
| 262 | ac_add_options --enable-rust-simd
|
---|
[0e37869] | 263 |
|
---|
[41f2e90] | 264 | ac_add_options --enable-system-ffi
|
---|
[0e37869] | 265 | ac_add_options --enable-system-pixman
|
---|
| 266 |
|
---|
[a0ace670] | 267 | ac_add_options --with-system-jpeg
|
---|
| 268 | ac_add_options --with-system-png
|
---|
| 269 | ac_add_options --with-system-zlib
|
---|
[aed37975] | 270 |
|
---|
[efe8cf09] | 271 | # Sandboxing works well on x86_64 but might cause issues on other
|
---|
[10dc2b3] | 272 | # platforms, e.g. i686.
|
---|
| 273 | [ $(uname -m) != x86_64 ] && ac_add_options --disable-sandbox
|
---|
[efe8cf09] | 274 |
|
---|
[e51466a] | 275 | # Using sandboxed wasm libraries has been moved to all builds instead
|
---|
| 276 | # of only mozilla automation builds. It requires extra llvm packages
|
---|
| 277 | # and was reported to seriously slow the build. Disable it.
|
---|
| 278 | ac_add_options --without-wasm-sandboxed-libraries
|
---|
| 279 |
|
---|
[1b0a207] | 280 | # The following option unsets Telemetry Reporting. With the Addons Fiasco,
|
---|
| 281 | # Mozilla was found to be collecting user's data, including saved passwords and
|
---|
| 282 | # web form data, without users consent. Mozilla was also found shipping updates
|
---|
| 283 | # to systems without the user's knowledge or permission.
|
---|
| 284 | # As a result of this, use the following command to permanently disable
|
---|
| 285 | # telemetry reporting in Firefox.
|
---|
| 286 | unset MOZ_TELEMETRY_REPORTING
|
---|
| 287 |
|
---|
[4def8b6] | 288 | mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/firefox-build-dir</literal>
|
---|
[0e37869] | 289 | EOF</userinput></screen>
|
---|
[c48815ad] | 290 |
|
---|
| 291 | <!-- https://phabricator.services.mozilla.com/D219025 -->
|
---|
[801d1d1] | 292 | <!--
|
---|
[c48815ad] | 293 | <para>
|
---|
| 294 | Adapt two files for compatibility with cbindgen-0.27.0 or later:
|
---|
| 295 | </para>
|
---|
| 296 |
|
---|
| 297 | <screen><userinput>sed 's/input.try/&_parse/' \
|
---|
| 298 | -i servo/components/style_traits/values.rs &&
|
---|
| 299 | sed '0,/"Keyframe"/{//d}' -i servo/ports/geckolib/cbindgen.toml</userinput></screen>
|
---|
[801d1d1] | 300 | -->
|
---|
[b9b7146] | 301 |
|
---|
[b4079e2] | 302 | <!-- https://bugzilla.mozilla.org/show_bug.cgi?id=1859752
|
---|
| 303 | https://hg.mozilla.org/try/rev/d5f3b0c4f08a -->
|
---|
| 304 | <para>
|
---|
| 305 | If building with system ICU, adapt the line break mapping for ICU
|
---|
| 306 | 74 or later. This construct adds five entries to a c++ array.
|
---|
| 307 | </para>
|
---|
| 308 |
|
---|
| 309 | <screen><userinput>for i in {43..47}; do
|
---|
| 310 | sed -i '/ZWJ/s/}/,CLASS_CHARACTER&/' intl/lwbrk/LineBreaker.cpp
|
---|
| 311 | done</userinput></screen>
|
---|
| 312 |
|
---|
[c1ae13c] | 313 | <para>
|
---|
| 314 | Compile <application>Firefox</application> by issuing the following
|
---|
| 315 | commands:
|
---|
| 316 | </para>
|
---|
[9737271] | 317 | <!-- Not needed with clang. Upstream bug at
|
---|
[e51466a] | 318 | https://bugzilla.mozilla.org/show_bug.cgi?id=1729459
|
---|
| 319 |
|
---|
[d468e96] | 320 | <para>
|
---|
| 321 | If building on a 32 bit machine, the following sed works around
|
---|
[0a0e996] | 322 | an issue with an incompatible <quote>double</quote> type in one
|
---|
[d468e96] | 323 | header file:
|
---|
| 324 | </para>
|
---|
| 325 |
|
---|
| 326 | <screen><userinput>case "$(uname -m)" in
|
---|
| 327 | i?86) sed -e '/typedef[ ]*double/s/double/long double/' \
|
---|
| 328 | -i modules/fdlibm/src/math_private.h ;;
|
---|
| 329 | esac</userinput></screen>
|
---|
[9737271] | 330 | -->
|
---|
[ad5a97d] | 331 | <para>
|
---|
| 332 | If the geolocation APIs are needed:
|
---|
| 333 | </para>
|
---|
| 334 |
|
---|
[e5c8de01] | 335 | <note>
|
---|
| 336 | <para>
|
---|
| 337 | <!-- Taken from Arch Linux - an immensely helpful link - Thanks -->
|
---|
[4e5920a5] | 338 | The Google API Key below is specific to LFS. If using these
|
---|
| 339 | instructions for another distro, or if you intend to distribute
|
---|
[e5c8de01] | 340 | binary copies of the software using these instructions, please obtain
|
---|
[4e5920a5] | 341 | your own key following the instructions located at
|
---|
| 342 | <ulink url="https://www.chromium.org/developers/how-tos/api-keys"/>.
|
---|
[e5c8de01] | 343 | <!-- BLFS Devs, register an account at Google with your
|
---|
| 344 | @linuxfromscratch.org email address, and I'll make you an administrator
|
---|
| 345 | for the 'Google APIs for LFS' project (where the API and OAuth keys
|
---|
| 346 | were created for use in the book).-->
|
---|
| 347 | </para>
|
---|
| 348 | </note>
|
---|
| 349 |
|
---|
[4e5920a5] | 350 | <screen><userinput>echo "AIzaSyDxKL42zsPjbke5O8_rPVpVrLrJ8aeE9rQ" > google-key</userinput></screen>
|
---|
[ad5a97d] | 351 |
|
---|
[5b0a978e] | 352 | <note>
|
---|
| 353 | <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
---|
| 354 | href="../../xincludes/mozshm.xml"/>
|
---|
| 355 | </note>
|
---|
[686afa98] | 356 |
|
---|
[9403c3e] | 357 | <!--<para>
|
---|
[9d98701] | 358 | Fix building Firefox with Clang 16 or C++ headers from GCC 13.
|
---|
[fa47dacd] | 359 | And, work around a build failure with Rustc-1.70.0:
|
---|
[686afa98] | 360 | </para>
|
---|
| 361 |
|
---|
[9d98701] | 362 | <screen><userinput remap="pre">patch -Np1 -i ../firefox-&firefox-version;-consolidated-1.patch</userinput></screen>
|
---|
[bca9385] | 363 |
|
---|
| 364 | <para>
|
---|
| 365 | Apply the following patch so that firefox is able to play H.264 videos:
|
---|
| 366 | </para>
|
---|
| 367 |
|
---|
[9403c3e] | 368 | <screen><userinput remap="pre">patch -Np1 -i ../firefox-&firefox-version;-ffmpeg_6-1.patch</userinput></screen>-->
|
---|
[686afa98] | 369 |
|
---|
[f91b7bb] | 370 | <!-- https://github.com/rust-lang/rust-bindgen/pull/2689 -->
|
---|
[e463031] | 371 | <!--
|
---|
[f91b7bb] | 372 | <para>
|
---|
| 373 | Adapt the shipped <application>rust-bindgen</application> copy for
|
---|
| 374 | LLVM-18 and later, and tell <command>cargo</command> we've modified
|
---|
| 375 | the code of <application>rust-bindgen</application> so the checksum
|
---|
| 376 | verification of this crate should be skipped:
|
---|
| 377 | </para>
|
---|
| 378 |
|
---|
| 379 | <screen><userinput>sed -e "/match cursor.kind()/a \
|
---|
| 380 | CXCursor_LinkageSpec => return Err(ParseError::Recurse)," \
|
---|
| 381 | -i third_party/rust/bindgen/ir/item.rs &&
|
---|
| 382 |
|
---|
| 383 | cat >> Cargo.toml << EOF &&
|
---|
| 384 | <literal>[patch.crates-io.bindgen_0_64_0]
|
---|
| 385 | package = "bindgen"
|
---|
| 386 | version = "0.64.0"
|
---|
| 387 | path = "third_party/rust/bindgen"</literal>
|
---|
| 388 | EOF
|
---|
| 389 |
|
---|
| 390 | sed -r '/name = "bindgen"/,+5 s/^source|^checksum/#&/' \
|
---|
| 391 | -i Cargo.lock</userinput></screen>
|
---|
[e463031] | 392 | -->
|
---|
[f91b7bb] | 393 |
|
---|
| 394 | <!-- https://hg.mozilla.org/mozilla-central/rev/ba6abbd36b49 -->
|
---|
[e463031] | 395 | <!--
|
---|
[f91b7bb] | 396 | <para>
|
---|
| 397 | Adapt the WebRTC code to use 64-bit timestamp to fix a build
|
---|
| 398 | failure with Clang-18 and later:
|
---|
| 399 | </para>
|
---|
| 400 |
|
---|
| 401 | <screen><userinput>sed 's/uint32_t timestamp/uint64_t timestamp/' \
|
---|
| 402 | -i dom/media/gmp-plugin-openh264/gmp-fake-openh264.cpp \
|
---|
| 403 | dom/media/gtest/TestGMPRemoveAndDelete.cpp \
|
---|
| 404 | dom/media/webrtc/libwebrtcglue/WebrtcGmpVideoCodec.cpp &&
|
---|
| 405 |
|
---|
| 406 | sed '/mInputImageMap/s/uint32_t/uint64_t/' \
|
---|
| 407 | -i dom/media/webrtc/libwebrtcglue/WebrtcGmpVideoCodec.h</userinput></screen>
|
---|
| 408 |
|
---|
[cbfd207] | 409 | <para>
|
---|
| 410 | Remove several lines of Rust code only useful for ARM and failing to
|
---|
| 411 | compile with Rustc-1.78.0 or newer:
|
---|
| 412 | </para>
|
---|
| 413 |
|
---|
| 414 | <screen><userinput>sed '/cfg_attr/,/)]/d' -i gfx/qcms/src/lib.rs</userinput></screen>
|
---|
[e463031] | 415 | -->
|
---|
[cbfd207] | 416 |
|
---|
[29b0395] | 417 | <para>
|
---|
[8d70628] | 418 | Now invoke the Python <command>mach</command> script to compile the package.
|
---|
[29b0395] | 419 | </para>
|
---|
[e8d45427] | 420 |
|
---|
[97e8769] | 421 | <screen><userinput>export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=none &&
|
---|
[fce78fd] | 422 | export MOZBUILD_STATE_PATH=${PWD}/mozbuild &&
|
---|
[99d85abd] | 423 | ./mach build</userinput></screen>
|
---|
[3bdfc9fd] | 424 |
|
---|
[0e37869] | 425 | <para>
|
---|
[57a8df2] | 426 | The <filename>mozconfig</filename> above disables the tests because
|
---|
| 427 | they use a lot more time and disk space for no obvious benefit. If
|
---|
[ecffcbbc] | 428 | you have nevertheless enabled them, you can run the tests by executing
|
---|
| 429 | <command>./mach gtest</command>. This will require a network connection,
|
---|
| 430 | and to be run from within an Xorg session - there is a popup dialog
|
---|
| 431 | when it fails to connect to ALSA (that does not create a failed test).
|
---|
| 432 | One or two tests will fail. To see the details of the failure(s) you
|
---|
| 433 | will need to log the output from that command so that you can review it.
|
---|
[0e37869] | 434 | </para>
|
---|
[01ce75f8] | 435 |
|
---|
[495ebe07] | 436 | <para>
|
---|
[b9f61df] | 437 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
[c1ae13c] | 438 | </para>
|
---|
[5a13c45] | 439 |
|
---|
[97e8769] | 440 | <screen role="root"><userinput>export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=none &&
|
---|
[99d85abd] | 441 | ./mach install</userinput></screen>
|
---|
[fe5f563d] | 442 |
|
---|
[a5708ba] | 443 | <para>
|
---|
[8d70628] | 444 | Empty the environment variables which were set above:
|
---|
[a5708ba] | 445 | </para>
|
---|
| 446 |
|
---|
[97e8769] | 447 | <screen><userinput>unset MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE
|
---|
[99d85abd] | 448 | unset MOZBUILD_STATE_PATH</userinput></screen>
|
---|
[01ce75f8] | 449 |
|
---|
[b81991e1] | 450 | </sect2>
|
---|
| 451 |
|
---|
[361df3e] | 452 | <sect2 role="commands">
|
---|
| 453 | <title>Command Explanations</title>
|
---|
[7d09fcb9] | 454 |
|
---|
[fe5f563d] | 455 | <para>
|
---|
| 456 | <command>export MOZBUILD_STATE_PATH=${PWD}/mozbuild</command>: The build
|
---|
[5bd4e666] | 457 | tells you that it intends to create <filename
|
---|
[fe5f563d] | 458 | class="directory">~/.mozbuild</filename>, and offer you an option to
|
---|
| 459 | press <ENTER> to accept this, or Ctrl-C to cancel and restart the
|
---|
| 460 | build after specifying the directory. In practice, the message may not
|
---|
| 461 | appear until after <ENTER> is keyed, i.e. the build stalls.
|
---|
| 462 | </para>
|
---|
| 463 |
|
---|
| 464 | <para>
|
---|
| 465 | That directory is used for a (probably random) telemetry identifier.
|
---|
[5bd4e666] | 466 | Creating this directory within the build directory and deleting it after the
|
---|
| 467 | installation prevents it being used.
|
---|
[883e376] | 468 | </para>
|
---|
| 469 |
|
---|
| 470 | <para>
|
---|
[16218efb] | 471 | <command>MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=none</command>: Use the
|
---|
[e51466a] | 472 | system python to create a virtual environment for <command>mach</command>
|
---|
[5bd4e666] | 473 | without downloading any python wheels and without using the system python modules.
|
---|
[9403c3e] | 474 | This prevents version mismatches between system modules and bundled ones.
|
---|
[883e376] | 475 | </para>
|
---|
| 476 |
|
---|
[67f44136] | 477 | <!--
|
---|
[883e376] | 478 | <para>
|
---|
| 479 | <command>./mach configure</command>: This validates the supplied
|
---|
| 480 | dependencies and the <filename>mozconfig</filename>.
|
---|
[fe5f563d] | 481 | </para>
|
---|
[67f44136] | 482 | -->
|
---|
[fe5f563d] | 483 |
|
---|
[c1ae13c] | 484 | <para>
|
---|
[326f830] | 485 | <option>./mach build --verbose</option>: Use this alternative if you
|
---|
| 486 | need details of which files are being compiled, together with any C or
|
---|
[648f873] | 487 | C++ flags being used. But do not add '--verbose' to the install command
|
---|
| 488 | since it is not accepted there.
|
---|
[c1ae13c] | 489 | </para>
|
---|
| 490 |
|
---|
[9a469bc] | 491 | <para>
|
---|
[fe5f563d] | 492 | <option>./mach build -jN</option>: The build should, by default, use
|
---|
[d5d7cd6] | 493 | all the online CPU cores. If using all the cores causes the build to swap
|
---|
| 494 | because you have insufficient memory, using fewer cores can be faster.
|
---|
[9a469bc] | 495 | </para>
|
---|
| 496 |
|
---|
[c1ae13c] | 497 | <para>
|
---|
[f572dbb] | 498 | <option><envar>CC=gcc CXX=g++</envar></option>: BLFS used to
|
---|
[e51466a] | 499 | prefer to use gcc and g++ instead of upstream's defaults of the
|
---|
| 500 | <application>clang</application> programs. With the release of
|
---|
| 501 | gcc-12 the build takes longer with gcc and g++, primarily because
|
---|
| 502 | of extra warnings, and is bigger. Set these environment variables
|
---|
| 503 | <emphasis>before you run the configure script</emphasis>
|
---|
[f572dbb] | 504 | if you wish to continue to use gcc, g++. Building
|
---|
| 505 | with GCC on i?86 is currently broken.
|
---|
[c1ae13c] | 506 | </para>
|
---|
[fa1bc3e] | 507 |
|
---|
[b81991e1] | 508 | </sect2>
|
---|
| 509 |
|
---|
[88cec02] | 510 | <sect2 role="configuration">
|
---|
| 511 | <title>Configuring Firefox</title>
|
---|
| 512 |
|
---|
[c1ae13c] | 513 | <para>
|
---|
| 514 | If you use a desktop environment like <application>Gnome</application> or
|
---|
[8dacd5e] | 515 | <application>KDE</application> you may want to create a
|
---|
[c1ae13c] | 516 | <filename>firefox.desktop</filename> file so that
|
---|
[1fe05eb] | 517 | <application>Firefox</application> appears in the panel's menus.
|
---|
[8dacd5e] | 518 | As the &root; user:
|
---|
[c1ae13c] | 519 | </para>
|
---|
[31de6e7] | 520 |
|
---|
[eb5f847a] | 521 | <screen role="root"><userinput>mkdir -pv /usr/share/applications &&
|
---|
[28909b72] | 522 | mkdir -pv /usr/share/pixmaps &&
|
---|
[74f73ede] | 523 |
|
---|
[8dacd5e] | 524 | MIMETYPE="text/xml;text/mml;text/html;" &&
|
---|
| 525 | MIMETYPE+="application/xhtml+xml;application/vnd.mozilla.xul+xml;" &&
|
---|
| 526 | MIMETYPE+="x-scheme-handler/http;x-scheme-handler/https" &&
|
---|
[28909b72] | 527 |
|
---|
| 528 | cat > /usr/share/applications/firefox.desktop << EOF &&
|
---|
[fcd66369] | 529 | <literal>[Desktop Entry]
|
---|
[31de6e7] | 530 | Encoding=UTF-8
|
---|
[0e37869] | 531 | Name=Firefox Web Browser
|
---|
| 532 | Comment=Browse the World Wide Web
|
---|
| 533 | GenericName=Web Browser
|
---|
| 534 | Exec=firefox %u
|
---|
| 535 | Terminal=false
|
---|
[31de6e7] | 536 | Type=Application
|
---|
| 537 | Icon=firefox
|
---|
[0e37869] | 538 | Categories=GNOME;GTK;Network;WebBrowser;
|
---|
[28909b72] | 539 | MimeType=$MIMETYPE
|
---|
[fcd66369] | 540 | StartupNotify=true</literal>
|
---|
[31de6e7] | 541 | EOF
|
---|
[74f73ede] | 542 |
|
---|
[28909b72] | 543 | unset MIMETYPE &&
|
---|
| 544 |
|
---|
[888e303] | 545 | ln -sfv /usr/lib/firefox/browser/chrome/icons/default/default128.png \
|
---|
[0e37869] | 546 | /usr/share/pixmaps/firefox.png</userinput></screen>
|
---|
| 547 |
|
---|
[326f830] | 548 | <sect3><title>Configuration Information</title>
|
---|
| 549 |
|
---|
| 550 | <para>
|
---|
| 551 | The application settings for firefox are accessible by keying
|
---|
| 552 | <command>about:config</command> in the address bar.
|
---|
| 553 | </para>
|
---|
| 554 |
|
---|
| 555 | <para>
|
---|
[d5d7cd6] | 556 | Occasionally, getting working sound in
|
---|
| 557 | <application>firefox</application> can be a problem. Although upstream
|
---|
| 558 | prefers pulseaudio,
|
---|
[326f830] | 559 | on balance using <application>Alsa</application> may be easier.
|
---|
| 560 | </para>
|
---|
| 561 |
|
---|
| 562 | <para>
|
---|
| 563 | If you enabled <application>Alsa</application> for sound, you may need
|
---|
| 564 | to alter one variable to get working sound. If you run
|
---|
[648f873] | 565 | <command>firefox</command> from a terminal and try to play something
|
---|
| 566 | with sound you might encounter error messages like:
|
---|
[326f830] | 567 | </para>
|
---|
| 568 |
|
---|
| 569 | <para>
|
---|
| 570 | <literal>Sandbox: seccomp sandbox violation: pid 3941, tid 4030,
|
---|
| 571 | syscall 16, args 48 2147767296 139909894784796 0 0 0.</literal>
|
---|
| 572 | </para>
|
---|
| 573 |
|
---|
| 574 | <para>
|
---|
| 575 | That was on x86_64, on i686 the syscall number is 54. To allow this
|
---|
| 576 | syscall, in <command>about:config</command> change
|
---|
| 577 | <command>security.sandbox.content.syscall_whitelist</command> to 16
|
---|
| 578 | (or 54 if using i686).
|
---|
| 579 | </para>
|
---|
| 580 |
|
---|
| 581 | <para>
|
---|
| 582 | If you use <command>pulseaudio</command> in a Desktop Environment, it
|
---|
| 583 | might already be started by that DE. But if it is not, although
|
---|
[7ebe22e] | 584 | firefox-57 managed to start it, firefox-58 did not. If you run
|
---|
[648f873] | 585 | <command>firefox</command> from a terminal and this problem is present,
|
---|
[7ebe22e] | 586 | trying to play sound will
|
---|
[326f830] | 587 | encounter error messages warning <literal>Can't get cubeb
|
---|
| 588 | context!</literal>
|
---|
| 589 | </para>
|
---|
| 590 |
|
---|
| 591 | <para>
|
---|
| 592 | The fix for this is to close firefox, start pulseaudio to check it
|
---|
| 593 | does start (if not, read the information on Configuring in <xref
|
---|
| 594 | linkend="pulseaudio"/>) and restart firefox to check it is working.
|
---|
| 595 | If it now works, add the following to your <filename>~/.xinitrc</filename>:
|
---|
| 596 | <phrase revision="sysv">
|
---|
| 597 | <literal>pulseaudio --verbose --log-target=syslog&</literal></phrase>
|
---|
| 598 | <phrase revision="systemd">
|
---|
| 599 | <literal>pulseaudio --verbose --log-target=journald&</literal></phrase>
|
---|
| 600 | (unfortunately, on some systems this does not work).
|
---|
| 601 | </para>
|
---|
| 602 |
|
---|
| 603 | <para>
|
---|
| 604 | You may wish to use multiple profiles within firefox. To do that, invoke
|
---|
| 605 | firefox as <command>firefox --ProfileManager</command>. You can also
|
---|
| 606 | check which profile is currently in use from
|
---|
| 607 | <command>about:profiles</command>.
|
---|
| 608 | </para>
|
---|
| 609 |
|
---|
[d5d7cd6] | 610 | <para>
|
---|
| 611 | Although WebRender (using the GPU for compositing) is not used by
|
---|
| 612 | default, it now appears to work well on supported hardware (ATI, Nvidia
|
---|
[648f873] | 613 | and Intel GPUs with Mesa-18 or later). For an explanation, please see
|
---|
[d5d7cd6] | 614 | <ulink
|
---|
| 615 | url="https://hacks.mozilla.org/2017/10/the-whole-web-at-maximum-fps-how-webrender-gets-rid-of-jank/">hacks.mozilla.org</ulink>.
|
---|
| 616 | The only downside seems to be that on a machine with limited RAM it might
|
---|
| 617 | use more RAM.
|
---|
| 618 | </para>
|
---|
| 619 |
|
---|
| 620 | <para>
|
---|
| 621 | To check if WebRender is being used, look in about:support. In the Graphics
|
---|
[648f873] | 622 | section, Compositing will either show 'Basic' (i.e. not in use) or
|
---|
[d5d7cd6] | 623 | 'WebRender'. To enable it, go to about:config and change gfx.webrender.all
|
---|
| 624 | to True. You will need to restart firefox.
|
---|
| 625 | </para>
|
---|
| 626 |
|
---|
| 627 | <para>
|
---|
| 628 | It may be useful to mention the processes from firefox which can appear in
|
---|
| 629 | <command>top</command> - as well as firefox itself, there may be multiple
|
---|
| 630 | Web Content processes, and now an RDD Process (Remote Data Decoder) which
|
---|
| 631 | appears when playing web videos encoded with av1 (libdav1d). If WebRender
|
---|
| 632 | has been enabled, a GPU Process will also appear when firefox has to
|
---|
| 633 | repaint (e.g. scrolling, opening a new tab, or playing a video).
|
---|
| 634 | </para>
|
---|
| 635 |
|
---|
[326f830] | 636 | </sect3>
|
---|
[88cec02] | 637 | </sect2>
|
---|
| 638 |
|
---|
[b81991e1] | 639 | <sect2 role="content">
|
---|
| 640 | <title>Contents</title>
|
---|
| 641 |
|
---|
| 642 | <segmentedlist>
|
---|
| 643 | <segtitle>Installed Programs</segtitle>
|
---|
| 644 | <segtitle>Installed Libraries</segtitle>
|
---|
[c5f005b] | 645 | <segtitle>Installed Directory</segtitle>
|
---|
[b81991e1] | 646 |
|
---|
| 647 | <seglistitem>
|
---|
[0e37869] | 648 | <seg>
|
---|
| 649 | firefox
|
---|
| 650 | </seg>
|
---|
[c1ae13c] | 651 | <seg>
|
---|
| 652 | Numerous libraries, browser components, plugins, extensions, and
|
---|
[8d0bc761] | 653 | helper modules installed in /usr/lib/firefox
|
---|
[c1ae13c] | 654 | </seg>
|
---|
[7498751] | 655 | <seg>
|
---|
[87fa171] | 656 | /usr/lib/firefox
|
---|
[7498751] | 657 | </seg>
|
---|
[b81991e1] | 658 | </seglistitem>
|
---|
| 659 | </segmentedlist>
|
---|
| 660 |
|
---|
| 661 | <variablelist>
|
---|
| 662 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 663 | <?dbfo list-presentation="list"?>
|
---|
| 664 | <?dbhtml list-presentation="table"?>
|
---|
| 665 |
|
---|
| 666 | <varlistentry id="firefox-prog">
|
---|
| 667 | <term><command>firefox</command></term>
|
---|
| 668 | <listitem>
|
---|
[c1ae13c] | 669 | <para>
|
---|
[4e207bb] | 670 | is a <application>GTK+-3</application> internet browser that uses
|
---|
| 671 | the Mozilla Gecko rendering engine
|
---|
[c1ae13c] | 672 | </para>
|
---|
[b81991e1] | 673 | <indexterm zone="firefox firefox-prog">
|
---|
| 674 | <primary sortas="b-firefox">firefox</primary>
|
---|
| 675 | </indexterm>
|
---|
| 676 | </listitem>
|
---|
| 677 | </varlistentry>
|
---|
[0e37869] | 678 |
|
---|
[b81991e1] | 679 | </variablelist>
|
---|
[0e37869] | 680 |
|
---|
[b81991e1] | 681 | </sect2>
|
---|
[0e37869] | 682 |
|
---|
[4d37129] | 683 | </sect1>
|
---|