summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7669bce539d35f6cb10f2c0f9459a20aee1fa0b5 (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
# Maintainer: Jiachen Yang <farseerfc@gmail.com>
pkgbase=netease-musicbox-git
pkgname=(netease-musicbox-git netease-musicbox-py2-git)
_gitname=musicbox
pkgver=r524.8f9fd95
pkgrel=1
pkgdesc="A sexy command line interface musicbox for NetEase based on Python"
arch=(any)
url="https://github.com/darknessomi/musicbox"
depends=('mpg123')
optdepends=('aria2: music caching'
            'libnotify: notifications'
           )
license=('MIT')
_py2depends=('python2' 'mpg123' 'python2-beautifulsoup4' 'python2-requests' 'python2-setuptools' 'python2-crypto' 'python2-future')
_py3depends=('python' 'mpg123' 'python-beautifulsoup4' 'python-requests' 'python-setuptools' 'python-crypto' 'python-future')
makedepends=('git'
  ${_py2depends[@]}
  ${_py3depends[@]}
) # both python and python2 depends goes to makedepends
options=(!emptydirs)
source=("git+https://github.com/darknessomi/musicbox")
sha256sums=('SKIP')
provides=('netease-musicbox')
conflicts=('netease-musicbox')
install=$pkgname.install

pkgver() {
  cd $_gitname
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

package_netease-musicbox-py2-git() {
  replace=("netease-musicbox-git<=r515.7dfd3fe-1")
  depends=(${_py2depends[@]})
  optdepends=('aria2: music caching'
            'python2-keybinder2: global keybindings'
            'libnotify: notifications'
            'python2-pyqt4: lyrics support'
            'python2-dbus: lyrics support'
           )
  cd "$srcdir/$_gitname"
  python2 setup.py install --root="$pkgdir/" --optimize=1
  mkdir -p "${pkgdir}/usr/share/licenses/${pkgname}"
  install -m755 LICENSE.txt "${pkgdir}/usr/share/licenses/${pkgname}/"
}

package_netease-musicbox-git() {
  depends=(${_py3depends[@]})
  optdepends=('aria2: music caching'
            'libnotify: notifications'
            'python-pyqt4: lyrics support'
            'python-dbus: lyrics support'
           )
  cd "$srcdir/$_gitname"
  python setup.py install --root="$pkgdir/" --optimize=1
  mkdir -p "${pkgdir}/usr/share/licenses/${pkgname}"
  install -m755 LICENSE.txt "${pkgdir}/usr/share/licenses/${pkgname}/"
}
# vim:set ts=2 sw=2 et: