Skip to main content

Convert GitHub project releases to Archlinux package, with autoupdate.

Project description

arch-github-package

Convert GitHub project releases to Archlinux package, with autoupdate.

Why

A lot of packages in Archlinux's AUR are just a single PKGBUILD file that downloads the latest release from GitHub, and many of them are human-maintained, which means that they are not updated as soon as a new release is published.

This script provides an alternative. If a GitHub project has binary releases, it can automatically download a release tarball, create a PKGBUILD file, makepkg, and install it. It can also rebuild the package if a new release is found.

Installation

pipx install arch-github-package

pipx installs the package in a virtualenv, so it doesn't pollute your system.

You can also use pip:

pip install --user --break-system-packages arch-github-package

(This will install the package in your user site-packages, not really breaking system packages.)

Usage

Install a package

agp install <github-repo>

Example:

agp install cortesi/devd

How does it work:

  1. It looks for the latest release on GitHub.

  2. It tries to find a pre-built package for your system, by looking for keywords like "linux", "x86-64", "x86_64", "amd64", "gnu" in the release assets.

  3. It downloads the tarball, extracts it, and tries to dertermine which file goes where. E.g.:

    • If a file is ELF, or its x modbit is set, it goes to /usr/bin.
    • Files like *.1.gz go to /usr/share/man.
    • README.* go to /usr/share/doc/<package-name>.
    • LICENSE goes to /usr/share/licenses/<package-name>.
  4. It creates a PKGBUILD file, and runs makepkg -si to build and install it. The package name is <github-project-name>-github. E.g., ortesi/devd becomes devd-github.

List installed packages

agp list

Check for upgrades

agp upgrade

You can also use agp upgrade <package-name> to upgrade a single package.

Note: if you run this command repeatively in quick succession, it will hit GitHub's rate limit for anonymous API access.

Uninstall a package

agp uninstall <package-name>

If you uninstall an -github package with pacman, it will still be listed by agp list. So remember to use agp uninstall to remove it.

Internals

Package metadata

Metadata is stored under ~/.local/share/arch-github-package.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

arch_github_package-0.0.5.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

arch_github_package-0.0.5-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file arch_github_package-0.0.5.tar.gz.

File metadata

  • Download URL: arch_github_package-0.0.5.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.24.1

File hashes

Hashes for arch_github_package-0.0.5.tar.gz
Algorithm Hash digest
SHA256 0bd3e7239f8af2eb592e7d3cc926fc576688ca1b765060a1c9d7a2fb5d0671be
MD5 d9ec753b287f1387f49607a7bc0f23e1
BLAKE2b-256 85d2fc31a9e25837859959b57872bf8801d0ee6319a99774438e640b6aaceb92

See more details on using hashes here.

File details

Details for the file arch_github_package-0.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for arch_github_package-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 ac5d02601515dd2c13967e8f1929915a967ae8fb627646f327f512aba275ff8d
MD5 dc4fbf949ae41cbe536913fedd6b6f63
BLAKE2b-256 d345288c84aad6ec61acb425d47b2574ae9080e7d0b8e5418d5f8c33e33cc9e0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page