blob: 79e1de63b3790107a420ee2f9000252c5254c4d6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# Maintainer: Adrian Groh <adrian[dot]groh[at]t[dash]online[dot]de>
# Contributor: Luis Martinez <luis dot martinez at disroot dot org>
# Contributor: Hoàng Văn Khải <hvksmr1996@gmail.com>
pkgname=dprint
pkgver=0.50.0
pkgrel=1
pkgdesc='Pluggable and configurable code formatting platform'
arch=('x86_64')
url='https://github.com/dprint/dprint'
license=('MIT')
depends=('bzip2')
provides=('dprint')
conflicts=('dprint-bin')
makedepends=('cargo')
options=('!lto') ## interferes with compiling
source=("$pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz")
sha256sums=('28a9538c293a1cbe2af8241d687c44309dd1aa1c514c6a937ef3c25699dce4ea')
prepare() {
cd "$pkgname-$pkgver"
cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}
build() {
export RUST_TOOLCHAIN=stable
export CARGO_TARGET_DIR=target
cd "$pkgname-$pkgver"
cargo build --release --frozen --all-features
}
package() {
cd "$pkgname-$pkgver"
# generate shell completions
install -d "$pkgdir/usr/share/bash-completion/completions/" \
"$pkgdir/usr/share/elvish/lib/" \
"$pkgdir/usr/share/fish/vendor_completions.d/" \
"$pkgdir/usr/share/zsh/site-functions/"
./target/release/dprint completions bash > "$pkgdir/usr/share/bash-completion/completions/dprint"
./target/release/dprint completions elvish > "$pkgdir/usr/share/elvish/lib/dprint.elv"
./target/release/dprint completions fish > "$pkgdir/usr/share/fish/vendor_completions.d/dprint.fish"
./target/release/dprint completions zsh > "$pkgdir/usr/share/zsh/site-functions/_dprint"
install -Dv target/release/dprint -t "$pkgdir/usr/bin/"
install -Dvm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
install -Dvm644 README.md docs/*.md -t "$pkgdir/usr/share/doc/$pkgname/"
}
|