mirror of
https://github.com/fosskers/cargo-aur.git
synced 2026-03-10 15:52:14 -05:00
Feature request: Support non-binary AUR package using crates.io as source #12
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @nick42d on GitHub (Aug 3, 2024).
G'day,
Thanks for the crate!
I was wondering if you'd be open to the option of supporting crates.io as a source (e.g https://wiki.archlinux.org/title/Rust_package_guidelines#Source). In this case, I wouldn't need a binary build, I'd just be using cargo-aur to generate the PKGBUILD.
Let me know your thoughts on this, I'd be happy to have a go at contributing.
@fosskers commented on GitHub (Aug 3, 2024):
This is a good idea. Let's move forward with it.
The current default is to produce a
-binpackage after compiling everything, so we'd either have to:-binbehaviour behind a flag (a breaking change).cargo aur bin,cargo aur ?) (also a breaking change)@nick42d commented on GitHub (Aug 3, 2024):
I see what you mean about the commands. I see no need to change the existing defaults from what you've set, am happy for this to be a new flag. In terms of an overhall, this could also be a good opportunity to upgrade to
clapfromgumdrop. Guessing this is possible without a breaking change to the flags.@fosskers commented on GitHub (Aug 4, 2024):
Now then: what should the new flag be callled? Off the top of my head:
--plain--source--from-crate--no-bin@nick42d commented on GitHub (Aug 5, 2024):
Took some time to think about this. Combining the two suggestions of --source and --no-bin, we could do;
New flag
--source [SourceType]where[SourceType]isprojectorcrates-io. (Default: project = current behaviour)New flag
--no-bin. (Default: false = current behaviour)This would allow two new combination
--source crates-iowhich would pull the crates.io version and build it into a binary,--source project --no-binwhich would publish based off a github/gitlab tarball. This would also allow for different--sourceoptions in future e.gurlif we are hosting somewhere other than github/gitlab.I also wanted to note that to calculate the checksums for the crates.io build, we'll need to actually download the crate. Do you have a preference on how this is implemented, we could use curl, makepkg itself but it's a bit awkward since it needs a pkgbuild first, or a rust library like libcurl or reqwest.
@fosskers commented on GitHub (Aug 6, 2024):
These are good suggestions. Let's move forward with both of them.
Let's be a good Unix tool and just call
curl(orwget) via Rust'sCommandtype. That will minimize Rust dependencies withincargo-auritself.