Aurum: Aur helper with No pacman wrapping

Now I know what you’re all thinking: “Another one!?” Well, yeah, pretty much. I’ve gotten sorta fed up with the situation of AUR helpers, especially ones that wrap pacman as well as handling the AUR (we can have that argument elsewhere…).

Anyway, I wrote one in Rust, with a couple of goals:

  • No pacman wrapping
  • Ease of use/efficiency
  • Full-featured

You can read more in the Readme with the repo, which can be found here: https://gitlab.com/MggMuggins/aurum.

Disclaimer

Before I go over the installation directions, I want to make it abundantly clear that aurum is ALPHA Quality Software™, and is not ready to compete with Pamac (cli), Yay, or <insert-favorite-aur-helper-here>. That said, I’m making this post because I would like people to try it, because I’d really love feedback from the community. If you’re interested, please download and review, I’d love to hear from you here or on Gitlab. I’m sure there are bugs (not all packages work with the dependency resolver right now, etc). It’s also missing a lot of features, such as asking to view PKGBUILDS (high priority), and other things like that. If you have a question, criticism, bug report, or feature request, I’d love to hear them!

I doubt that it will cause breakage to your system, but if you try it, it’s at your own risk. Note the last clause in the license.

Installation

I’ve included a (rudimentary) PKGBUILD with the repo, which seems to work on my system (aurum-git). You can also download the latest CI artifacts from gitlab, navigate over to CI/CD -> Pipelines and select the build artifacts for the latest passing build (I won’t support anything else RN). There should be no difference between nightly and stable (compiler, not aurum).

Screenshot

Here’s a screenshot of a minimal aurum process, running aurum -I aurs

7 Likes

PKGBUILD tips:
sudo, pacman & xz don't need to be in depends as they're in the core repo base-devel group and are should be already installed.
Per the VCS package guidelines, calculate your pkgver like this:

