1 # Maintainer: Caleb Maclennan <caleb@alerque.com>
2 # Maintainer: Bruno Pagani <archange@archlinux.org>
3 # Contributor: William Gathoye <william + aur at gathoye dot be>
4 # Contributor: Aleksandar Trifunović <akstrfn at gmail dot com>
5 # Contributor: Jan Was <janek dot jan at gmail dot com>
6 # Contributor: AUR[Severus]
8 pkgname=mattermost-desktop
11 pkgdesc='Mattermost Desktop application'
13 url="https://github.com/${pkgname/-//}"
16 _builderVersion='^23.0.8'
23 _archive="${pkgname#*-}-$pkgver"
24 source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz"
26 sha256sums=('ff1c0937a1cbbb6ef64bf536cb19ef1c9254feca38a5b1e8054e255ba3d22fe7'
27 '1c2bf48b6397d04a5a536c5c9f4960db53249c838c380f03f808c612b00ba4c6')
29 _npmargs="--cache '$srcdir/npm-cache' --no-audit --no-fund"
33 --pkgname "$pkgname" \
34 --pkgdesc "$pkgdesc" \
36 --categories 'Network;InstantMessaging;' \
37 --mimetypes 'x-scheme-handler/mattermost;' \
38 --custom StartupWMClass="$pkgname"
40 sed -i -e "s/git rev-parse --short HEAD/echo $pkgver/" webpack.config.base.js
41 sed -e "s/@ELECTRON@/$_electron/" "../$pkgname.sh" > "$pkgname.sh"
42 sed -i -e 's#resources/linux#src/assets/linux#' electron-builder.json
43 sed -i -e 's/--ia32//g;s/--mac//g;s/--arm64//g;s/--win//g;s/--universal//g' package.json
44 local electronDist="/usr/lib/$_electron"
45 local electronVersion="$(<"$electronDist"/version)"
46 # Do not build tar.gz, nor .deb or appimages
47 # Use electron version that matches system package
49 .linux .target |= ["dir"] |
51 "electronDist": $electronDist,
52 "electronVersion": $electronVersion
55 --arg electronDist "$electronDist" \
56 --arg electronVersion "$electronVersion" \
57 electron-builder.json |
58 sponge electron-builder.json
60 del(.devDependencies["electron"]) |
61 .devDependencies["electron-builder"] = $builderVersion
63 --arg electronVersion "$electronVersion" \
64 --arg builderVersion "$_builderVersion" \
72 npm $_npmargs --offline run package:linux
77 install -Dm0644 -t "$pkgdir/usr/lib/$pkgname/" release/linux*unpacked/resources/app.asar
78 install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE.txt
79 install -Dm0644 src/assets/linux/icon.svg "$pkgdir/usr/share/icons/hicolor/scalable/apps/$pkgname.svg"
80 install -Dm0755 "$pkgname.sh" "$pkgdir/usr/bin/$pkgname"
81 install -Dm0644 -t "$pkgdir/usr/share/applications/" "../$pkgname.desktop"