summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 270ce0aa615a0a1990e31530a29828468d8a4761 (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
# Contributor: Jean Lucas <jean@4ray.co>

pkgname=zulip-desktop-git
pkgver=3.1.0beta+r34+g47b729c
pkgrel=1
pkgdesc='Real-time team chat based on the email threading model (git)'
arch=(i686 x86_64)
url=https://zulipchat.com
license=(Apache)
depends=(alsa-lib atk at-spi2-atk cairo dbus fontconfig gdk-pixbuf2 glib2 gtk3 hicolor-icon-theme libcups libxcomposite libxcursor libxdamage libxext libxfixes libxi libxkbfile libxrandr libxrender libxss libxtst nspr nss pango)
makedepends=(git npm python2 libxkbfile typescript)
provides=(zulip-desktop)
conflicts=(zulip-desktop zulip-desktop-bin)
source=(git+https://github.com/zulip/${pkgname/-git/}
        zulip.desktop)
sha512sums=('SKIP'
            '7696a6874d17957f99452452723ae1a6b32b6814b018361a71ed1fe0191e1c6da6f3ad693e2e279615e74f687c380ff2f6dab8b69fcd82476e8f33b56a6b4cb5')

pkgver() {
  cd ${pkgname/-git/}
  git describe --tags | sed 's#v##;s#-#+#g;s#+\([a-zA-Z]\)#\1#;s#+\([0-9]\)#+r\1#'
}

prepare() {
  # We need an API key for Sentry, so let's not use it
  sed -i 's#!isDev#isDev#' ${pkgname/-git/}/app/renderer/js/utils/sentry-util.ts
}

build() {
  cd ${pkgname/-git/}
  npm i
  tsc
  npx electron-builder --dir
}

package() {
  install -Dm 644 zulip.desktop -t "$pkgdir"/usr/share/applications

  cd ${pkgname/-git/}

  mkdir "$pkgdir"/usr/{lib,bin}
  cp -a dist/linux-unpacked "$pkgdir"/usr/lib/${pkgname/-git/}
  ln -s /usr/lib/${pkgname/-git/}/zulip "$pkgdir"/usr/bin

  for i in 16 24 32 48 64 96 128 256 512; do
    install -Dm 644 build/icons/${i}x${i}.png \
      "$pkgdir"/usr/share/icons/hicolor/${i}x${i}/apps/zulip.png
  done

  install -Dm 644 LICENSE -t "$pkgdir"/usr/share/licenses/zulip-desktop
}