summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorJonas Malaco2021-02-18 03:25:22 -0300
committerJonas Malaco2021-02-18 03:25:22 -0300
commitf5412d0367fef439faa0ebd32e01671bb55cac8e (patch)
tree24713642d11f0c30ab8438d1d0c2f9f6a32b7417 /PKGBUILD
downloadaur-f5412d0367fef439faa0ebd32e01671bb55cac8e.tar.gz
Add cargo-criterion starting at version 1.0.1
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD36
1 files changed, 36 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..c98d4987b65f
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,36 @@
+# Maintainer: Jonas Malaco <jonas@protocubo.io>
+pkgname=cargo-criterion
+pkgver=1.0.1
+pkgrel=1
+pkgdesc='Cargo plugin for analyzing and reporting on Criterion-rs benchmarks.'
+arch=('any')
+url='https://github.com/bheisler/cargo-criterion'
+license=('Apache' 'MIT')
+depends=('cargo' 'rust')
+optdepends=('gnuplot: generate detailed graphs with gnuplot')
+# source=("$pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz")
+
+# Exceptionally fetch crate from crates.io because the repository is missing
+# the 1.0.1 tag; the crate was manually compared against the code in the
+# repository (at commit df292d5e6170) and, while the do NOT match, the
+# differences are only in metadata like bumping the version number and updating
+# the changelog; 1.0.1 also includes a relevant fix that, in my experience,
+# made 1.0.0 unsuable.
+source=("$pkgname-$pkgver.tar.gz::https://crates.io/api/v1/crates/cargo-criterion/1.0.1/download")
+sha256sums=('6c0ae64be9d0d1ad733cd6d2c2776d93c18ba771ffad8a134dfe592c62babd26')
+
+build() {
+ cd "$pkgname-$pkgver"
+ cargo build --release --locked --all-features --target-dir=target
+}
+
+check() {
+ cd "$pkgname-$pkgver"
+ cargo test --release --locked --target-dir=target
+}
+
+package() {
+ cd "$pkgname-$pkgver"
+ install -Dm 755 target/release/${pkgname} -t "${pkgdir}/usr/bin"
+ install -Dm644 "LICENSE-MIT" "$pkgdir/usr/share/licenses/${pkgname}/LICENSE-MIT"
+}