pkgver() {
	cd "$pkgname"
# Git, no tags available
	printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

I just installed it and tried aurum -u, but I must be missing something as it didn't do what I expected according to the help documentation.

You mentioned a GUI, but I couldn't find it.

I edited my post, hopefully that makes it more clear that there isn’t a gui.

clap-rs isn’t the most expressive for doing custom help pages, I think I should probably work on that. In any case (just like with pacman), -u needs to be passed with an operation (either -G, -B, or -I), that way aurum knows what operation to do on all your installed AUR packages. I hope you were able to find the wiki, which has a little more complete info on the CLI.

Thanks for the packaging tip, that’ll be in my next commit.

Alright, the command line help is now the same as this wiki page: https://gitlab.com/MggMuggins/aurum/wikis/cli-docs

I still need to do a little formatting on the wiki page, but hopefully that will be helpful for keeping docs up to date.

Ping me if you make a change to that page so I can trigger a CI rebuild.

If anyone is interested, I finally got back into this project and it is both updated and released on crates.io and in the AUR. New functionality includes a functional update. It's not super sophisticated beyond resolving dependencies and installing packages that are pulled as dependencies with --asdeps, but I like it. If anybody has any feedback at all for me I'd really appreciate it!

1 Like

Some PKGBUILD critique with example PKGBUILDs below:

Again, sudo, pacman and xz are all part of the base-devel group and do not need to be included in the depends array. Namcap detects openssl as a dependency.

Specifying cargo as a make dependency is usually fine as it allows the user to choose between different Rust or Rustup packages. However, it's best to use Rust for packages since everything is included. Rustup is modular by design more for development purposes. I've had issues building packages with Rustup so I just stick with Rust.

There is no need to use conflicts for the aurum package. However, the aurum-git package should provide and conflict with aurum.

Your git tag is v0.1, but your project version is v0.1.0. Those should match.
EDIT: I just installed it via the aurum PKGBUILD below and aurum -V reports aurum 0.1.

Your source array needs to include the tag for aurum since it's supposed to be a static package. Currently is pulling the latest commit without generating a proper pkgver.

You don't need to use cargo install as there's only a binary to install. See Rust package guidelines.

aurum PKGBUILD
# Maintainer: Wesley Hershberger <mggmugginsmc at gmail>
pkgname=aurum
pkgver=0.1
pkgrel=1
pkgdesc="An AUR helper written in Rust"
arch=('x86_64')
url="https://gitlab.com/MggMuggins/aurum"
license=('MIT')
depends=('openssl')
makedepends=('git' 'rust')
source=("git+https://gitlab.com/MggMuggins/aurum.git#tag=v$pkgver")
sha256sums=('SKIP')

build() {
	cd "$pkgname"
	cargo build --release --locked
}

package() {
	cd "$pkgname"
	install -Dm755 "target/release/$pkgname" "$pkgdir/usr/bin/$pkgname"
	install -Dm644 LICENSE.md "$pkgdir/usr/share/licenses/$pkgname/LICENSE.md"
}
aurum-git PKGBUILD
# Maintainer: Your Name <youremail@domain.com>
pkgname=aurum-git
pkgver=0.1.r1.cc503a2
pkgrel=1
pkgdesc="An AUR helper written in Rust"
arch=('x86_64')
url="https://gitlab.com/MggMuggins/aurum"
license=('MIT')
depends=('openssl')
makedepends=('git' 'rust')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
source=('git+https://gitlab.com/MggMuggins/aurum.git')
sha256sums=('SKIP')

pkgver() {
	cd "$srcdir/${pkgname%-git}"
	printf "%s" "$(git describe --long | sed 's/v//;s/\([^-]*-\)g/r\1/;s/-/./g')"
}

build() {
	cd "$srcdir/${pkgname%-git}"
	cargo build --release --locked
}

package() {
	cd "$srcdir/${pkgname%-git}"
	install -Dm755 "target/release/${pkgname%-git}" "$pkgdir/usr/bin/${pkgname%-git}"
	install -Dm644 LICENSE.md "$pkgdir/usr/share/licenses/${pkgname%-git}/LICENSE.md"
}

EDIT: pkgver for aurum-git fixed.

EDIT:

$ aurum -Iu
:: loading packages...
:: invalid gzip header

:thinking:

2 Likes

I appreciate the feedback, I am working on implementing those changes (albeit changing the tag name instead of the pkgbuild). The reason that I did not change the depends from your first suggestion is because it doesn't make sense that you can just assume that somebody has everything from core installed. It makes more sense (to me anyway) to depend on base-devel since I'm using a bunch of tools in that dependency tree, as you pointed out. Is putting a package group in a depends array something that can be done?

Edit: For base-devel, listing it as a dep doesn't work. It feels wrong to simply not include it when aurum will definitely fail without that group installed. What is the correct approach here?

For the git package, it doesn't really make sense to me to include a specific commit hash in the PKGBUILD when it generates the version number based on that nasty one-liner, could you elaborate on why that is a bit?

I also upped the pkgrel on both packages.

As for your error, could you run with a couple of -v's and post the output to a gist or pastebin?

In my older post, I said base but meant the base-devel group.

See the Arch Wiki entry for the AUR. sudo, pacman and xz are all in the base-devel group. Notice this is the first step for using the AUR:

Ensure the base-devel package group is installed in full ( pacman -S --needed base-devel ).

The correct apporach is assuming AUR users have the base-devel group installed as seen above.

Take another look at both PKGBUILDs again. Since you don't have any releases yet, aurum is the static stable version that should pull from the latest tag. Whereas aurum-git is the development / bleeding edge build that pulls from the latest commit. See VCS package guidelines.

You don't need to do that unless a rebuild is needed of the same pkgver. Minor edits of the PKGBUILD can be pushed without bumping it. See the pkgrel section of the wiki.

False alarm, apparently. I just tried the same command again and it's working as expected.

You say aurum isn't a pacman wrapper, yet you want to add pacman as a dependency. Explain?

For the base-devel issue, I have already done the trawling through dependency trees and have indeed found that all those packages are part of the group. That's not the issue. The issue is that even though I have run the install command for the group, makepkg still complains when I include it as a dependency (claims it's not installed). There's no easy way to check to make sure that all the requirements of a package group are installed or not (which makes sense), so I guess I will have to be satisfied with just leaving it out.

I understand the purpose of a VCS package. My point is that it doesn't make sense to hard-code a commit hash into the version string of a PKGBUILD when I'm committing that PKGBUILD into the $source repo (see how that's always behind?). I found --holdver in the VCS package guidelines, but that still seems to edit the version number in the PKGBUILD. :thinking:

From the VCS package guidelines:

If the resulting package is different after changing the dependencies, URL, sources, etc. increasing the pkgrel is mandatory.

Dependencies are changing here, so I think this holds, since a package with different dependencies is different...

As for pacman wrapping, I would say there's a difference between trying to encompass the entirety of pacman's functionality and using pacman as a tool to accomplish my broader functionality. Pacman is only used to install repo dependencies and built packages. I parse the package db's and AUR rpc requests in my crate deps for dependency resolution, so pacman isn't even used for that.

I'm also having an issue related to git tagging, once I get done fixing that and verifying that both PKGBUILDs work, I'll commit and update the aur.

You can't add a group to dependencies. Again, you assume AUR users already have the base-devel group installed. If a program does not require any packages outside of that group, the depends array can be omitted completely.

My tagging issue turned out to be due to caching, a clean build fixed it. Thanks for your help, I really appreciate it. The new versions are pushed up.

Sorry for being what I see in hindsight as a little combative. Would you like to be added as a contributor for those PKGBUILDs?

1 Like

No worries. Yes, you can add me as a Contributor if you'd like.

You'll go in next time I commit, thanks for the help!

Forum kindly sponsored by