Skip to content

Commit

Permalink
discord-ptb: update to 0.0.38.
Browse files Browse the repository at this point in the history
Switch away from the janky EULA download setup in favour of a file that links
to the actual current version of the terms, just like the discord package.

Also cleaned up the list of files to copy, made it more maintainable.
  • Loading branch information
0x5c authored and classabbyamp committed Dec 8, 2022
1 parent 0c2e44f commit db0db39
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 21 deletions.
1 change: 1 addition & 0 deletions srcpkgs/discord-ptb/files/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The current version of this license can be found at: https://discord.com/terms
50 changes: 29 additions & 21 deletions srcpkgs/discord-ptb/template
Original file line number Diff line number Diff line change
@@ -1,33 +1,21 @@
# Template file for 'discord-ptb'
pkgname=discord-ptb
version=0.0.35
revision=3
version=0.0.38
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=6e7a79c1f711db5b3b2cc3f11608f91b752cc4f5a5163e2de826dea2c8ae7c76
checksum=6cf83b64d410c44a514a9a7c8f9fd72c10c427221df260c6c52eadaa4cf3235b
nopie=yes
restricted=yes
repository=nonfree
nostrip=yes

post_extract() {
local _license_checksum=bbe45a50d92f383311376477dd6ebecefff801b5d47685757107b6f771cac58d
$XBPS_FETCH_CMD -o eula https://discord.com/terms
w3m -dump -I utf-8 -T text/html eula |
sed -n '/Discord is your place/,/^Imagine a place$/p' > EULA

filesum="$(xbps-digest EULA)"
if [ "$filesum" != "$_license_checksum" ]; then
msg_error "SHA256 mismatch for EULA:\n$filesum\n"
fi
}
noshlibprovides=yes

do_install() {
local package_location="usr/lib/$pkgname" item
Expand All @@ -36,14 +24,34 @@ do_install() {
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
for item in \
DiscordPTB \
discord.png \
chrome_100_percent.pak \
chrome_200_percent.pak \
chrome_crashpad_handler \
chrome-sandbox \
icudtl.dat \
libEGL.so \
libffmpeg.so \
libGLESv2.so \
libvk_swiftshader.so \
libvulkan.so.1 \
locales \
postinst.sh \
resources \
resources.pak \
snapshot_blob.bin \
swiftshader \
v8_context_snapshot.bin \
vk_swiftshader_icd.json
do
vcopy "${item}" "${package_location}"
done
vmkdir usr/bin
ln -sfr $DESTDIR/${package_location}/DiscordPTB $DESTDIR/usr/bin/discord-ptb
}

vlicense EULA
post_install() {
vlicense $FILESDIR/LICENSE
}

0 comments on commit db0db39

Please sign in to comment.