10 package builder
Thomas Renard edited this page 2021-11-16 22:48:51 +00:00

Bluepill package builder

Because the complete rpm is quite difficult to build, I soon tried to work with Coderus' package sdk and some CIs, like Gitlab's CI and Drone. These CIs build in free usable docker containers. The container is started and then a script is run into it. The Bluepill package builder is a set of CI declaration files and shell scripts. But you are also able to build it local.

All these systems create a local copy of the source and then build in this local copy. After building the binaries are put into artifacts (CI: when tagged) or copied into a special directory for local use.

gitlab

To build your package with gitlab the file .gitlab-ci.yml is used. This builds both, i486 and arm binaries. It creates artifacts if the last commit was tagged.

drone

To build your package with a drone instance the file .drone.yml is used. This also creates both, i486 and arm binaries. And there are also artifacts build when tagged, if you use drone in combination with a gitea instance

local

You can build a binary on you development system locally. Therefor a Docker/Podman container is created and put in background. This makes it possible to first install the necessary development environment and then install the used library binaries and python modules. Then you are able to startup the building process via docker exec or podman exec instructions. This method is a bit faster if you need to make changes and test again because you only need to build the binary at a time not also the development environment (which is built at start)

requirements

  • Docker or Podman

all following docker commands can be exchanged by podman

preparation

Execute from root of the repository (armv7hl will be used as default)

mkdir tmp
chmod 777 tmp # this is needed for the sdk to copy rpms out of the container
sudo docker run -d --name sdk -v $(pwd):/source -ti coderus/sailfishos-platform-sdk:4.0.1.45 bash
sudo docker exec -t sdk "/source/tools/local-create.sh [armv7hl|i486]"

This will create the running container and compiles all needed libraries and python modules

usage

Just call

sudo docker exec -ti sdk "/source/tools/local-build.sh [armv7hl|i486]"

This will build the rpm and put it to your tmp directory.

start/stop

It is useful to stop the container when rebooting the system

sudo docker stop sdk

When starting up the system the environment will work again when

sudo docker start sdk

remove

You can remove the container with:

sudo docker rm -f sdk