summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: f67cd3478eeecb803233f568aff4a91ca08420c4 (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
87
88
89
# Maintainer: Joost Bremmer <toost dot b at gmail dot com>
# Contributor: carstene1ns <url/mail: arch carsten-teibes de>
# Co-Maintainer: Mubashshir <ahmubashshir at gmail dot com>
# from: git

pkgname=trackma-git
pkgver=0.8.6.r52.g514d37e
pkgrel=1
pkgdesc="A lightweight and simple program for updating and using lists on several media tracking websites."
arch=('any')
url="https://z411.github.io/trackma/"
license=('GPL3')
depends=('python'
         'python-pyinotify')

makedepends=(
  desktop-file-utils
  git
  python-poetry-core
  python-build
  python-installer
  python-wheel
)
optdepends=('python-cairo:   GTK frontend'
    'python-gobject: GTK frontend/MPRIS tracker'
    'python-pillow:  thumbnail images for GUI frontends'
    'python-jeepney:  MPRIS tracker'
    'python-pyqt5:   Qt frontend'
    'python-urwid:   ncurses frontend'
    'lsof:           polling tracker/pyinotify alternative')

source=(${pkgname}::"git+https://github.com/z411/${pkgname%-git}.git"
    "anime-relations::git+https://github.com/erengy/anime-relations.git"
    "${pkgname%-git}-curses.desktop"
    "${pkgname%-git}-gtk.desktop"
    "${pkgname%-git}-qt.desktop")

sha256sums=('SKIP'
            'SKIP'
            '80be9ffc3eb66456004a438a3da8950ed8382faa00a3fe61c5ef3980090c4dce'
            '1d866705353d08243ecef80495da7bb5703d8e95697cdfe75e4f4170e5ef23f4'
            '988f4c4422577f0657e9ff8a9695ef44796ee6a9c43e07ee7a81369f25c2761f')

#old package name.
conflicts=('wmal-git' 'trackma')
provides=('trackma')

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

prepare() {
  cd ${pkgname}
  git submodule init
  git config submodule."trackma/data/anime-relations".url $srcdir/anime-relations
  git -c protocol.file.allow=always submodule update
}

build() {
  python -m build --no-isolation --wheel "$srcdir/$pkgname"
}

package() {
  _py=$(python --version)
  _py=${_py%%.*}

  python -m installer --destdir="$pkgdir" \
    "$srcdir/$pkgname/dist/${pkgname%-git}-${pkgver%.r*}-py${_py##* }-none-any.whl"

  install -Dvm644 "$srcdir/$pkgname/trackma/data/icon.png" \
  "${pkgdir}/usr/share/pixmaps/${pkgname%-git}.png"

  install -Dvm644 "${srcdir}/trackma-curses.desktop" \
  "${pkgdir}/usr/share/applications/${pkgname%-git}-curses.desktop"

  install -vm644  "${srcdir}/trackma-gtk.desktop" \
  "${pkgdir}/usr/share/applications/${pkgname%-git}-gtk.desktop"

  install -vm644  "${srcdir}/trackma-qt.desktop" \
  "${pkgdir}/usr/share/applications/${pkgname%-git}-qt.desktop"
}

# vim: sw=2 ts=2 tw=80 et: