summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 12a9cd5df525abd187d156c6351943233d14fbdf (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
# Maintainer: Bakasura <bakasura@protonmail.ch>

pkgname=kawanime-git
pkgver=0.3.1.r211.g1546acd
pkgrel=1
pkgdesc='Desktop app for anime fans'
arch=('x86_64')
url='https://kawanime.com'
license=('MIT')
depends=('nodejs')
makedepends=('git' 'npm' 'libicns')
optdepends=()
provides=('kawanime')
conflicts=('kawanime')
replaces=('kawanime')
_gitname='kawanime'
source=("$_gitname::git+https://github.com/kylart/kawanime.git")
md5sums=('SKIP')

pkgver() {
  cd "$_gitname"

  git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cd "$_gitname"

  npm install && npm run build && npm run dist:linux
}

package() {
  cd "$_gitname/dist"

  ar x *.deb
  tar -xf data.tar.xz

  mv usr "${pkgdir}"
  mv opt "${pkgdir}"

  # Install a wrapper to avoid confusion about binary path
  install -Dm755 /dev/stdin "$pkgdir/usr/bin/$_gitname" <<END
#!/bin/sh
/opt/KawAnime/kawanime
END

}