Skip to content

Add a package to arch4edu

Jingbei Li edited this page Sep 2, 2022 · 22 revisions

Now arch4edu employs cactus as the package build system.

How to added a package

Please make sure that this package:

  • is used mostly by colleague students
  • has an EULA that permits third-party to distribute it
  • [Recommended] has been submitted to AUR

If the package meets the above requirement, then:

  1. Create a folder in the arch4edu repository. In most cases, it should be named with the pkgbase of this package. You may want to place the folder in directories like x86_64 or any.
  2. Write a cactus.yaml in this folder.
  3. Commit these changes with message added $pkgbase, e.g. added x86_64/yay.
  4. Push the commit to arch4edu or create a pull request. When creating a pull request, please also provide a build log with the build tools in devtools.

How to write a cactus.yaml for a package

There are some templates of cactus.yaml are available under template.

template/cactus-full.yaml is the full documention and example of cactus.yaml. But in most situation, you can start with a simplified template/x86_64-simple.yaml for building most x86_64 packages in AUR packages. You can just create cactus.yaml as a symbolic link to this file.

nvchecker:
  - source: aur
    aur:
build_prefix: extra-x86_64
pre_build: aur-pre-build
post_build: aur-post-build

Configurations

  • nvchecker is a list of upstream configurations for nvchecker. If any upstream contains update, cactus will start to build this package.

    • See also the documentation for nvchecker and the existing cactus.yaml in arch4edu.
    • You can also use some aliases for some most used configurations such as alias: python which is a short alias of {'archpkg': 'python', 'from_pattern': "'^(\d+\.\d+)\..*'", 'to_pattern': '\1'} and will be triggered when there is a major update of python.
  • build_prefix should be one of the prefixes of the build scripts in devtools, including:

    • extra-x86_64: to build a package with x86_64 or any architecture.
    • extra-aarch64: to build a package with aarch64 architecture.
    • multilib: to build a package with x86_64 architecture and depending on packages in [multilib].
  • pre_build is a list of shell command. It will be executed before the package is built. You can also use some common scripts in cactus such as aur-pre-build to obtain the PKGBUILD from AUR.

  • post_build is also a list of shell command. It will be executed after the package is built successfully. You can also use some common scripts in cactus such as aur-post-build to add and commit the changes.

Additional configurations

  • depends is a list of dependency configurations needed to run the package. Only the dependencies in arch4edu need to be configured here and they can be recursively resolved. Each configuration should be one of:

    • pkgbase: full path to the package folder, e.g. x86_64/yay
    • pkgbase: pkgname: full path to the package folder and a specific package in it.
  • makedepends is a list of dependency configurations only needed to build the package. Only the dependencies in arch4edu need to be configured here. Each configuration should be one of:

    • pkgbase: full path to the package folder, e.g. x86_64/yay
    • pkgbase: pkgname: full path to the package folder and a specific package in it.

Check the build status

You can check the build status and build logs at https://arch4edu.github.io/ .