Compare commits

...

41 commits

Author SHA1 Message Date
80976a162c upgpkg: discord-electron 0.0.52-1
upstream release
2024-04-30 18:45:00 +02:00
3a281d1825 upgpkg: discord-electron 0.0.51-1
upstream release
2024-04-23 06:55:37 +02:00
a2f1891c6b upgpkg: discord-electron 0.0.50-2: update electron
* Update Electron version to 30
2024-04-21 09:39:59 +02:00
1375d647a3 upgpkg: discord-electron 0.0.50-1
upstream release
2024-04-16 22:56:54 +02:00
ca015698fc upgpkg: discord-electron 0.0.49-2: fix error on launch
* Fix mistake when I moved asar into resources subfolder
2024-04-10 19:50:11 +02:00
324e43eb65 upgpkg: discord-electron 0.0.49-1
upstream release
2024-04-09 20:16:20 +02:00
70d7d062d3 upgpkg: discord-electron 0.0.48-2: update electron, mod compat
* Update Electron version to 29
* Move asar to resources subfolder for Discord client mod compatibility
2024-04-09 12:07:40 +02:00
0350ae8c2a upgpkg: discord-electron 0.0.48-1
upstream release
2024-04-08 20:50:38 +02:00
97dbd2e60b upgpkg: discord-electron 0.0.47-1
upstream release
2024-03-25 20:29:29 +01:00
777a3a85ee upgpkg: discord-electron 0.0.46-1
upstream release
2024-03-18 19:47:28 +01:00
5939db92e0 upgpkg: discord-electron 0.0.45-1
upstream release
2024-03-12 19:22:50 +01:00
1791100ce6 upgpkg: discord-electron 0.0.44-1
upstream release
2024-03-07 06:50:54 +01:00
803cfc282f upgpkg: discord-electron 0.0.43-1
upstream release
2024-02-12 23:30:37 +01:00
0efa91f6a1 upgpkg: discord-electron 0.0.42-2: update electron
* Patch app.asar to support Electron version 28
2024-02-11 06:22:39 +01:00
0e255cff13 upgpkg: discord-electron 0.0.42-1
upstream release
2024-01-29 21:34:18 +01:00
a0f532b74c upgpkg: discord-electron 0.0.41-1
upstream release
2024-01-23 21:03:56 +01:00
e0bdcd102a upgpkg: discord-electron 0.0.40-1
upstream release
2024-01-09 20:38:00 +01:00
fc4ccaec57 upgpkg: discord-electron 0.0.39-3: fix launcher
* Fix launcher error if config variable not set but rizin is installed
* Fix typo
2024-01-04 22:47:25 +01:00
e87075530d upgpkg: discord-electron 0.0.39-2: update electron
* Update Electron version to 27
* Update launch script to require config variable set in order to patch Krisp binary
2024-01-04 15:07:13 +01:00
f2b0a557e7 upgpkg: discord-electron 0.0.39-1
upstream release
2023-12-19 21:47:13 +01:00
bbb6ca0bb6 upgpkg: discord-electron 0.0.38-1
upstream release
2023-12-12 23:46:26 +01:00
9fe5631265 upgpkg: discord-electron 0.0.37-1
upstream release
2023-12-05 21:28:13 +01:00
fe6568de7c upgpkg: discord-electron 0.0.36-1
upstream release
2023-11-29 01:17:45 +01:00
ac2d35ef29 upgpkg: discord-electron 0.0.35-1
upstream release
2023-11-13 19:50:30 +01:00
939bda0224 upgpkg: discord-electron 0.0.34-2: fix autostart
* Fix autostart as suggested by @LRitzdorf
* Improve use of sed commands
* Directly execute electron binary
2023-11-09 16:57:04 +01:00
a1dffff277 upgpkg: discord-electron 0.0.34-1
upstream release
2023-11-07 00:09:09 +01:00
e6d87d913f upgpkg: discord-electron 0.0.33-1
upstream release
2023-10-31 18:51:45 +01:00
7f99746eb7 upgpkg: discord-electron 0.0.32-1
upstream release
2023-10-17 02:53:35 +02:00
de35c03252 upgpkg: discord-electron 0.0.31-1
upstream release
2023-10-05 22:29:25 +02:00
ab38230d80 upgpkg: discord-electron 0.0.30-1
upstream release
2023-09-18 23:29:20 +02:00
b7dfaeb935 upgpkg: discord-electron 0.0.29-2
Update Electron version to 24
Update Krisp patch
2023-08-30 23:55:45 +02:00
9f775b6cda upgpkg: discord-electron 0.0.29-1
upstream release
2023-08-30 19:22:50 +02:00
f5e1003ea2 upgpkg: discord-electron 0.0.28-1
upstream release
Refactor PKGBUILD slightly
Update Krisp checksum
Check for empty lines when parsing flags
2023-07-13 06:40:03 +02:00
7012eb2406 upgpkg: discord-electron 0.0.27-7
Update optdepends
2023-07-07 22:58:39 +02:00
88bec15b6b upgpkg: discord-electron 0.0.27-6
Fix use of wrong pkgver variable (Thanks to @rsa)
Unset not needed variables in launch script
Rewording install file text
2023-07-03 22:56:16 +02:00
9857039242 upgpkg: discord-electron 0.0.27-5
Include rudimentary patch to allow Krisp noise suppression support
2023-06-02 21:52:11 +02:00
70209e3d1e upgpkg: discord-electron 0.0.27-4
Update launch script to not touch the flags file with sed on no match
2023-05-28 23:55:25 +02:00
6e851da01b upgpkg: discord-electron 0.0.27-3
Fix whitespace indentation in install file
Replace ignore-gpu-blacklist with ignore-gpu-blocklist as the former does not work anymore
2023-05-27 21:55:10 +02:00
8e5c1e134d upgpkg: discord-electron 0.0.27-2
Update Discord launcher script (Original by Zoddo)
Add libxss as dependency to fix Discord corruption warning
Add install script to notify user about discord-flags.conf
Remove duplicate Path variable in .desktop file
Update contributor list
2023-05-27 20:10:10 +02:00
3a61d93bdc upgpkg: discord-electron 0.0.27-1
upstream release
2023-04-29 14:53:06 +02:00
cdb3c4c521 Rename package to discord-electron, PKGBUILD refactor 2023-04-03 08:32:00 +02:00
6 changed files with 167 additions and 70 deletions

