# Template file for 'discord'
pkgname=discord
version=1.0.154
revision=1
archs="x86_64"
depends="alsa-lib dbus-glib gtk+3 libnotify nss libXtst libcxx libatomic
 xdg-utils webrtc-audio-processing libXScrnSaver"
short_desc="Chat and VOIP application"
maintainer="Orphaned <orphan@voidlinux.org>"
license="custom:Proprietary"
homepage="https://discord.com"
distfiles="https://dl.discordapp.net/apps/linux/${version}/discord-${version}.tar.gz"
checksum=062352a0f0245d2f2e57f80b0a81c0c5e4bf3fa38cb04a297d0a08e78d486d9f
repository=nonfree
restricted=yes
nopie=yes
nostrip=yes

do_install() {
	local package_location="usr/lib/$pkgname" item
	vmkdir usr/share/pixmaps
	vcopy discord.png /usr/share/pixmaps/
	vmkdir usr/share/applications
	vcopy discord.desktop /usr/share/applications/
	vmkdir ${package_location}
	chmod +x discord
	for item in \
		discord \
		discord.png \
		postinst.sh \
		updater_bootstrap
	do
		vcopy "${item}" "${package_location}"
	done
	vmkdir usr/bin
	ln -sfr $DESTDIR/${package_location}/discord $DESTDIR/usr/bin/discord
}

post_install() {
	vlicense $FILESDIR/LICENSE
}
