discord 0.0.20-1: new upstream version, add support for discord-flags.conf

This commit is contained in:
Zoddo 2022-09-15 19:43:31 +02:00
parent bcc0ab79b8
commit b5ef7d2c84
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 43E8D68722C7D376
3 changed files with 36 additions and 16 deletions

View file

@ -1,20 +1,22 @@
pkgbase = discord_arch_electron pkgbase = discord_arch_electron
pkgdesc = Discord (popular voice + video app) using the system provided electron for increased security and performance pkgdesc = Discord (popular voice + video app) using the system provided electron for increased security and performance
pkgver = 0.0.19 pkgver = 0.0.20
pkgrel = 1 pkgrel = 1
url = https://discord.com url = https://discord.com
arch = x86_64 arch = x86_64
license = custom license = custom
makedepends = asar makedepends = asar
depends = electron16 depends = electron19
optdepends = libpulse: Pulseaudio support optdepends = libpulse: Pulseaudio support
optdepends = xdg-utils: Open files optdepends = xdg-utils: Open files
provides = discord provides = discord
conflicts = discord conflicts = discord
source = https://dl.discordapp.net/apps/linux/0.0.19/discord-0.0.19.tar.gz source = https://dl.discordapp.net/apps/linux/0.0.20/discord-0.0.20.tar.gz
source = discord-launcher.sh
source = LICENSE.html::https://discordapp.com/terms source = LICENSE.html::https://discordapp.com/terms
source = OSS-LICENSES.html::https://discordapp.com/licenses source = OSS-LICENSES.html::https://discordapp.com/licenses
sha512sums = 5b73f0f968ce61f5a844940e1525da80e7b2ce3779cf2050ca3c2b0b7dbee20f16e2bf203f0673d1e275d1e55075b83eb63700731be8324587b3c58c64d3a0e8 sha512sums = 720bc8a8b61cbbe3566c34065f9831571da121d210e3f2876c34cb964d60bab33f8dc16f7ca758e918cd8f35a69699c0b9063782e6c95087c0baa41a6d0e7cf5
sha512sums = 93418d8e40cab7ed25f6debc341294f76f90a4f879e158cfea418360c8705347653f60dbd6f18fb754448d299404bfa247b07625ae113e9386188d9f9485a14b
sha512sums = SKIP sha512sums = SKIP
sha512sums = SKIP sha512sums = SKIP

View file