View file

@ -1,27 +1,26 @@
pkgbase = discord-electron pkgbase = discord-electron
pkgdesc = All-in-one voice and text chat for gamers that's free and secure. pkgdesc = Discord using system provided electron (v30) for increased security and performance
pkgver = 0.0.15 pkgver = 0.0.52
pkgrel = 1 pkgrel = 1
url = https://discordapp.com url = https://discord.com
install = discord-electron.install
arch = x86_64 arch = x86_64
license = custom license = custom
makedepends = asar makedepends = asar
depends = electron makedepends = curl
depends = libnotify makedepends = python-html2text
depends = electron30
depends = libxss depends = libxss
depends = nspr
depends = nss
depends = gtk3
optdepends = libpulse: Pulseaudio support optdepends = libpulse: Pulseaudio support
optdepends = libappindicator-gtk3: Systray indicator support
optdepends = xdg-utils: Open files optdepends = xdg-utils: Open files
optdepends = rizin: Allow patching Krisp support
provides = discord
conflicts = discord conflicts = discord
source = https://dl.discordapp.net/apps/linux/0.0.15/discord-0.0.15.tar.gz options = !strip
source = discord.sh source = https://dl.discordapp.net/apps/linux/0.0.52/discord-0.0.52.tar.gz
source = LICENSE.html::https://discordapp.com/terms source = discord-launcher.sh
source = OSS-LICENSES.html::https://discordapp.com/licenses sha512sums = 42ff4b59a0dd846f06a297a1a8b5a1e28f37daa6951b4ce597d103492458c5ae90f69545908cd41238c5ed91b249ad2dd9b9cec3ef4feeb9ad22245c692eaa72
sha512sums = 4f220ecd0e0c9fcd793ed065055479391506d9401b75ca541cde4136d0290f2720fccca87139091faf269fdb2c020adb5b7333710a31ca603ce8552f3dd4841b sha512sums = 9d00f9d2e05c2ba31c930c066f247954700bb0f96f2fc605e61c3973d7dacf962bf372659b71e05e5d8d4e152cc884bf12ec1fb5ecbfc4da55d22ab2591c4c40
sha512sums = b5fe7bfd31ae1867f3392605bd52ac155c6c02c4a2a132419d9806c08e61715461818919c2e480ba8e7f14b51aefcd588dcaa247f15d24286e177e45f43e17f9
sha512sums = 6a2ebf7aadf06ba804c1c6f10677a014b2b9eb17a2bb34538426bf4c76686c4c11976bd682610965535f7a5d4a2f6b36dfa5aa875578defef1213ed866acb530
sha512sums = f6d46b7a2dd6c8475625a988f36419788ab90149317c9a4e5e8ffea8613f27d0746c1557467332770c033349abd370bf721990ecadc383b4aee63cb8b74a280c
pkgname = discord-electron pkgname = discord-electron

