summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 1d16d93ac057cdb37c4c7849eaecf6a4711bc648 (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: Lorens Gwine <lorensgwine@gmail.com>
pkgname=tc-twitch-git
_pkgname=tc-twitch
_realname=tc
pkgver=10.2.0.r16.g0e5ed56
pkgrel=1
pkgdesc="The chat client for Twitchâ„¢"
arch=('any')
url="https://github.com/mccxiv/${_realname}"
license=('custom')
provides=($_pkgname)
conflicts=($_pkgname)
makedepends=('git' 'npm')
source=("$_pkgname.desktop" "$pkgname::git+https://github.com/mccxiv/tc.git")
md5sums=('72e3fe4d7076cd6e7c26d5d3819b1c0a'
         'SKIP')

pkgver() {
  cd $pkgname
  git describe --tags --long | sed -r -e 's,^[^0-9]*,,;s,([^-]*-g),r\1,;s,[-_],.,g'
}

build() {
  cd $srcdir/$pkgname
  rm -rf _dist
  rm -rf _build
  mkdir -p _build
  npm install
  npm install 7zip-bin-linux 
  node_modules/.bin/webpack
  cp src/tc-renderer/index.html _build/index.html
  cp src/package.json _build/package.json
  npm run dist:linux
  # license
  sed -n '/### License/,/You may not/p' README.md > LICENSE
}

package() {
  install -d "$pkgdir"/{usr/bin,opt}
  cp -a $srcdir/$pkgname/dist/linux-unpacked $pkgdir/opt/$_pkgname
  ln -s $pkgdit/opt/$_pkgname/tc $pkgdir/usr/bin/tc-twitch
  install -Dm644 $srcdir/$_pkgname.desktop $pkgdir/usr/share/applications/$_pkgname.desktop
  install -Dm644 $srcdir/$pkgname/LICENSE $pkgdir/usr/share/licenses/$_pkgname/LICENSE
  # icons
  install -Dm644 $srcdir/$pkgname/src/assets/icon16.png $pkgdir/usr/share/icons/hicolor/16x16/apps/$_pkgname.png
  install -Dm644 $srcdir/$pkgname/src/assets/icon256.png $pkgdir/usr/share/icons/hicolor/256x256/apps/$_pkgname.png
}