2025-03-07 04:40:13 -08:00

47 lines
1.6 KiB
Bash

# Maintainer: sudacode <suda@sudacode.com>
pkgname=python-jimaku-dl
_pkgname=jimaku-dl
# We'll determine the version from git, so this is just a placeholder
pkgver=0.1.1.r1.c7cab59
pkgrel=1
pkgdesc="A Python package to download Japanese subtitles for anime from Jimaku.cc"
arch=('any')
url="https://gitea.suda.codes/sudacode/jimaku-dl"
license=('GPL3')
depends=('python' 'python-pip' 'fzf')
optdepends=('mpv: for playback functionality')
makedepends=('python-setuptools' 'python-wheel' 'python-build' 'python-installer' 'git')
# Option 1: Use git directly (more reliable)
source=("git+https://gitea.suda.codes/sudacode/${_pkgname}.git")
# Option 2: Try alternative archive URL format (uncomment if Option 1 fails)
# source=("$_pkgname-$pkgver.tar.gz::https://gitea.suda.codes/sudacode/${_pkgname}/archive/refs/tags/v${pkgver}.tar.gz")
# Option 3: Try zip format instead (uncomment if Options 1 and 2 fail)
# source=("$_pkgname-$pkgver.zip::https://gitea.suda.codes/sudacode/${_pkgname}/archive/v${pkgver}.zip")
sha256sums=('SKIP')
pkgver() {
cd "$_pkgname"
git describe --long --tags | sed 's/^v//;s/\([^-]*-\)g/r\1/;s/-/./g'
}
build() {
cd "$_pkgname" # For git source
# cd "$_pkgname-$pkgver" # Uncomment this for archive source
python -m build --wheel --no-isolation
}
package() {
cd "$_pkgname" # For git source
# cd "$_pkgname-$pkgver" # Uncomment this for archive source
python -m installer --destdir="$pkgdir" dist/*.whl
# Install license file
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
# Install documentation
install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
}