# Contributor: Lauren N. Liberda # Maintainer: Lauren N. Liberda pkgname=mattermost-desktop pkgver=5.4.0 pkgrel=1 _pkgver="${pkgver/_rc/-rc.}" pkgdesc="Open source collaboration for developers" url="https://mattermost.com/" arch="aarch64 x86_64" # electron license="Apache-2.0" depends="electron" makedepends=" electron-dev electron-tasje nodejs npm python3 " options="net !check" # broken checkdepends="libx11-dev make" source=" $pkgname-$pkgver-2.tar.gz::https://github.com/mattermost/desktop/archive/refs/tags/v$_pkgver/mattermost-v$_pkgver.tar.gz tasje-fix-modules.patch mattermost-desktop " builddir="$srcdir/desktop-$_pkgver" replaces="mattermost" prepare() { default_prepare git init git config user.email x@x git config user.name x git commit --allow-empty --message "$(date -Is)" --no-gpg-sign msg "Downloading dependencies" npm ci --ignore-scripts } build() { msg "Building the app resources" NODE_ENV=production npm run build msg "Building native modules" ( # it doesn't have an install script with node-gyp and doesn't even have it in deps cd node_modules/macos-notification-state ../.bin/node-gyp rebuild --build-from-source --nodedir=/usr/include/electron/node_headers ) msg "Removing devDependencies" npm prune --omit=dev msg "Packaging the app" tasje pack --config electron-builder.json } check() { export ELECTRON_OVERRIDE_DIST_PATH=/usr/bin/electron npm rebuild robotjs --build-from-source --nodedir=/usr/include/electron/node_headers npm run test } package() { install -Dm644 release/resources/app.asar "$pkgdir"/usr/lib/$pkgname/app.asar install -Dm644 release/mattermost-desktop.desktop "$pkgdir"/usr/share/applications/$pkgname.desktop install -Dm755 "$srcdir"/mattermost-desktop "$pkgdir"/usr/bin/mattermost-desktop while read -r size; do install -Dm644 release/icons/$size.png "$pkgdir"/usr/share/icons/hicolor/$size/apps/$pkgname.png done < release/icons/size-list } sha512sums=" 410858bb32d774550e3a6e4fb49d1d55076bed4c6b2b32f13971ac6f9a986e1ca459ec75d4d0ae198ef7f99ed311b681a70447ca638f6e172a3a82ee87ff1773 mattermost-desktop-5.4.0-2.tar.gz 24e8088b585937fe0cd7019a33c6d4ff006f31b732897d3f3295bcef12b49a81c10f43bc862c510413b7624a2b901b6c5a1ca065d8c2dd46626c2a403ef8fe25 tasje-fix-modules.patch 4947e5e7db708f34c812735099c83228b63be7e0f27c19272449c48405a8a49b4f5aa9b45b802c9d6e55a4898ef750d3f9d033e65bb2d0cc906429c5d2864194 mattermost-desktop "