From fc0a07871972d9c8ee00323531d6fc44ff19738d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=A5=D1=80?=
 =?UTF-8?q?=D0=B0=D0=BC=D0=BE=D0=B2?= <xpamych@yandex.ru>
Date: Mon, 30 Sep 2024 19:05:06 +0300
Subject: [PATCH] gitea deps

---
 python3-maturin/alr.sh         | 14 ++++++++
 python3-setuptools-rust/alr.sh | 59 +++++++++++++++++++++++++++++++
 python3-setuptools-scm/alr.sh  | 64 ++++++++++++++++++++++++++++++++++
 3 files changed, 137 insertions(+)
 create mode 100644 python3-setuptools-rust/alr.sh
 create mode 100644 python3-setuptools-scm/alr.sh

diff --git a/python3-maturin/alr.sh b/python3-maturin/alr.sh
index 5bd19a9..87e458f 100644
--- a/python3-maturin/alr.sh
+++ b/python3-maturin/alr.sh
@@ -13,6 +13,7 @@ deps=(
   'maturin'
   'python'
 )
+
 build_deps=(
   'bzip2'
   'libgcc'
@@ -26,6 +27,19 @@ build_deps=(
   'rust'
 )
 
+build_deps_almalinux=(
+  'bzip2'
+  'libgcc'
+  'git'
+  'glibc'
+  'python3-build'
+  'python3-installer'
+  'python3-setuptools'
+  'python3-setuptools-rust'
+  'python3.12-wheel'
+  'rust'
+)
+
 options=(!lto)
 sources=("https://github.com/PyO3/maturin/archive/v$version/maturin-v$version.tar.gz")
 checksums=('SKIP')
diff --git a/python3-setuptools-rust/alr.sh b/python3-setuptools-rust/alr.sh
new file mode 100644
index 0000000..5202c6e
--- /dev/null
+++ b/python3-setuptools-rust/alr.sh
@@ -0,0 +1,59 @@
+name='python3-setuptools-rust'
+version='1.10.1'
+release='1'
+desc='Compile and distribute Python extensions written in rust as easily as if they were written in C.'
+homepage='https://github.com/PyO3/setuptools-rust'
+maintainer_ru='Евгений Храмов <xpamych@yandex.ru>'
+architectures=('all')
+license=('MIT')
+provides=('setuptools-rust')
+conflicts=('setuptools-rust')
+
+deps=(
+  'rust'
+  'python3-setuptools'
+  'python3-semantic-version'
+)
+
+build_deps=(
+  'git'
+  'python3-build'
+  'python3-installer'
+  'python3-wheel'
+  'python3-setuptools-scm'
+)
+
+build_deps_almalinux=(
+  'git'
+  'python3-build'
+  'python3-installer'
+  'python3-setuptools-wheel'
+  'python3-setuptools-scm'
+)
+
+sources=("git+https://github.com/PyO3/setuptools-rust.git#tag=v$version")
+checksums=('SKIP')
+
+build() {
+  cd setuptools-rust
+  python -m build -nw
+}
+
+check() {
+  cd setuptools-rust
+  local python_version=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
+  for _dir in examples/*; do
+    pushd $_dir
+    PYTHONPATH="$PWD/../.." python -m build -nw
+    python -m installer -d tmp_install dist/*.whl
+    [[ -d tests || -d test ]] && PYTHONPATH="$PWD/tmp_install/usr/lib/python$python_version/site-packages" pytest tests
+    popd
+  done
+  pytest --doctest-modules setuptools_rust
+}
+
+package() {
+  cd setuptools-rust
+  python -m installer -d "$pkgdir" dist/*.whl
+  install-license LICENSE ./python-setuptools-rust/LICENSE
+}
diff --git a/python3-setuptools-scm/alr.sh b/python3-setuptools-scm/alr.sh
new file mode 100644
index 0000000..b135476
--- /dev/null
+++ b/python3-setuptools-scm/alr.sh
@@ -0,0 +1,64 @@
+_name=setuptools_scm
+name='python3-setuptools-scm'
+version='8.1.0'
+release='1'
+desc='Handles managing your python package versions in scm metadata.'
+homepage='https://github.com/pypa/setuptools_scm'
+maintainer_ru='Евгений Храмов <xpamych@yandex.ru>'
+architectures=('all')
+license=('MIT')
+provides=('python-setuptools-scm')
+conflicts=('python-setuptools-scm')
+
+deps=(
+  'python3-packaging'
+  'python3-setuptools'
+)
+
+build_deps=(
+  'git'
+  'python3-build'
+  'python3-installer'
+  'python3-wheel'
+  'mercurial'
+  'python3-pip'
+  'python3-pytest'
+  'python3-rich'
+)
+
+build_deps_almalinux=(
+  'git'
+  'python3-build'
+  'python3-installer'
+  'python3-setuptools-wheel'
+  'python3-pip'
+  'python3-pytest'
+  'python3-rich'
+)
+
+sources=("git+https://github.com/pypa/setuptools_scm.git#tag=v$version")
+checksums=('SKIP')
+
+build() {
+  cd $_name
+  python -m build --wheel --skip-dependency-check --no-isolation
+}
+
+check() {
+  cd $_name
+  python -m venv --system-site-packages test-env
+  test-env/bin/python -m installer dist/*.whl
+  # test_pyproject_support https://gitlab.archlinux.org/archlinux/packaging/packages/python-setuptools-scm/-/issues/1
+  test-env/bin/python -m pytest -vk 'not test_not_owner and not test_pyproject_support'
+}
+
+package() {
+  cd $_name
+  python -m installer --destdir="$pkgdir" dist/*.whl
+
+  # Symlink license file
+  local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
+  install -d "$pkgdir"/usr/share/licenses/python3-setuptools-scm
+  ln -s "$site_packages"/$_name-$version.dist-info/LICENSE \
+    "$pkgdir"/usr/share/licenses/python3-setuptools-scm/LICENSE
+}