Date: Saturday, February 25, 2023 @ 14:09:36
  Author: alerque
Revision: 1403955

upgpkg: ruff 0.0.252-2

Modified:
  ruff/trunk/PKGBUILD

----------+
 PKGBUILD |   29 +++++++++++++++++++++--------
 1 file changed, 21 insertions(+), 8 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD    2023-02-25 13:30:29 UTC (rev 1403954)
+++ PKGBUILD    2023-02-25 14:09:36 UTC (rev 1403955)
@@ -1,15 +1,16 @@
 # Maintainer: David Runge <[email protected]>
 # Maintainer: Caleb Maclennan <[email protected]>
 
-pkgname=ruff
+pkgbase=ruff
+pkgname=($pkgbase python-$pkgbase)
 pkgver=0.0.252
-pkgrel=1
+pkgrel=2
 pkgdesc='An extremely fast Python linter, written in Rust'
 arch=(x86_64)
 url="https://github.com/charliermarsh/$pkgname";
 license=(MIT)
 depends=(gcc-libs glibc)
-makedepends=(cargo)
+makedepends=(cargo maturin python-installer)
 options=(!lto)
 _archive="$pkgname-$pkgver"
 source=($url/archive/refs/tags/v$pkgver/$_archive.tar.gz)
@@ -23,7 +24,7 @@
 
 build() {
   cd "$_archive"
-  cargo build -p ruff_cli --frozen --release --all-features
+  maturin build --locked --release --all-features --target 
"$CARCH-unknown-linux-gnu" --strip
 }
 
 check() {
@@ -31,13 +32,25 @@
   cargo test -p ruff_cli --frozen --all-features
 }
 
-package() {
+_package_common() {
+  install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE
+  install -Dm0644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
+}
+
+package_ruff() {
   cd "$_archive"
-  local _target="target/release/$pkgname"
+  _package_common
+  local _target="target/x86_64-unknown-linux-gnu/release/ruff"
   install -Dm0755 -t "$pkgdir/usr/bin/" "$_target"
-  install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE
-  install -Dm0644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
   $_target --generate-shell-completion bash | install -Dm0644 /dev/stdin 
"$pkgdir/usr/share/bash-completion/completions/$pkgname.bash"
   $_target --generate-shell-completion fish | install -Dm0644 /dev/stdin 
"$pkgdir/usr/share/fish/vendor_completions.d/$pkgname.fish"
   $_target --generate-shell-completion zsh  | install -Dm0644 /dev/stdin 
"$pkgdir/usr/share/zsh/site-functions/_$pkgname"
 }
+
+package_python-ruff() {
+  cd "$_archive"
+  _package_common
+  depends=(python "$pkgbase")
+  python -m installer -d "$pkgdir" target/wheels/*.whl
+  rm -rf "$pkgdir/usr/bin"
+}

Reply via email to