2020-07-25 16:19:26 +00:00
|
|
|
# Template file for 'mattermost-desktop'
|
|
|
|
pkgname=mattermost-desktop
|
|
|
|
version=4.5.2
|
2020-08-17 16:47:51 +00:00
|
|
|
revision=2
|
|
|
|
archs="x86_64* i686*"
|
2020-07-25 16:19:26 +00:00
|
|
|
wrksrc="desktop-${version}"
|
|
|
|
# electron-builder needs GNU tar
|
2020-08-17 16:47:51 +00:00
|
|
|
hostmakedepends="git p7zip jq nodejs-lts-10 python libicns GraphicsMagick xz tar"
|
|
|
|
makedepends="libnotify-devel electron7"
|
|
|
|
depends="electron7"
|
2020-07-25 16:19:26 +00:00
|
|
|
short_desc="Team messaging app, an open source Slack alternative"
|
|
|
|
maintainer="Artem Zhurikhin <ashpool@xecut.net>"
|
|
|
|
license="Apache-2.0"
|
|
|
|
homepage="https://mattermost.com/"
|
|
|
|
distfiles="https://github.com/mattermost/desktop/archive/v${version}.tar.gz"
|
|
|
|
checksum=17e32346592d175f091a4f12068e0cfc5cfd20ed7894f88bb5b54b2eb6eac74a
|
2020-08-17 16:47:51 +00:00
|
|
|
nocross=yes
|
|
|
|
|
|
|
|
if [ "$XBPS_LIBC" = "musl" ]; then
|
|
|
|
hostmakedepends+=" gcompat" #XXX: ugly af
|
|
|
|
# Npm fetches a bunch of binaries that are lined against glibc
|
|
|
|
# refuses to use the system one
|
|
|
|
# this also kinda limits the amount of support host archs for the build
|
|
|
|
# can partly fixed by adding some host deps so these tools can be built
|
|
|
|
# from source. In short npm packages are a busted mess that shouldn't exist
|
|
|
|
fi
|
|
|
|
|
|
|
|
do_configure() {
|
|
|
|
case "${XBPS_TARGET_MACHINE#-musl}" in
|
|
|
|
x86_64*) sed -i 's/--ia32//g' package.json ;;
|
|
|
|
i686*) sed -i 's/--x64//g' package.json ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
# Prepend to system electron in order to avoid an unneeded download.
|
|
|
|
local electronDist="/usr/lib/electron7"
|
|
|
|
local electronVersion="$(<"$electronDist"/version)"
|
|
|
|
jq '{"electronDist": $electronDist, "electronVersion": $electronVersion} + .' \
|
|
|
|
--arg electronDist "$electronDist" \
|
|
|
|
--arg electronVersion "$electronVersion" \
|
|
|
|
electron-builder.json > electron-builder-new.json
|
|
|
|
mv electron-builder-new.json electron-builder.json
|
|
|
|
}
|
2020-07-25 16:19:26 +00:00
|
|
|
|
|
|
|
pre_build() {
|
2020-08-17 16:47:51 +00:00
|
|
|
# XXX: Should probably be done in some kind of npm helper
|
|
|
|
export USE_SYSTEM_7ZA="true"
|
2020-07-25 16:19:26 +00:00
|
|
|
npm install
|
|
|
|
}
|
|
|
|
|
|
|
|
do_build() {
|
2020-08-17 16:47:51 +00:00
|
|
|
export USE_SYSTEM_7ZA="true"
|
2020-07-25 16:19:26 +00:00
|
|
|
npm run build
|
|
|
|
npm run package:linux
|
|
|
|
}
|
|
|
|
|
|
|
|
do_install() {
|
|
|
|
case $XBPS_TARGET_MACHINE in
|
2020-08-17 16:47:51 +00:00
|
|
|
x86_64*) cd release/linux-unpacked ;;
|
|
|
|
i686*) cd release/linux-ia32-unpacked ;;
|
2020-07-25 16:19:26 +00:00
|
|
|
esac
|
|
|
|
vmkdir usr/libexec/${pkgname}
|
2020-08-17 16:47:51 +00:00
|
|
|
vinstall resources/app.asar 644 usr/libexec/${pkgname}
|
2020-07-25 16:19:26 +00:00
|
|
|
vinstall Mattermost.desktop 644 usr/share/applications
|
2020-08-17 16:47:51 +00:00
|
|
|
vinstall icon.svg 644 usr/share/icons/hicolor/scalable/apps mattermost-desktop.svg
|
|
|
|
vbin ${FILESDIR}/mattermost-desktop.sh mattermost-desktop
|
2020-07-25 16:19:26 +00:00
|
|
|
}
|