summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 4648fae13860d3cfaa99bf9dce7f0dc65c9f3c5a (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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Maintainer: Sumner Evans <sumner.evans98 at gmail dot com>

pkgbase='sublime-music-git'
pkgname=('sublime-music-git')
_module='sublime-music'
pkgver=v0.11.10.r18.gfa81f61
pkgrel=1
pkgdesc='A native Subsonic/Airsonic/*sonic client for Linux. Built using Python and GTK+.'
url='https://sublimemusic.app'
provides=('sublime-music')
conflicts=('sublime-music')
depends=(
    'python'
    'python-bleach'
    'python-dataclasses-json'
    'python-dateutil'
    'python-deepdiff'
    'python-fuzzywuzzy'
    'python-gobject'
    'python-levenshtein'
    'python-mpv'
    'python-peewee'
    'python-requests'
    'python-semver'
)
optdepends=(
    'libnm-glib: for changing the Subsonic server address depending on what SSID you are connected to'
    'libnotify: for system song notification support'
    'python-keyring: support for storing passwords in the system keyring'
    'python-pychromecast: support for casting to Chromecast devices'
    'python-bottle: support for casting downloaded files to Chromecasts on the same LAN'
)
makedepends=(
    'python-pip'
    'python-poetry'
    'python-sphinx'
    'tar'
)
license=('GPL3')
arch=('any')
source=(
    'sublime-music-git::git+https://gitlab.com/sublime-music/sublime-music.git'
)
md5sums=('SKIP')

pkgver() {
    cd "${srcdir}/${pkgname}"
    git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}


build() {
    cd "${srcdir}/${pkgname}"
    poetry build
}

package() {
    cd "${srcdir}/${pkgname}"
    pip install dist/sublime_music-*.tar.gz --root="${pkgdir}"

    # Move all of the package data resources to ${pkgdir}/usr/share/sublime-music
    data_dir=${pkgdir}/usr/share/sublime-music
    mkdir -p $data_dir/adapters/subsonic $data_dir/dbus $data_dir/ui
    pushd ${pkgdir}/usr/lib/python3.9/site-packages/sublime_music
    mv adapters/icons $data_dir/adapters
    mv adapters/images $data_dir/adapters
    mv adapters/subsonic/icons $data_dir/adapters/subsonic
    mv dbus/mpris_specs $data_dir/dbus
    mv ui/icons $data_dir/ui
    mv ui/images $data_dir/ui
    popd

    desktop-file-install --dir=${pkgdir}/usr/share/applications sublime-music.desktop
    install -Dm644 sublime-music.metainfo.xml "${pkgdir}/usr/share/metainfo/sublime-music.metainfo.xml"

    pushd docs
    make man
    install -Dm644 ./_build/man/sublime-music.1 "${pkgdir}/usr/share/man/man1/sublime-music.1"
    popd

    pushd logo/rendered
    for size in 16 22 32 48 64 72 96 128 192 512 1024; do
        install -Dm644 ${size}.png ${pkgdir}/usr/share/icons/hicolor/${size}x${size}/apps/sublime-music.png
    done
    popd
}