6 Commits

Author SHA1 Message Date
dependabot[bot]
6a047906db chore(deps): bump actions/checkout from 5 to 6
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-22 07:51:52 +09:00
Colin Woodbury
da9934bf00 Merge pull request #36 from fosskers/dependabot/github_actions/actions/checkout-5
chore(deps): bump actions/checkout from 4 to 5
2025-08-12 09:51:01 +09:00
dependabot[bot]
ccd4e9cdb9 chore(deps): bump actions/checkout from 4 to 5
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-11 20:07:17 +00:00
Colin Woodbury
fdc2a8ee9c Merge pull request #35 from dcampbell24/add-namcap
Add mention of namcap.
2025-05-11 08:59:00 +09:00
David Campbell
244d4f2980 Add mention of namcap. 2025-05-10 14:33:30 -04:00
Colin Woodbury
6ea9720f90 feat: inject custom commands into package() 2024-03-22 08:19:40 +09:00
6 changed files with 45 additions and 1 deletions

View File

@@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Build
run: cargo build --verbose
- name: Run tests

View File

@@ -1,5 +1,14 @@
# `cargo-aur` Changelog
## Unreleased
#### Added
- A new `custom` field in `[package.metadata.aur]` which accepts a list of
strings that will be added as-is to the `package()` function of the PKGBUILD.
This allows the user to add specific extra commands to their build process.
See the README for more details.
## 1.7.1 (2024-03-18)
#### Fixed

View File

@@ -28,3 +28,4 @@ panic = "abort"
[package.metadata.aur]
# depends = ["blah"]
# files = [[".github/dependabot.yml", "/usr/local/share/cargo-aur/dependabot.yml"]]
custom = ["echo hi"]

View File

@@ -51,6 +51,12 @@ If you wish, you can now run `makepkg` to ensure that your package actually buil
==> Finished making: cargo-aur-bin 1.0.0-1 (Wed 10 Jun 2020 08:23:47 PM PDT)
```
You can also run `namcap` to verify your package doesn't have errors.
```sh
> namcap *.zst
```
Notice that the built package itself is postfixed with `-bin`, which follows the
AUR standard.
@@ -103,6 +109,28 @@ package() {
}
```
### Custom commands within `package()`
The `custom` list can be used to add specific commands to the `package()`
function. This config:
```toml
[package.metadata.aur]
custom = ["echo hi"]
```
yields:
```
package() {
install -Dm755 cargo-aur -t "$pkgdir/usr/bin"
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
echo hi
}
```
**Note:** Caveat emptor. No attempt is made to verify the injected commands.
### Static Binaries
Run with `--musl` to produce a release binary that is statically linked via

View File

@@ -164,4 +164,6 @@ pub struct AUR {
optdepends: Vec<String>,
#[serde(default)]
pub files: Vec<(PathBuf, PathBuf)>,
#[serde(default)]
pub custom: Vec<String>,
}

View File

@@ -253,6 +253,10 @@ where
)?;
}
}
for custom in aur.custom.iter() {
writeln!(file, " {}", custom)?;
}
}
writeln!(file, "}}")?;