Welcome to Librem 5 Development Policy’s documentation!¶
1. Introduction¶
This document desribes the policy requirements for the Librem 5. It’s purpose is to reflect current practice for developing on the Librem 5. It’s uses the wording from rfc2119.
2. Software¶
General policy for software we build and distribute:
- All source code should be maintained in a public git repository in the Librem5 space on https://source.puri.sm.
- All developed software must conform to a OSI compatible license.
- For software where we’re upstream the GPLv3 should beused for programs while the LGPLv3 should be used for libraries.
- If we’re not upstream, upstream’s license should be used.
- We must not require a Contributor License Agreement (CLA).
- The projects should use a Developer Certificate of Origin (DCO).
3. Git(lab) Repository¶
Policy regarding git repository layout and configuration. This applies to repositories in the Librem5 space on https://source.puri.sm:
- The default branch of the repository must be the branch where people should contribute to if they want to advance development. It must not be an outdated, unused branch or the master branch of the upstream repository if we maintain a downstream fork.
- Canonical branch naming should be used. If we’re upstream the main development branch should be called master, if we’re maintaing a phone specific fork of a software, the branch should be called librem5. These branches must be protected branches that don’t allow force pushes.
- The description in Gitlab must describe the repositories purpose. If it’s a mirror from somewhere else this must be mentioned. If it’s no longer maintained too.
- The repository should have a README.md that tells people where to report bugs (which is the minimal entry point to interact with the maintainers). Other channels like irc, matrix, mailing lists should also be mentioned there.
- Each repository should have a doap file that documents the current maintainers.
- Contributions should happen via merge requests in Gitlab to allow for code review and automated testing. Direct pushes should be avoided.
- Merge request should happen from a personal fork of the repository not from branches within the repository.
- The repository should have a .gitignore file that sets up git to ignore generated artifacts. The aim is that after a build the repositories status is still clean.
4. Gitlab CI¶
- Each repository should have a Gitlab CI configuration. For software where we’re upstream it should be stored in ./.gitlab-ci.yml in the git repository. This configuration must at least build the artifacts (binaries, documentation) and should run the unit tests that don’t require any special setup.
- The CI pipeline of each repository should be green since everything else drives possible contributors away and makes it harder for contributors to evaluate the impact their changes. Temporary breackage will happen but it should not be the norm.
- The CI pipeline should produce artifacts for easy consumption. A Debian package is a must for system components. Applications should produce a flatpak.
- The CI should run against multiple platforms. E.g. prepare for the future by building/testing against Debian testing as well.
5. Development¶
- Allow for short build, test cycles. Software that needs lots of manual commands to run is annoying for contributors.
- Being able to run directly from the source tree should be possible so contributors don’t need to clutter their systems for smoke testing. If things need special setup provide a run script that performs that. This does imply that every aspect of the software is testable that way.
- Since the project is GNOME based GTK should be used as GUI toolkit.
- Developed libraries should be GObject introspectable to ease use from other programming languages.
- Applications should follow the GNOME Hig.
6. Debian Packaging¶
This chapter documents Debian packaging policy. It only applies to packages building at least one Debian package.
- Debian policy should be followed, preferably version 4.4.0 or later.
- debian/README.source should contain instructions if there are special steps required to import new upstream sources or to build the package
- If you’re modifiying / backporting non-native Debian packages you should use pristine-tar and a pristine-tar branch. This will make sure the build systems are able to reproduce a bit identical upstream tarball from the git repository.