6
.gitignore vendored
View file

@ -1,6 +0,0 @@
pkg
src
*.tar.gz
*.pkg.tar.zst
LICENSE.html
OSS-LICENSES.html

121
PKGBUILD
View file

@ -1,65 +1,94 @@
# Maintainer: Dušan Simić <dusan.simic1810@gmail.com> # Maintainer: Manuel Hüsers <aur@huesers.de>
# Contributor: Zoddo <archlinux+aur@zoddo.fr>
# Contributor: Thaodan <AUR+me@thaodan.de>
# Contributor: Stick <stick@stma.is>
# Contributor: johnnyapol <arch@johnnyapol.me>
# Contributor: huyizheng <huyizheng@hotmail.com>
# Contributor: Filipe Laíns (FFY00) <lains@archlinux.org>
# Contributor: Morgan <morganamilo@archlinux.org>
# Based off the discord_arch_electron_wayland PKGBUILD from Stick
# Based off the discord_arch_electron PKGBUILD from johnnyapol, huyizheng, Thaodan and Zoddo
# Based off the discord community repo PKGBUILD by Filipe Laíns (FFY00)
_electron=electron
pkgname=discord-electron pkgname=discord-electron
_pkgname=discord _pkgname=discord
_Pkgname=Discord pkgver=0.0.52
pkgver=0.0.15
pkgrel=1 pkgrel=1
pkgdesc="All-in-one voice and text chat for gamers that's free and secure." _electronver=30
_electronname="electron${_electronver}"
pkgdesc="Discord using system provided electron (v${_electronver}) for increased security and performance"
arch=('x86_64') arch=('x86_64')
url='https://discordapp.com' provides=("${_pkgname}")
conflicts=("${_pkgname}")
url='https://discord.com'
license=('custom') license=('custom')
depends=("$_electron" 'libnotify' 'libxss' 'nspr' 'nss' 'gtk3') options=('!strip')
makedepends=('asar') install="$pkgname.install"
optdepends=('libpulse: Pulseaudio support' depends=("${_electronname}" 'libxss')
'xdg-utils: Open files') makedepends=('asar' 'curl' 'python-html2text')
conflicts=(discord) optdepends=(
source=("https://dl.discordapp.net/apps/linux/$pkgver/$_pkgname-$pkgver.tar.gz" 'libpulse: Pulseaudio support'
'discord.sh' 'libappindicator-gtk3: Systray indicator support'
'LICENSE.html::https://discordapp.com/terms' 'xdg-utils: Open files'
'OSS-LICENSES.html::https://discordapp.com/licenses') 'rizin: Allow patching Krisp support'
sha512sums=('4f220ecd0e0c9fcd793ed065055479391506d9401b75ca541cde4136d0290f2720fccca87139091faf269fdb2c020adb5b7333710a31ca603ce8552f3dd4841b' )
'b5fe7bfd31ae1867f3392605bd52ac155c6c02c4a2a132419d9806c08e61715461818919c2e480ba8e7f14b51aefcd588dcaa247f15d24286e177e45f43e17f9' source=("https://dl.discordapp.net/apps/linux/${pkgver}/${_pkgname}-${pkgver}.tar.gz"
'6a2ebf7aadf06ba804c1c6f10677a014b2b9eb17a2bb34538426bf4c76686c4c11976bd682610965535f7a5d4a2f6b36dfa5aa875578defef1213ed866acb530' 'discord-launcher.sh')
'f6d46b7a2dd6c8475625a988f36419788ab90149317c9a4e5e8ffea8613f27d0746c1557467332770c033349abd370bf721990ecadc383b4aee63cb8b74a280c') sha512sums=('42ff4b59a0dd846f06a297a1a8b5a1e28f37daa6951b4ce597d103492458c5ae90f69545908cd41238c5ed91b249ad2dd9b9cec3ef4feeb9ad22245c692eaa72'
'9d00f9d2e05c2ba31c930c066f247954700bb0f96f2fc605e61c3973d7dacf962bf372659b71e05e5d8d4e152cc884bf12ec1fb5ecbfc4da55d22ab2591c4c40')
_krisp_b2sum='ef14b1dc86613fdac87e3cd975f020192d9fd4dd5a88e685c3edbb245e343924c75179acb7724d81ae3e5b0b7b5f52d208f3f1a9b1ccd73a7fe06e96662c4e81'
prepare() { prepare() {
cd "$_Pkgname" # prepare launcher script
sed -i -e "s|@PKGNAME@|${_pkgname}|g" \
-e "s|@PKGVER@|${pkgver}|g" \
-e "s|@ELECTRON@|${_electronname}|g" \
-e "s|@KRISPB2@|${_krisp_b2sum}|g" \
discord-launcher.sh
# Change exec entry for desktop file # fix the .desktop file
sed -i "s|Exec=.*|Exec=/usr/bin/$_pkgname|" "$_pkgname.desktop" sed -i -e "s|Exec=.*|Exec=/usr/bin/${_pkgname}|" ${_pkgname^}/$_pkgname.desktop
sed -i "s|Icon=.*|Icon=$pkgname|" "$_pkgname.desktop"
echo 'Path=/usr/bin' >> "$_pkgname.desktop"
# Change resource path in asar archive # create the license files
asar extract resources/app.asar resources/app.asar.dest curl https://discord.com/terms | html2text >"${srcdir}"/LICENSE.md
sed -i "s|process\.resourcesPath|'/', 'opt', '$pkgname'|" resources/app.asar.dest/app_bootstrap/buildInfo.js curl https://discord.com/licenses | html2text >"${srcdir}"/OSS-LICENSES.md
asar pack resources/app.asar.dest resources/app.asar }
# Cleanup unpacked files
rm -r resources/app.asar.dest
cd "$srcdir" build() {
cd "${srcdir}"/${_pkgname^}
# Set electron version in startup script # use system electron
sed -i "s|@ELECTRON@|$_electron|" "$_pkgname.sh" asar e resources/app.asar resources/app
rm resources/app.asar
sed -i -e "/resourcesPath = .*;$/d" -e "s|return resourcesPath|return '/usr/lib/${_pkgname}/resources'|" resources/app/common/paths.js
sed -i -e "s|process.resourcesPath|'/usr/lib/${_pkgname}/resources'|" resources/app/app_bootstrap/buildInfo.js
sed -i -e "/^const appName/d" -e "/^const exePath/d" -e "/^const exeDir/d" -e "/^const iconPath/d" \
-e "s|^Exec=\${exePath}$|Exec=/usr/bin/${_pkgname}|" \
-e "s|^Name=\${appName}$|Name=${_pkgname^}|" \
-e "s|^Icon=\${iconPath}$|Icon=/usr/share/pixmaps/${_pkgname}.png|" \
resources/app/app_bootstrap/autoStart/linux.js
asar p resources/app resources/app.asar
rm -rf resources/app
} }
package() { package() {
# Install the app # create necessary directories
install -d "$pkgdir/opt/$pkgname" install -d "${pkgdir}"/usr/{lib/$_pkgname,bin}
cp -a "$_Pkgname/resources/." "$pkgdir/opt/$pkgname" install -d "${pkgdir}"/usr/share/{pixmaps,applications,licenses/$_pkgname}
# Install startup script # copy relevant data
install -Dm755 "$_pkgname.sh" "$pkgdir/usr/bin/$pkgname" cp -r ${_pkgname^}/resources "${pkgdir}"/usr/lib/$_pkgname/
ln -s "/usr/bin/$pkgname" "$pkgdir/usr/bin/$_pkgname" cp ${_pkgname^}/$_pkgname.png \
"${pkgdir}"/usr/share/pixmaps/$_pkgname.png
cp ${_pkgname^}/$_pkgname.desktop \
"${pkgdir}"/usr/share/applications/$_pkgname.desktop
# Install icon and desktop file # install the launch script
install -Dm644 "$_Pkgname/$_pkgname.png" "$pkgdir/usr/share/pixmaps/$pkgname.png" install -Dm 755 discord-launcher.sh "${pkgdir}"/usr/bin/$_pkgname
install -Dm644 "$_Pkgname/$_pkgname.desktop" "$pkgdir/usr/share/applications/$pkgname.desktop"
# Licenses # install licenses
install -Dm644 LICENSE.html "$pkgdir/usr/share/licenses/$pkgname/LICENSE.html" install -Dm 644 LICENSE.md "${pkgdir}"/usr/share/licenses/$_pkgname/
install -Dm644 OSS-LICENSES.html "$pkgdir/usr/share/licenses/$pkgname/OSS-LICENSES.html" install -Dm 644 OSS-LICENSES.md "${pkgdir}"/usr/share/licenses/$_pkgname/
} }

