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:
-
It looks for the latest release on GitHub.
-
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.
-
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>.
- If a file is ELF, or its x modbit is set, it goes to
-
It creates a PKGBUILD file, and runs
makepkg -sito build and install it. The package name is<github-project-name>-github. E.g.,ortesi/devdbecomesdevd-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.
Metadata
Release files for arch-github-package 0.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| arch_github_package-0.0.8.tar.gz | 5.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| arch_github_package-0.0.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.5 kB
Release files / arch_github_package-0.0.8.tar.gz
| Download URL | arch_github_package-0.0.8.tar.gz |
|---|---|
| Size | 5.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4db19708db6254729059de967b4e9d25de58eaba260c00467052e1e57a4d68c0
|
|
BLAKE2b-256 checksum How to use checksums |
461acc233b19ebfdeb5f1fa16a5584156b71f8f905f1a4aa73b8ce6f780aac3e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.8 {"installer":{"name":"uv","version":"0.12.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / arch_github_package-0.0.8-py3-none-any.whl
| Download URL | arch_github_package-0.0.8-py3-none-any.whl |
|---|---|
| Size | 7.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9871a5787bfc1136c1f9afaf7274a8e749ba81fa6fd2c78cfc7c805589a614f5
|
|
BLAKE2b-256 checksum How to use checksums |
7aabb81719a8af76e02a621dc820a12e1c904273d9de3cd988a95325780a73fb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.8 {"installer":{"name":"uv","version":"0.12.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|