cargo-aur icon indicating copy to clipboard operation
cargo-aur copied to clipboard

Support 'from source' packaging, and using crates.io as a source

Open nick42d opened this issue 1 year ago • 5 comments

Added new flags --no-bin and --source.

Existing behaviour is --source project.

New options

--source crates-io --no-bin

Download crate from crates.io, get it's checksum, and write a PKGBUILD that downloads and builds from crates.io. No tarball is produced.

Example PKGBUILD

https://gist.github.com/nick42d/6ce7809a0b24444aaccf9655811cb750

--source crates-io

Download crate from crates.io, and create a binary release tarball in target/cargo-aur. Write a PKGBUILD that assumes user will upload binary release tarball to github/gitlab

Example PKGBUILD

https://gist.github.com/nick42d/dfe9e652473370671fecae9bce2d84fd

--source project --no-bin

Package the source code of the project to a source tarball in target/cargo-aur. Write a PKGBUILD that assumes user will upload source tarball to github/gitlab

Example PKGBUILD

https://gist.github.com/nick42d/e441adb325c01cbbee68c835bfe58e3b

This change should be non-breaking as --source defaults to project so I put this as a minor version bump. However, you could consider a major version bump due to the new functionality.

Testing note: the version number in Cargo.toml is used to download the .crate. If you try and run --source crates.io with version = "1.7.2" this will fail since 1.7.2 isn't uploaded to crates.io yet. Change version to 1.7.1 to test the new flags.

nick42d avatar Aug 17 '24 11:08 nick42d

Added fix for failing test

nick42d avatar Aug 18 '24 09:08 nick42d

Thank you, I'll be reviewing this tomorrow.

fosskers avatar Aug 18 '24 10:08 fosskers

Great job so far. A few more things and we can merge this in. We'll need to come to a decision about the approach to the flag names.

fosskers avatar Aug 24 '24 05:08 fosskers

Thanks for your patience on this. I'm going to put this in soon.

fosskers avatar Sep 01 '24 20:09 fosskers

Hi there, please forgive the delay, I'm currently out of town for a wedding.

fosskers avatar Oct 07 '24 03:10 fosskers