Skip to content

Pattern Binary

m-wells edited this page Feb 21, 2026 · 2 revisions

Binary Packages

Example: virtctl

Pre-compiled binaries from GitHub releases or other sources.

Template

arch=('x86_64')
depends=('glibc')

source=("${pkgname}-${pkgver}::https://github.com/org/repo/releases/download/v${pkgver}/${pkgname}-linux-amd64")

package() {
    install -Dm755 "${pkgname}-${pkgver}" "$pkgdir/usr/bin/$pkgname"
}

Characteristics

  • arch=('x86_64') - binaries are architecture-specific
  • Minimal deps (usually just glibc)
  • No build step, just installation
  • Consider adding shell completions if provided upstream

Shell Completions

If the binary supports generating completions:

package() {
    install -Dm755 "${pkgname}-${pkgver}" "$pkgdir/usr/bin/$pkgname"

    # Generate completions
    "$pkgdir/usr/bin/$pkgname" completion bash > bash.completion
    "$pkgdir/usr/bin/$pkgname" completion zsh > zsh.completion
    "$pkgdir/usr/bin/$pkgname" completion fish > fish.completion

    install -Dm644 bash.completion "$pkgdir/usr/share/bash-completion/completions/$pkgname"
    install -Dm644 zsh.completion "$pkgdir/usr/share/zsh/site-functions/_$pkgname"
    install -Dm644 fish.completion "$pkgdir/usr/share/fish/vendor_completions.d/$pkgname.fish"
}

Version Checking

# scripts/packages/example.sh
check_github_release "example" "org/repo"

Clone this wiki locally