Skip to content

Create or update packages

Babilinx edited this page Jul 11, 2023 · 2 revisions

How to create or update packages

Basic to intermediate git and bash knowledge, intermediate to expert linux knowledge is required.

To see first

Tips:

A stock-linux folder can contain all of the things reladed to stock-linux.

Recipe explanation

Structure and variables

A recipe is ordered like so:

name=
version=
release=
description=
source=
packager=
makedepends=
# Some functions, for later

What is what ?

  • name: Name of the package
  • version: Version of the package
  • release: Revision of the package at the version $version
  • description: Description of the package
  • source: Source URL
  • packager: Packager of the package; your name/pseudo
  • makedepends: Packages needed to build the package

Build-in and to-build functions

You have the following functions that can be created:

  • unpack: Called when hazel unpack the source. To use if the source got some issues when unpacking it.
  • pre_build: Called before build.
  • build (needed): Called at build time. To build the package.
    • build_python: Callable from the receipe in build function. To build python modules that respect the standards. Already created, just specify it
    • build_meson: Callable from the receipe in build function. To build meson packages that respect standards. Already created, just specify it
  • post_build: Called after the end of the build. To configure some files if needed for instance.

Fork the packages repo

There are two ways: GUI and CLI.

GUI

Just fork the packages using Github and clone it on your system:

git clone https://github.com/<username>/<repo_name>

Be careful to always sync your fork

To do that, go on your github fork and click on "sync". Then git pull on your local repo.

CLI

First you need to have the packages on your PC.

git clone https://github.com/stock-linux/packages

Then create a repo on github, and add it as a remote in your local repo.

git remote add fork https://github.com/<username>/<repo_name>`

Now, every time you push, you should do: git push fork.

Be careful to always sync your fork

To do that,

git fetch origin
git checkout testing
git rebase origin/testing

Create a package

Making the recipe

You need to have the tools and the packages repo on your PC.

And do

cd packages  # if you are not inside the repo yet

git checkout testing
mkdir <type>/<package_name>
hazel new <type>/<package_name> <version> <source> "<description">

If you have an error saying your EDITOR variable is not set, do

global EDITOR=<your_prefered_editor>

And relaunch hazel.

Now you should have <type>/<package_name>/recipe file opened. You can set the release variable to 1 and set the makedepends variable if needed like that: (<dep1> <dep2> ...).

Building the package

To build the package, run

hazel <package>

and wait..

If you have any error, read the output and the logs located in ~/hazel/logs/<package>-<version>.log and if you need help, you can go on our discord server.

Update a package

Update to a new version

Launch hazel <package> <new_version>

Fix a current version

First, take a look at recipe-organizarion. Apply your changes, increment the variable <release> by 1 and build the package.

Testing the packages

TODO

Create the pull request

Every package in the pull request should be working, at least a little.

The title

The title is built like that:

For creation

Add <package>-<version>

For update

Update <package>-<old_version> to <version>

Linked issues

Link any issue in the report when adding your package