summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 015068153a644a8e1c90f8515177c02125bc14c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Maintainer: Andrej Halveland (SnipeX_) <andrej.halv@gmail.com>

pkgname=zotify-git
pkgver=r93.5da27d3
pkgrel=1
pkgdesc="A fast and customizable music and podcast downloader."
arch=('x86_64')
url="https://zotify.xyz/zotify/zotify"
license=('custom')
depends=(
  'python'
  'python-librespot'
  'python-music-tag'
  'python-pillow'
  'python-protobuf'
  'python-tabulate'
  'python-tqdm'
  'python-ffmpy'
  'python-pwinput'
  'python-mutagen'
)
makedepends=(
  'git'
  'python-setuptools'
  'python-build'
  'python-wheel'
  'python-installer'
)
provides=('zotify')
conflicts=('zotify')
source=("zotify::git+https://zotify.xyz/zotify/zotify")
sha256sums=('SKIP')

pkgver() {
  cd "${srcdir}/zotify"
  ( set -o pipefail
    git describe --long --abbrev=7 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
  )
}

build() {
  cd zotify
  python -m build --wheel --no-isolation
}

package() {
  cd zotify
  python -m installer --destdir="${pkgdir}" dist/*.whl
  mkdir -p "${pkgdir}/usr/bin"

  cat <<EOF >"${pkgdir}/usr/bin/zotify"
#!/bin/sh
python -m zotify \$@
EOF

  chmod +x "${pkgdir}/usr/bin/zotify"
  install -Dm644 LICENSE -t "${pkgdir}"/usr/share/licenses/${pkgname}/
}