Para Flatpak

Similar to Snap, there is a Flatpak version of Jami that is distributed on Flathub.

What is Flatpak, and how does it work?

It is recommended that the Introduction to Flatpak and Basic Concepts be read to get a basic understanding of Flatpaks.

Importante

Before proceeding, install the flatpak package.

Código fuente

The source code for the Flatpak version is the exact same as that of the desktop client. However, the manifest, dependencies, and Flatpak-specific patches are hosted on the official GitHub repository (as required by Flathub), which can be found here.

Prerequisites

Install flatpak-builder:

flatpak install flathub org.flatpak.Builder

Luego, agregar el repositorio de Flathub para el usuario:

flatpak remote-add --if-not-exists --user flathub https://dl.flathub.org/repo/flathub.flatpakrepo

Construyendo el Flatpak localmente

Clonar el repositorio de GitHub

git clone git@github.com:flathub/net.jami.Jami.git

Construir Jami

flatpak-builder --force-clean --user --install-deps-from=flathub --repo=DIR builddir net.jami.Jami.yml

DIR—the repository name. By default the repository name should be repo. If the repository name is anything else, the repository name must be used when installing Jami, debugging the Flatpak, and submitting updates to Flathub.

Instalar Jami

flatpak install DIR -y net.jami.Jami

Ejecutar Jami

flatpak run net.jami.Jami

Nota

If there are multiple Flatpak installations of Jami, the --branch=BRANCH switch should be specified after the run command to run the Flatpak that was just built.

The Flatpak installations and their corresponding branches can be checked using the flatpak list command. To run the Flatpak that was just built and installed, set BRANCH to the branch that corresponds to Origin being repo.

Depurado

Debugging Flatpaks within the sandbox on a local machine is possible.

Advertencia

Due to the way Jami is built for Flatpak, debugging can be time-consuming since jami-core is built as a shared library. This means that each time the debugger is restarted, it is required to wait for the symbols to load. Unless it is certain that the issue being debugged is specific to the Flatpak version of Jami, it is usually faster to build and debug the desktop client locally. For instructions, see here.

Descargando la versión de depuración

Las instrucciones para construir el Jami Flatpak como se describe en la sección anterior deben estar completas antes de continuar. Una vez hecho esto, instale la versión de depuración:

flatpak install --include-sdk --include-debug repo -y net.jami.Jami

Inicio del entorno de depuración

El siguiente comando ejecutará un shell dentro del sandbox:

flatpak run --command=sh --devel --filesystem=$(pwd) net.jami.Jami

Una vez ejecutado, el shell debería tener un aspecto similar al siguiente:

[📦 net.jami.Jami net.jami.Jami]$

Ahora hay dos métodos para depurar. Independientemente de cuál se elija, los comandos descritos en cualquiera de las secciones deben ejecutarse within the sandbox shell.

Depurar con el Depurador del Proyecto GNU (GDB)

gdb --args /app/bin/jami --debug

La depuración ahora se puede hacer como de costumbre.

Depurar con Visual Studio Code (VS Code)

  1. Start gdbserver.

    gdbserver :1234 /app/bin/jami --debug
    

    Nota

    El número de puerto se puede cambiar si es necesario. Asegúrese de que el número de puerto para miDebuggerServerAddress in .vscode/launch.json refleje el nuevo número de puerto.

  2. Launch VS Code at the root of the project.

  3. Enter the Run and Debug section (Ctrl+Shift+D).

  4. Select Attach to Remote GDB.

  5. Run Jami (F5).

Establecer puntos de interrupción

Source files are located in builddir/files/lib/debug/source at the root of the project and are where breakpoints should be set.

Enviando actualizaciones a Flathub

If not done already, install flatpak-builder and add the Flathub repo user-wide as described in the Prerequisites section.

Construye la lista

flatpak run --command=flathub-build org.flatpak.Builder --install net.jami.Jami.yml

Ejecutar y probar Jami

flatpak run net.jami.Jami

Ejecutar el linter

The following commands must be run when changes are made to the YAML files. If there are errors, they must be resolved before opening a pull request. Otherwise, the Flathub test builds will fail as well.

flatpak run --command=flatpak-builder-lint org.flatpak.Builder manifest net.jami.Jami.yml
flatpak run --command=flatpak-builder-lint org.flatpak.Builder repo repo

La lista de errores de linter se puede encontrar aquí.

Impulsar cambios y abrir una solicitud de extracción

If the build was successful and passed the linter checks, changes can be pushed to the GitHub repo and a pull request can be opened. Once the pull request is opened, the Flathub automatic build system will create test builds for the x86_64 and aarch64 architectures. If the test builds are successful, the pull request will be able to be merged into master, triggering the official builds.

Nota

Any changes to finish-args in net.jami.Jami.yml as well as changes to net.jami.Jami.metainfo.xml will require approval by the Flathub maintainers. Depending on the changes, the build may be rejected or require an explanation or justification. For the latter, an issue will be opened on the GitHub repository to explain or justify the changes.

Para ver el estado de la aprobación, iniciar sesión en Flathub y navegar hasta Portal del desarrollador → Jami.