void-packages/srcpkgs/discord-ptb/template

49 lines
1.7 KiB
Bash

# Template file for 'discord-ptb'
pkgname=discord-ptb
version=0.0.34
revision=1
archs="x86_64"
hostmakedepends="w3m"
depends="alsa-lib dbus-glib gtk+3 libnotify nss libXtst libcxx libatomic
xdg-utils webrtc-audio-processing"
short_desc="Chat and VoIP application (preview version)"
maintainer="0x5c <dev@0x5c.io>"
license="custom:Proprietary"
homepage="https://discord.com/"
distfiles="https://dl-ptb.discordapp.net/apps/linux/${version}/discord-ptb-${version}.tar.gz"
checksum=083e9d2e806796f869c0415f2c8f4eaa386f8993e3df1343c8f2bda81254a9c9
_license_checksum=b64b3fdcd86d70df0e4dffa8d4aa4a7aa3e87204059902f1680100f5ee2f2ef4
nopie=yes
restricted=yes
repository=nonfree
post_extract() {
$XBPS_FETCH_CMD -o eula https://discord.com/terms; cat eula |
w3m -dump -I utf-8 -T text/html |
sed -n '/Discord.s Terms of Service/,/^Imagine a place$/p' > EULA
filesum="$(xbps-digest EULA)"
if [ "$filesum" != "$_license_checksum" ]; then
msg_error "SHA256 mismatch for EULA:\n$filesum\n"
fi
}
do_install() {
local package_location="usr/lib/$pkgname" item
vmkdir usr/share/pixmaps
vinstall discord.png 644 /usr/share/pixmaps/ discord-ptb.png
vmkdir usr/share/applications
vcopy discord-ptb.desktop /usr/share/applications/
vmkdir ${package_location}
for item in DiscordPTB chrome_100_percent.pak chrome_200_percent.pak \
icudtl.dat libEGL.so libGLESv2.so libffmpeg.so locales resources \
resources.pak snapshot_blob.bin swiftshader v8_context_snapshot.bin \
discord.png chrome-sandbox libvk_swiftshader.so postinst.sh ; do
vcopy "${item}" "${package_location}"
done
vmkdir usr/bin
ln -sfr $DESTDIR/${package_location}/DiscordPTB $DESTDIR/usr/bin/discord-ptb
vlicense EULA
}