35
discord-electron.install Normal file
View file

@ -0,0 +1,35 @@
post_upgrade() {
# return if old package version is greater than or equal to 0.0.39-2...
(( $(vercmp $2 '0.0.39-2') >= 0 )) && return
cat <<EOF
==> In order to patch Krisp noise suppression support set 'PATCH_KRISP=true'
in '~/.config/discord.conf' in addition to having 'rizin' installed.
EOF
# return if old package version is greater than or equal to 0.0.27-5...
(( $(vercmp $2 '0.0.27-5') >= 0 )) && return
cat <<EOF
==> The launch script will now patch Krisp noise suppression support
if 'rizin' is installed. Restart your Discord client after update
to apply the patch.
EOF
# return if old package version is greater than or equal to 0.0.27-2...
(( $(vercmp $2 '0.0.27-2') >= 0 )) && return
cat <<EOF
==> You can now set additional Electron flags in '~/.config/discord-flags.conf'.
EOF
}
post_install() {
cat <<EOF
==> For Krisp noise suppression support consider installing 'rizin' and
setting 'PATCH_KRISP=true' in '~/.config/discord.conf'. Restart your
Discord client afterwards to apply the patch.
==> In case of performance problems consider setting additional flags
in '~/.config/discord-flags.conf'.
EOF
}