@ -4,7 +4,7 @@
# Based off the discord community repo PKGBUILD by Filipe Laíns (FFY00) <lains@archlinux.org> # Based off the discord community repo PKGBUILD by Filipe Laíns (FFY00) <lains@archlinux.org>
pkgname=discord_arch_electron pkgname=discord_arch_electron
_pkgname=discord _pkgname=discord
pkgver=0.0.19 pkgver=0.0.20
pkgrel=1 pkgrel=1
pkgdesc="Discord (popular voice + video app) using the system provided electron for increased security and performance" pkgdesc="Discord (popular voice + video app) using the system provided electron for increased security and performance"
arch=('x86_64') arch=('x86_64')
@ -12,22 +12,22 @@ provides=('discord')
conflicts=('discord') conflicts=('discord')
url='https://discord.com' url='https://discord.com'
license=('custom') license=('custom')
depends=('electron16') depends=('electron19')
makedepends=('asar') makedepends=('asar')
optdepends=('libpulse: Pulseaudio support' optdepends=('libpulse: Pulseaudio support'
'xdg-utils: Open files') 'xdg-utils: Open files')
source=("https://dl.discordapp.net/apps/linux/$pkgver/$_pkgname-$pkgver.tar.gz" source=("https://dl.discordapp.net/apps/linux/$pkgver/$_pkgname-$pkgver.tar.gz"
'discord-launcher.sh'
'LICENSE.html::https://discordapp.com/terms' 'LICENSE.html::https://discordapp.com/terms'
'OSS-LICENSES.html::https://discordapp.com/licenses') 'OSS-LICENSES.html::https://discordapp.com/licenses')
sha512sums=('5b73f0f968ce61f5a844940e1525da80e7b2ce3779cf2050ca3c2b0b7dbee20f16e2bf203f0673d1e275d1e55075b83eb63700731be8324587b3c58c64d3a0e8' sha512sums=('720bc8a8b61cbbe3566c34065f9831571da121d210e3f2876c34cb964d60bab33f8dc16f7ca758e918cd8f35a69699c0b9063782e6c95087c0baa41a6d0e7cf5'
'93418d8e40cab7ed25f6debc341294f76f90a4f879e158cfea418360c8705347653f60dbd6f18fb754448d299404bfa247b07625ae113e9386188d9f9485a14b'
SKIP SKIP
SKIP) SKIP)
prepare() { prepare() {
cd Discord sed -i "s|@ELECTRON@|electron19|" discord-launcher.sh
sed -i "s|Exec=.*|Exec=/usr/bin/$_pkgname|" Discord/discord.desktop
sed -i "s|Exec=.*|Exec=/usr/bin/$_pkgname|" $_pkgname.desktop
echo 'Path=/usr/bin' >> $_pkgname.desktop
} }
package() { package() {
@ -39,18 +39,15 @@ package() {
rm Discord/resources/app.asar rm Discord/resources/app.asar
sed -i "s|process.resourcesPath|'/usr/lib/$_pkgname'|" Discord/resources/app/app_bootstrap/buildInfo.js sed -i "s|process.resourcesPath|'/usr/lib/$_pkgname'|" Discord/resources/app/app_bootstrap/buildInfo.js
sed -i "s|exeDir,|'/usr/share/pixmaps',|" Discord/resources/app/app_bootstrap/autoStart/linux.js sed -i "s|exeDir,|'/usr/share/pixmaps',|" Discord/resources/app/app_bootstrap/autoStart/linux.js
sed -i "s#^module\.paths.*;#module.paths = [(process.env.XDG_CONFIG_HOME || (process.env.HOME + \"/.config\")) + \"/discord/$pkgver/modules\"];#" Discord/resources/app/app_bootstrap/requireNative.js
asar p Discord/resources/app Discord/resources/app.asar --unpack-dir '**' asar p Discord/resources/app Discord/resources/app.asar --unpack-dir '**'
rm -rf Discord/resources/app rm -rf Discord/resources/app
# Copy Relevanat data # Copy Relevanat data
cp -r Discord/resources/* "$pkgdir"/usr/lib/$_pkgname/ cp -r Discord/resources/* "$pkgdir"/usr/lib/$_pkgname/
# Create starter script for discord
echo "#!/bin/sh" > "$srcdir"/$_pkgname
echo "exec electron16 /usr/lib/$_pkgname/app.asar \$@" >> "$srcdir"/$_pkgname
install -d "$pkgdir"/usr/{bin,share/{pixmaps,applications}} install -d "$pkgdir"/usr/{bin,share/{pixmaps,applications}}
install -Dm 755 $_pkgname "$pkgdir"/usr/bin/$_pkgname install -Dm 755 "${srcdir}/discord-launcher.sh" "${pkgdir}/usr/bin/${_pkgname}"
cp Discord/discord.png "$pkgdir"/usr/share/pixmaps/$_pkgname.png cp Discord/discord.png "$pkgdir"/usr/share/pixmaps/$_pkgname.png
cp Discord/discord.desktop "$pkgdir"/usr/share/applications/$_pkgname.desktop cp Discord/discord.desktop "$pkgdir"/usr/share/applications/$_pkgname.desktop

21
discord-launcher.sh Executable file
View file

@ -0,0 +1,21 @@
#!/usr/bin/bash
set -euo pipefail
name=discord
electron=@ELECTRON@
flags_file="${XDG_CONFIG_HOME:-$HOME/.config}/${name}-flags.conf"
declare -a flags
if [[ -f "${flags_file}" ]]; then
mapfile -t < "${flags_file}"
fi
for line in "${MAPFILE[@]}"; do
if [[ ! "${line}" =~ ^[[:space:]]*#.* ]]; then
flags+=("${line}")
fi
done
exec /usr/bin/${electron} /usr/lib/${name}/app.asar "${flags[@]}" "$@"