VirtCode / serene-aur

replace your aur helper with a self-hosted build server
MIT License
5 stars 1 forks source link

all in one install command #6

Closed dumbasPL closed 1 month ago

dumbasPL commented 1 month ago

the description of the project says

replace your aur helper with a self-hosted build server

so how about an install command to automate things a bit?
Let's say I want to install package foo. I would type something along the lines of serene install foo or serene i foo or serene -S foo, it would add the package, request a build, start displaying the live logs thanks to #5, if the build succeeds it would automatically invoke pacman to install the package from the serene repo.

I'm not sure how hackable paru is, and how open they would be towards an official integration, but if this could be integrated into paru it would be the ultimate way to build aur packages. And we would get things like a nice search, displaying the PKGBUILD, and a bunch of other nice to-haves for free.

VirtCode commented 1 month ago

Yes, I think a dedicated install command to automate adding, building and installing would be a good idea, as I also see myself doing that same pattern over and over again. I'll try to have a look at it this weekend.

However, we need to think about how far we want to go with the "aur helper replacement thing". While I think that e.g. an install command would be a fitting addition, I think adding the whole functionality of an aur helper (i.e. searching, wrapping pacman, etc.) is out of scope for the cli. I always pictured it as a separate utility to pacman, to just add required packages once and forget about it, not as a fully fledged aur helper. But let me know what you think about this.

I think an integration with something like paru would be very cool and ideal in this case, as it already does most of the aur helper things well. But I also don't think that they will agree to an official integration (at least yet), as this project is still somewhat unfinished and small. Might be something we can keep in mind for later on.

dumbasPL commented 1 month ago

to just add required packages once and forget about it

Well, that's exactly how most people use an aur helper since most helpers also automate the update process. I don't think reinventing the wheel (aka yet another helper) is the way to go either, but IMO it should be fairly trivial to integrate into an existing helper and just replace local builds with remote ones while leaving the rest intact. Essentially something along the lines of replacing makepkg -si with serene install in an existing helper.

The update process already works flawlessly since it's just a normal repo, and an install command would solve the problem of adding new packages quickly.

VirtCode commented 1 month ago

I had a bit of time today and implemented this functionality into the cli.

I have however decided to make it a flag (--install) for the add and build subcommand. Reason being that adding a new subcommand would introduce a lot of redundancy to the add command (i.e. supporting different package types like custom repo, pkgbuild etc.), so I think a flag was ideal in this case.

This means you should now be able to use

serene add -i my-aur-package

to add the package, wait for the build to finish, and then install it via sudo pacman -Sy. You can ofc also combine this with the other flags as usual (see the --help on the add subcommand).

I hope this suits your workflow, and if you have any other ideas don't hesitate to let me know. Also, you'll have to pull the server (once it is built) as I had to make one small change over there.