| 1 |
.. _flatpak: |
| 2 |
|
| 3 |
========================= |
| 4 |
Firefox Flatpak Packaging |
| 5 |
========================= |
| 6 |
|
| 7 |
This page explains interactions between Firefox and Flatpak packaging format. |
| 8 |
|
| 9 |
Where is the upstream |
| 10 |
===================== |
| 11 |
|
| 12 |
The code reference itself is mozilla-central and the repackaging is under `the mach repackage flatpak command <https://searchfox.org/mozilla-central/source/python/mozbuild/mozbuild/repackaging/flatpak.py>`_. |
| 13 |
|
| 14 |
Where to report bugs |
| 15 |
==================== |
| 16 |
|
| 17 |
All bugs should be reported to Bugzilla in the appropriate component depending on the bug and marked as blocking the ``flatpak`` meta-bug. |
| 18 |
|
| 19 |
Build process |
| 20 |
============= |
| 21 |
|
| 22 |
Perform a build and then run ``mach repackage flatpak``, e.g.: |
| 23 |
|
| 24 |
.. code-block:: shell |
| 25 |
|
| 26 |
$ mach repackage flatpak \ |
| 27 |
--input target.tar.xz \ |
| 28 |
--name org.mozilla.firefox \ |
| 29 |
--arch aarch64 \ |
| 30 |
--version 137.0a1 \ |
| 31 |
--product firefox \ |
| 32 |
--release-type nightly \ |
| 33 |
--flatpak-branch nightly \ |
| 34 |
--template-dir browser/installer/linux/app/flatpak \ |
| 35 |
--langpack-pattern $PWD/langpacks/*.xpi \ |
| 36 |
--output test.flatpak.tar.xz, |
| 37 |
|
| 38 |
Where ``target.tar.xz`` can be a downloaded artifact from try build or built from a local build. You will also want to download `some langpack <https://ftp.mozilla.org/pub/firefox/nightly/latest-mozilla-central-l10n/linux-x86_64/xpi/>`_. |
| 39 |
|
| 40 |
How to hack on try |
| 41 |
================== |
| 42 |
|
| 43 |
Pushing to try is basically just: |
| 44 |
|
| 45 |
.. code-block:: shell |
| 46 |
|
| 47 |
$ mach try fuzzy --full -q "'repackage 'flatpak !shippable"` |
| 48 |
|
| 49 |
This will produce a repackage flatpak task at the end that generates a ``target.flatpak.tar.xz``. |
| 50 |
|
| 51 |
Installing the try build |
| 52 |
======================== |
| 53 |
|
| 54 |
Download and extract the previously generated ``target.flatpak.tar.xz`` and it will produce a ``./repo`` directory that you can directly use with flatpak: |
| 55 |
|
| 56 |
.. code-block:: shell |
| 57 |
|
| 58 |
$ flatpak --user --no-gpg-verify remote-add firefox-try ./repo/ |
| 59 |
|
| 60 |
This should add you a user-level firefox-try flatpak remote, you can verify with (``flathub`` remote may be a user or a system level remote): |
| 61 |
|
| 62 |
.. code-block:: shell |
| 63 |
|
| 64 |
$ flatpak remotes |
| 65 |
Name Options |
| 66 |
firefox-try user |
| 67 |
flathub user |
| 68 |
|
| 69 |
Then you can install your local build: |
| 70 |
|
| 71 |
.. code-block:: shell |
| 72 |
|
| 73 |
$ flatpak install firefox-try firefox |
| 74 |
Looking for matches… |
| 75 |
Found ref ‘app/org.mozilla.firefox/x86_64/nightly’ in remote ‘firefox-try’ (user). |
| 76 |
Use this ref? [Y/n]: y |
| 77 |
|
| 78 |
org.mozilla.firefox permissions: |
| 79 |
ipc network cups fallback-x11 pcsc pulseaudio wayland x11 devices |
| 80 |
devel file access [1] dbus access [2] bus ownership [3] system dbus access [4] |
| 81 |
|
| 82 |
[1] /run/.heim_org.h5l.kcm-socket, xdg-download, xdg-run/speech-dispatcher:ro |
| 83 |
[2] org.a11y.Bus, org.freedesktop.FileManager1, org.gtk.vfs.* |
| 84 |
[3] org.mozilla.firefox.*, org.mozilla.firefox_beta.*, org.mpris.MediaPlayer2.firefox.* |
| 85 |
[4] org.freedesktop.NetworkManager |
| 86 |
|
| 87 |
|
| 88 |
ID Branch Op Remote Download |
| 89 |
1. [✓] org.freedesktop.Platform.GL.default 24.08 u flathub 67,3 Mo / 156,6 Mo |
| 90 |
2. [✓] org.freedesktop.Platform.GL.default 24.08extra u flathub 3,9 Mo / 156,6 Mo |
| 91 |
3. [✓] org.freedesktop.Platform.Locale 24.08 u flathub 282,1 Ko / 380,3 Mo |
| 92 |
4. [✓] org.freedesktop.Platform 24.08 u flathub 25,4 Mo / 264,4 Mo |
| 93 |
5. [✓] org.mozilla.firefox.Locale nightly i firefox-try 1,0 Ko / 1,6 Mo |
| 94 |
6. [✓] org.mozilla.firefox nightly i firefox-try 1,0 Ko / 111,5 Mo |
| 95 |
|
| 96 |
Changes complete. |
| 97 |
|
| 98 |
And after that you can just run ``flatpak run org.mozilla.firefox//nightly``. |