AUR Sources
Publish source-based AUR packages that build from source via cargo
Anodizer can generate and publish source-based AUR packages that build your project from source using cargo build. This is separate from the AUR binary packages which distribute pre-built binaries.
Note: a source package builds from the source archive the release uploads, so it needs the
source:stage turned on:source: enabled: trueWithout it the entry is skipped with
no source archive found: enable `source.enabled: true`. The PKGBUILD downloads that archive and checks its SHA-256. With the default layout the archive's files sit at its root and the build runs in$srcdir; whensource.prefix_templatenames a directory ("{{ ProjectName }}-{{ Version }}/"), the defaultbuild()andpackage()bodiescdinto it first, and a custom body has to do the same.
Classification
| Group | Required (default) | Rollback | Token scope |
|---|---|---|---|
| Submitter | false | none | AUR_SSH_KEY write |
See Release resilience for the full classification table and the Submitter gate semantics.
The required: field
Default: false — an AUR Sources submission failure is logged but does not fail the release.
Set required: true to make the release exit non-zero if this publisher fails:
aur_sources:
- git_url: "ssh://aur@aur.archlinux.org/myapp.git"
required: true
Warning: AUR Sources is a submitter publisher — it force-pushes to the upstream Arch User Repository via SSH. The AUR does not perform moderation, but the package is not "approved" by any external gate; the push itself is the final act. Despite this, the publisher is classified as Submitter because it modifies a shared namespace on an external service with no programmatic rollback path.
required: truefails the release when the SSH push fails. The AUR has no later review, so the push is the whole outcome.With
-v, anodizer prints this line when it loads a config that setsrequired: trueon this publisher:<location>: publisher 'aur_source' submits to an external moderation queue; `required: true` fails the release when the submission itself fails, but the eventual moderation outcome happens outside the release run and cannot be gated.See Publish overview — the
required:field for the full submitter-publisher semantics.
Minimal config
aur_sources:
- git_url: "ssh://aur@aur.archlinux.org/myapp.git"Full config reference
aur_sources:
- name: myapp # optional; package name (default: crate name)
ids: [] # optional; no effect on a source package
description: "A fast CLI tool" # optional
homepage: "https://example.com" # optional
license: MIT # optional; default from Cargo.toml
maintainers: [] # optional
contributors: [] # optional
provides: [] # optional; defaults to ["{name}"]
conflicts: [] # optional; defaults to ["{name}"]
depends: [] # optional; runtime deps
optdepends: [] # optional
makedepends: ["rust", "cargo"] # optional; build deps
backup: [] # optional; files to back up on upgrade
rel: "1" # optional; package release number
prepare: "" # optional; custom prepare() body
build: "" # optional; defaults to "cargo build --release --locked"
package: "" # optional; custom package() body
install: "" # optional; .install file content
url_template: "" # optional; source archive URL (template; default: the uploaded source archive)
git_url: "ssh://aur@aur.archlinux.org/myapp.git" # optional; AUR repo URL
git_ssh_command: "" # optional; custom GIT_SSH_COMMAND
private_key: "" # optional; SSH key content (template, e.g. "{{ Env.AUR_SSH_KEY }}")
directory: "" # optional; subdirectory in the git repo
skip_upload: false # optional; "auto" skips prereleases
commit_author:
name: "Bot"
email: "bot@example.com"
commit_msg_template: "" # optional
arches: [] # optional; pacman arch=() list (default: from the Linux build targets)
skip: false # optionalAuthentication
| Config field | Env var | Description |
|---|---|---|
private_key | — | SSH private key content (the PEM / OpenSSH text itself), templated, usually "{{ Env.AUR_SSH_KEY }}"; written to a temporary file with mode 0600. git_ssh_command takes precedence when both are set |
git_ssh_command | — | Override the full SSH invocation; takes precedence over private_key |
Common gotchas
- No
git_url: ifgit_urlis omitted, files are written todist/but not pushed. Useful for local inspection before submitting to AUR. - Version string hyphens: AUR
pkgverdoes not allow hyphens. Anodizer replaces hyphens with underscores. - Default architectures:
arch=()lists the pacman architecture of every Linux build target (x86_64when there is none). Setarchesto name the list yourself. idshas no effect: a source package builds from the one source archive the release carries, so a build-ID filter selects nothing. Usearchesto control the architectures.
AUR source config fields
| Field | Type | Default | Description |
|---|---|---|---|
name | string | crate name | Package name (alias: package_name) |
ids | list | none | No effect on a source package |
description | string | crate name | Package description |
homepage | string | "" | Project homepage URL |
license | string | from Cargo.toml | License identifier (SPDX; MIT OR Apache-2.0 renders both) |
maintainers | list | [] | Package maintainers |
contributors | list | [] | Package contributors |
provides | list | [{name}] | Packages this provides |
conflicts | list | [{name}] | Conflicting packages |
depends | list | [] | Runtime dependencies |
optdepends | list | [] | Optional dependencies |
makedepends | list | ["rust", "cargo"] | Build dependencies |
backup | list | [] | Files to back up on upgrade (written to the PKGBUILD and .SRCINFO) |
rel | string | 1 | Package release number |
prepare | string | none | Custom prepare() function body |
build | string | cd into the archive's directory, then cargo build --release --locked | Custom build() function body |
package | string | auto-generated | Custom package() function body |
install | string | none | Content for a .install file (post-install/pre-remove scripts). When set, the PKGBUILD and .SRCINFO name <name>.install and the file is written alongside them. |
url_template | string | the uploaded source archive's URL | Source archive download URL (template); {{ .ArtifactName }} is the archive's file name. In the rendered URL the version is replaced by ${pkgver} where it appears verbatim |
git_url | string | none | AUR git repository URL (for pushing) |
git_ssh_command | string | none | Custom GIT_SSH_COMMAND |
private_key | string | none | SSH private key content (the PEM / OpenSSH text itself), templated, usually "{{ Env.AUR_SSH_KEY }}"; written to a temporary file with mode 0600. git_ssh_command takes precedence when both are set |
directory | string | repo root | Subdirectory in the git repo |
skip_upload | string/bool | none | Skip git push: true or 1 always skips, auto skips for prereleases, false, 0 or empty publishes; a template is rendered and read the same way, in any letter case (see bool-or-template values) |
commit_author | object | none | Git commit author (name, email) |
commit_msg_template | string | none | Custom commit message (template) |
arches | list | from the Linux build targets | Pacman arch=() list |
disable | string/bool | none | Disable this config |
Behavior
- Generates PKGBUILD and .SRCINFO files for source-based installation
- The source is the archive the
source:stage produced and the release uploaded, saved as${pkgname}_${pkgver}.<format>with its SHA-256 insha256sums;url_templatereplaces the URL - The SHA-256 is the one the source stage recorded, or is hashed from the archive when none was recorded.
<format>is the archive's recorded format, else the URL's extension - In a workspace, the source archive belongs to the crate whose release ships it: the first crate with a
release:block, else the primary crate. Its download URL is the one that release stamped on it when it uploaded the archive - An archive the release has not uploaded yet has no download URL. On
--snapshotor--dry-runthe PKGBUILD names it by file name; a live run skips the entry withsource archive '<name>' has no download URL yet; the release stage sets it when the archive is uploaded. Withsource.enabled: truebut no archive registered (--skip=source, or a source stage that failed first), the entry is skipped naming that cause - The top-level directory the default
build()andpackage()enter comes from the archive's recorded prefix, so a--publish-onlyrun knows it too; anartifacts.jsonwritten before the prefix was recorded falls back to renderingsource.prefix_template - Version dashes are replaced with underscores for PKGBUILD compatibility
arch=()is derived from the Linux build targets unlessarchesis set- When
git_urlis set, clones the AUR repo, commits the generated files, and pushes
Full example
aur_sources:
- name: myapp
description: "A fast CLI tool"
homepage: "https://example.com/myapp"
license: Apache-2.0
maintainers:
- "Alice <alice@example.com>"
depends:
- openssl
makedepends:
- rust
- cargo
git_url: "ssh://aur@aur.archlinux.org/myapp.git"
commit_author:
name: "Bot"
email: "bot@example.com"