[PR #30] Support 'from source' packaging, and using crates.io as a source #32

Open
opened 2026-03-01 09:11:41 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/fosskers/cargo-aur/pull/30
Author: @nick42d
Created: 8/17/2024
Status: 🔄 Open

Base: masterHead: iss28-cratesio


📝 Commits (10+)

  • 4f9dd8d Add new commandline flags, add function to download crate
  • e582c04 Added workflow for building a crate, and tests up to tarball
  • f9bb8fb Fix broken tarball function
  • 8a12e50 Implement the 3 new build types
  • a6ad38e Add PKGBUILD for crates-io no-bin
  • 0a8d8f2 Remove warning, bump version
  • 93c60a3 Implement PKGBUILD for no-bin, source type project
  • cd55dca Remove derives that were not required
  • cceeda0 Fix typo
  • 4b595bc Fix for not using target/release directory for from source pkgbuilds

📊 Changes

5 files changed (+461 additions, -34 deletions)

View changed files

📝 Cargo.toml (+2 -1)
src/crates.rs (+268 -0)
📝 src/error.rs (+27 -0)
📝 src/lib.rs (+12 -6)
📝 src/main.rs (+152 -27)

📄 Description

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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/fosskers/cargo-aur/pull/30 **Author:** [@nick42d](https://github.com/nick42d) **Created:** 8/17/2024 **Status:** 🔄 Open **Base:** `master` ← **Head:** `iss28-cratesio` --- ### 📝 Commits (10+) - [`4f9dd8d`](https://github.com/fosskers/cargo-aur/commit/4f9dd8d00753a3daae30d98120561dc55c46f1eb) Add new commandline flags, add function to download crate - [`e582c04`](https://github.com/fosskers/cargo-aur/commit/e582c04a8494e4d37d694103dfaccc342f06759d) Added workflow for building a crate, and tests up to tarball - [`f9bb8fb`](https://github.com/fosskers/cargo-aur/commit/f9bb8fbfb8ddd193634975bf86c50ddceef6917a) Fix broken tarball function - [`8a12e50`](https://github.com/fosskers/cargo-aur/commit/8a12e502016338962122f85bc4ce1a47b9635f57) Implement the 3 new build types - [`a6ad38e`](https://github.com/fosskers/cargo-aur/commit/a6ad38efd16dd7e5fce4a3364c7e323e42fbe7a6) Add PKGBUILD for crates-io no-bin - [`0a8d8f2`](https://github.com/fosskers/cargo-aur/commit/0a8d8f251c035b1f862915bbf307af5219098c25) Remove warning, bump version - [`93c60a3`](https://github.com/fosskers/cargo-aur/commit/93c60a3c5878c78079f6c20fabe51924ef31d38c) Implement PKGBUILD for no-bin, source type project - [`cd55dca`](https://github.com/fosskers/cargo-aur/commit/cd55dca666d362cefae4da18eb9ac7b48687ab72) Remove derives that were not required - [`cceeda0`](https://github.com/fosskers/cargo-aur/commit/cceeda053a5491e0231548e3c739c0bbf841b275) Fix typo - [`4b595bc`](https://github.com/fosskers/cargo-aur/commit/4b595bc19d25c76e5fbfa5c361a52b9b168b533e) Fix for not using target/release directory for from source pkgbuilds ### 📊 Changes **5 files changed** (+461 additions, -34 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.toml` (+2 -1) ➕ `src/crates.rs` (+268 -0) 📝 `src/error.rs` (+27 -0) 📝 `src/lib.rs` (+12 -6) 📝 `src/main.rs` (+152 -27) </details> ### 📄 Description 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-01 09:11:41 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/cargo-aur#32