From 1ab9c5b7e9ceede0d9f997adab94800e3fba507f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Blin?=
 <sebastien.blin@savoirfairelinux.com>
Date: Mon, 13 May 2024 08:03:55 -0400
Subject: [PATCH] docs: update contributing page

Change-Id: I088e2f87da6483105dbd469b5c28a5e9e1e6aa13
---
 contribute.rst | 80 +++++++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 76 insertions(+), 4 deletions(-)

diff --git a/contribute.rst b/contribute.rst
index a0db7490..a7e800c6 100644
--- a/contribute.rst
+++ b/contribute.rst
@@ -23,12 +23,82 @@ instructions on how to report bugs and issues you encounter in Jami.
 Contributing code
 =================
 
-TODO
+If you want to start to contribute to Jami, you can start by looking good
+first issues at: https://git.jami.net/groups/savoirfairelinux/-/issues/?sort=created_date&state=opened&label_name%5B%5D=good-first-issue
+
+You can contact developers directly by adding a comment on the ticket you
+want to start with. They will be able to guide you through the process.
+
+At some point, you will need to push a patch on https://review.jami.net.
+For more information on how to do this, please refer to the :doc:`developer/working-with-gerrit` guide.
 
 Packaging Jami
 ==============
 
-TODO
+There is two possible ways to package Jami:
++ Via our internal process to create packages available on
+the Snap Store or https://dl.jami.net
++ Via the packaging process of your favorite GNU/Linux distribution
+
+.. note:: Jami is a quite complex project with a lot of dependencies.
+          This isn't a quick and easy task and ask for some maintainance.
+
+If you choose the second option, here are some useful notes:
++ For our official release, we stick to a certain Qt version, because
+Qt is a big dependency and we need to ensure that Jami works with the
+version we use. Every slight change in the Qt version can break Jami
+or bring some small unwanted changes (e.g. 6.2->6.4 broke the video pipeline)
++ We also fork pjproject due to ICE over TCP that is not planned upstream
++ libupnp got some patches to be sure that it's build with the non-blocking API.
++ FFMpeg got some patches for screen sharing.
++ You can check how dependencies are built in `daemon/contrib/src`
+
+For internal packaging, everything is located in `extras/packaging/gnu-linux`.
+You can follow previous patches to understand your needs. e.g.: https://review.jami.net/c/jami-client-qt/+/28036
+
+We use 3 channels:
++ Internal for testing purposes
++ Nightly/Beta/Edge for public beta
++ Stable for public releases
+
+We generally use internal when we test new distribution or when we package a new Qt version
+Then we try to generate a nightly per week and one stable per month (if unit tests are green).
+
+Packages are pushed to:
++ dl.jami.net (2 machines, with a rsync every 15 min)
++ Ubuntu store (snapcraft.io/jami)
+
+If you want to add a new distribution, you will need to:
++ Add Dockerfile
++ Change Makefile
++ Update packaging script
++ Cross fingers
++ Test the package in a VM
+
+.. note:: Chromium is a hard part to build. the 3 commons problems we got are:
+
+         + GCC is too recent:
+            + Generally the fix consist of importing patches from chromium's gerrit to fix GCC issues
+         + Python is too recent:
+            + Generally the fix consist of using PyEnv to get a virtual environment with the correct Python's version
+         + Missing dependencies:
+            + During the configuration step of Qt, the list of built components is listed and the missing dependencies are listed. Generally installing a package or updating node.js fix the issue
+            + Note that if Qt is generated without chromium, we must remove the package in the cache of the build machines to regenerate a new one (/var/cache/jami)
+
+If you want to remove a distribution:
++ If a distribution is EOL OR if there is 2 more recent LTS, we can remove the distribution (e.g. ubuntu 20, 22, 24 - remove ubuntu 20) by removing related files and checks
+
+.. note:: For the next big changes we want to:
+
+           + Use CMake instead autotools for jami-daemon
+           + Use core22 instead core20 in snap
+           + Flatpak/AppImage support? This may simplify custom packaging for RPMs/Debs
+           + Only generate one deb instead one per distribution. Same for RPMs
+           + Use Jenkinsfile to generate package for Linux/Windows/MacOs at the same time if possible
+
+
+For internal information (such as how to publish to stores, cf internal wiki).
+
 
 Contributing to this documentation
 ==================================
@@ -53,7 +123,9 @@ every command.
           compatible with the :doc:`fdl`.  DO NOT SUBMIT COPYRIGHTED
           WORK WITHOUT PERMISSION.
 
-**TODO: internationalization**
+.. note:: If you want to help to translate this page, you can join
+          the project and start translating this page on
+          https://explore.transifex.com/savoirfairelinux/jami/
 
 Dependencies
 ------------
@@ -126,7 +198,7 @@ browser.  The homepage is at ``_build/html/index.html``.
 
 .. note:: This documentation does not currently build with the latest
           version of sphinx. Please see `this issue on GitLab
-          <https://git.jami.net/savoirfairelinux/jami-docs/-/issues/15>`_ 
+          <https://git.jami.net/savoirfairelinux/jami-docs/-/issues/15>`_
           for a workaround and updates regarding this problem.
 
 To automatically build the documentation and refresh your web browser whenever
-- 
GitLab