42
discord-launcher.sh Normal file
View file

@ -0,0 +1,42 @@
#!/usr/bin/env bash
set -eo pipefail
declare -a flags
[[ -r "${XDG_CONFIG_HOME:-$HOME/.config}/@PKGNAME@.conf" ]] && source "${XDG_CONFIG_HOME:-$HOME/.config}/@PKGNAME@.conf"
flags_file="${XDG_CONFIG_HOME:-$HOME/.config}/@PKGNAME@-flags.conf"
krisp_bin="${XDG_CONFIG_HOME:-$HOME/.config}/@PKGNAME@/@PKGVER@/modules/@PKGNAME@_krisp/@PKGNAME@_krisp.node"
krisp_b2=@KRISPB2@
if hash rizin &> /dev/null && [[ "${PATCH_KRISP}" == true ]]; then
# Patch Krisp binary to ignore signature check
if [[ -w "${krisp_bin}" && $(b2sum "${krisp_bin}" | head -c 128) == $krisp_b2 ]]; then
addr=$(rz-find -x '4881ec00010000' "${krisp_bin}" | head -n1)
rizin -q -w -c "s $addr + 0x30 ; wao nop" "${krisp_bin}" &> /dev/null
fi
fi
if [[ -r "${flags_file}" ]]; then
# Replacing because old flag does not work
if [[ -w "${flags_file}" ]] && grep -q '\--ignore-gpu-blacklist' "${flags_file}"; then
sed -i "s|--ignore-gpu-blacklist|--ignore-gpu-blocklist|" "${flags_file}"
fi
mapfile -t < "${flags_file}"
fi
for line in "${MAPFILE[@]}"; do
if [[ ! "${line}" =~ ^[[:space:]]*#.* ]] && [[ -n "${line}" ]]; then
flags+=("${line}")
fi
done
unset flags_file krisp_bin krisp_b2
exec /usr/lib/@ELECTRON@/electron \
/usr/lib/@PKGNAME@/resources/app.asar \
--ozone-platform-hint=auto \
"${flags[@]}" "$@"

View file

@ -1,2 +0,0 @@
#!/bin/sh
exec @ELECTRON@ /opt/discord-electron/app.asar --disable-dev-mode "$@"