archrelease: copy trunk to community-x86_64
[ArchLinux/community.git] / ruff / repos / community-x86_64 / PKGBUILD
blobe7a54bbab165a56cdef2cab4c0db8d08b153eeed
1 # Maintainer: David Runge <dvzrv@archlinux.org>
2 # Maintainer: Caleb Maclennan <caleb@alerque.com>
4 pkgbase=ruff
5 pkgname=($pkgbase python-$pkgbase)
6 pkgver=0.0.268
7 pkgrel=1
8 pkgdesc='An extremely fast Python linter, written in Rust'
9 arch=(x86_64)
10 url="https://github.com/charliermarsh/$pkgname"
11 license=(MIT)
12 depends=(
13   gcc-libs
14   glibc
16 makedepends=(
17   cargo
18   maturin
19   python-installer
21 options=(!lto)
22 _archive="$pkgname-$pkgver"
23 source=($url/archive/refs/tags/v$pkgver/$_archive.tar.gz)
24 sha512sums=('7faba5e64a1a032a757e7f8c7d2d893622a57ac78fbac048405d2c5102e43ffb91a73f5de0ffa17d89d5ef0b0d6f1563ed4693a8240b8758064ebf8ca77b00b9')
25 b2sums=('8fe63692dc6915593578cf970da409b389523a62ffb4a4c35a1ca9ea6207fcb407864a3eda48027d55465b1be08bd90b60f8afcf73c5ce44ccdb4e059606373a')
27 prepare() {
28   cd "$_archive"
29   cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
32 build() {
33   cd "$_archive"
34   maturin build --locked --release --all-features --target "$CARCH-unknown-linux-gnu" --strip
37 check() {
38   cd "$_archive"
39   cargo test -p ruff_cli --frozen --all-features
42 _package_common() {
43   install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE
44   install -Dm0644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
47 package_ruff() {
48   cd "$_archive"
49   _package_common
50   local _target="target/$CARCH-unknown-linux-gnu/release/ruff"
51   install -Dm0755 -t "$pkgdir/usr/bin/" "$_target"
52   $_target --generate-shell-completion bash | install -Dm0644 /dev/stdin "$pkgdir/usr/share/bash-completion/completions/$pkgname.bash"
53   $_target --generate-shell-completion fish | install -Dm0644 /dev/stdin "$pkgdir/usr/share/fish/vendor_completions.d/$pkgname.fish"
54   $_target --generate-shell-completion zsh  | install -Dm0644 /dev/stdin "$pkgdir/usr/share/zsh/site-functions/_$pkgname"
57 package_python-ruff() {
58   cd "$_archive"
59   _package_common
60   depends=(python "$pkgbase")
61   python -m installer -d "$pkgdir" target/wheels/*.whl
62   rm -rf "$pkgdir/usr/bin"