From 1eff9944f36231b49ad557b5c2d2827667d64f49 Mon Sep 17 00:00:00 2001 From: windowsboy111 Date: Mon, 23 Jan 2023 03:52:50 +0800 Subject: [PATCH] Add ruff zoxide (#144) * Add ruff zoxide * Fix big flaw in ruff * a --- anda/python/ruff/anda.hcl | 5 ++ anda/python/ruff/python3-ruff.spec | 43 ++++++++++++++++ anda/python/ruff/update.rhai | 1 + anda/rust/zoxide/anda.hcl | 5 ++ anda/rust/zoxide/rust-zoxide.spec | 50 +++++++++++++++++++ anda/rust/zoxide/update.rhai | 1 + .../rust/zoxide/zoxide-fix-metadata-auto.diff | 11 ++++ 7 files changed, 116 insertions(+) create mode 100644 anda/python/ruff/anda.hcl create mode 100644 anda/python/ruff/python3-ruff.spec create mode 100644 anda/python/ruff/update.rhai create mode 100644 anda/rust/zoxide/anda.hcl create mode 100644 anda/rust/zoxide/rust-zoxide.spec create mode 100644 anda/rust/zoxide/update.rhai create mode 100644 anda/rust/zoxide/zoxide-fix-metadata-auto.diff diff --git a/anda/python/ruff/anda.hcl b/anda/python/ruff/anda.hcl new file mode 100644 index 0000000000..a1d7885cc8 --- /dev/null +++ b/anda/python/ruff/anda.hcl @@ -0,0 +1,5 @@ +project pkg { + rpm { + spec = "python3-ruff.spec" + } +} diff --git a/anda/python/ruff/python3-ruff.spec b/anda/python/ruff/python3-ruff.spec new file mode 100644 index 0000000000..2118218fd2 --- /dev/null +++ b/anda/python/ruff/python3-ruff.spec @@ -0,0 +1,43 @@ +%define debug_package %{nil} + +Name: python3-ruff +Version: 0.0.229 +Release: %autorelease +Summary: An extremely fast Python linter, written in Rust +License: MIT +URL: https://github.com/charliermarsh/ruff +Source0: %{url}/archive/refs/tags/v%{version}.tar.gz +BuildRequires: python3-installer python3.11 python3-pip maturin cargo +Provides: python3.11dist(ruff) = %{version} + +%description +Ruff aims to be orders of magnitude faster than alternative tools while integrating more functionality behind a single, common interface. + +%prep +%autosetup -n ruff-%{version} + +%build +maturin build --release --strip --locked --all-features + +%install +python3.11 -m installer --destdir="%{buildroot}" target/wheels/*.whl +rm -rf %{python3_sitelib}/ruff/__pycache__ + +%files +%doc README.md +%license LICENSE +/usr/lib64/python*/site-packages/ruff-%{version}.dist-info/METADATA +/usr/lib64/python*/site-packages/ruff-%{version}.dist-info/RECORD +/usr/lib64/python*/site-packages/ruff-%{version}.dist-info/WHEEL +/usr/lib64/python*/site-packages/ruff/__pycache__/__init__.cpython-*.pyc +/usr/lib64/python*/site-packages/ruff-%{version}.dist-info/license_files/LICENSE +/usr/lib64/python*/site-packages/ruff/__init__.py +/usr/lib64/python*/site-packages/ruff/__main__.py +/usr/lib64/python*/site-packages/ruff/__pycache__/__main__.cpython-*.opt-1.pyc +/usr/lib64/python*/site-packages/ruff/__pycache__/__main__.cpython-*.pyc +/usr/bin/ruff + +%changelog +* Mon Jan 23 2023 windowsboy111 - 0.0.229 +- Initial package. + diff --git a/anda/python/ruff/update.rhai b/anda/python/ruff/update.rhai new file mode 100644 index 0000000000..ba547052d7 --- /dev/null +++ b/anda/python/ruff/update.rhai @@ -0,0 +1 @@ +rpm.version(gh("charliermarsh/ruff")); diff --git a/anda/rust/zoxide/anda.hcl b/anda/rust/zoxide/anda.hcl new file mode 100644 index 0000000000..ea8109cd89 --- /dev/null +++ b/anda/rust/zoxide/anda.hcl @@ -0,0 +1,5 @@ +project pkg { + rpm { + spec = "rust-zoxide.spec" + } +} diff --git a/anda/rust/zoxide/rust-zoxide.spec b/anda/rust/zoxide/rust-zoxide.spec new file mode 100644 index 0000000000..b226f8e481 --- /dev/null +++ b/anda/rust/zoxide/rust-zoxide.spec @@ -0,0 +1,50 @@ +# Generated by rust2rpm 23 +%define debug_package %{nil} +%global crate zoxide + +Name: rust-zoxide +Version: 0.9.0 +Release: %autorelease +Summary: Smarter cd command for your terminal + +License: MIT +URL: https://crates.io/crates/zoxide +Source: %{crates_source} +# Automatically generated patch to strip foreign dependencies +Patch: zoxide-fix-metadata-auto.diff + +BuildRequires: anda-srpm-macros rust-packaging >= 21 + +%global _description %{expand: +Smarter cd command for your terminal.} + +%description %{_description} + +%package -n %{crate} +Summary: %{summary} + +%description -n %{crate} %{_description} + +%files -n %{crate} +%license LICENSE +%doc CHANGELOG.md +%doc README.md +%{_bindir}/zoxide + +%prep +%autosetup -n %{crate}-%{version_no_tilde} -p1 +%cargo_prep_online + +%build +%cargo_build + +%install +%cargo_install + +%if %{with check} +%check +%cargo_test +%endif + +%changelog +%autochangelog diff --git a/anda/rust/zoxide/update.rhai b/anda/rust/zoxide/update.rhai new file mode 100644 index 0000000000..d88b5df410 --- /dev/null +++ b/anda/rust/zoxide/update.rhai @@ -0,0 +1 @@ +rpm.version(crates("zoxide")); diff --git a/anda/rust/zoxide/zoxide-fix-metadata-auto.diff b/anda/rust/zoxide/zoxide-fix-metadata-auto.diff new file mode 100644 index 0000000000..e8f0e007c2 --- /dev/null +++ b/anda/rust/zoxide/zoxide-fix-metadata-auto.diff @@ -0,0 +1,11 @@ +--- zoxide-0.9.0/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ zoxide-0.9.0/Cargo.toml 1970-01-01T00:00:01+00:00 +@@ -147,8 +147,5 @@ + ] + default-features = false + +-[target."cfg(windows)".dependencies.which] +-version = "4.2.5" +- + [badges.maintenance] + status = "actively-developed"