summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: cbc960fb42a021a5af2796c68ff76f40ef182801 (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
# Maintainer: Rockykln <contact@rockykln.com>

pkgname=refrain-git
_pkgname=refrain
pkgver=0.4.1.r102.g03f03c0
pkgrel=1
pkgdesc="Discord Rich Presence for Apple Music on Linux (git)"
arch=('any')
url="https://github.com/Rockykln/refrain"
license=('custom:Refrain')
depends=(
    'python>=3.11'
    'python-pypresence'
    'python-dbus'
    'pyside6'
)
makedepends=(
    'git'
    'python-build'
    'python-installer'
    'python-hatchling'
    'python-wheel'
)
provides=("$_pkgname")
conflicts=("$_pkgname")
source=("$_pkgname::git+https://github.com/Rockykln/refrain.git")
sha256sums=('SKIP')

pkgver() {
    cd "$_pkgname"
    local _ver
    _ver=$(grep -m1 '^version' pyproject.toml | cut -d'"' -f2)
    printf "%s.r%s.g%s" \
        "$_ver" \
        "$(git rev-list --count HEAD)" \
        "$(git rev-parse --short HEAD)"
}

build() {
    cd "$_pkgname"
    python -m build --wheel --no-isolation
}

package() {
    cd "$_pkgname"
    python -m installer --destdir="$pkgdir" dist/*.whl

    install -Dm644 src/refrain/assets/refrain.desktop \
        "$pkgdir/usr/share/applications/refrain.desktop"
    install -Dm644 src/refrain/assets/icons/refrain.svg \
        "$pkgdir/usr/share/icons/hicolor/scalable/apps/refrain.svg"
    install -Dm644 LICENSE \
        "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}