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