Compare commits
41 commits
main
...
packages/d
Author | SHA1 | Date | |
---|---|---|---|
80976a162c | |||
3a281d1825 | |||
a2f1891c6b | |||
1375d647a3 | |||
ca015698fc | |||
324e43eb65 | |||
70d7d062d3 | |||
0350ae8c2a | |||
97dbd2e60b | |||
777a3a85ee | |||
5939db92e0 | |||
1791100ce6 | |||
803cfc282f | |||
0efa91f6a1 | |||
0e255cff13 | |||
a0f532b74c | |||
e0bdcd102a | |||
fc4ccaec57 | |||
e87075530d | |||
f2b0a557e7 | |||
bbb6ca0bb6 | |||
9fe5631265 | |||
fe6568de7c | |||
ac2d35ef29 | |||
939bda0224 | |||
a1dffff277 | |||
e6d87d913f | |||
7f99746eb7 | |||
de35c03252 | |||
ab38230d80 | |||
b7dfaeb935 | |||
9f775b6cda | |||
f5e1003ea2 | |||
7012eb2406 | |||
88bec15b6b | |||
9857039242 | |||
70209e3d1e | |||
6e851da01b | |||
8e5c1e134d | |||
3a61d93bdc | |||
cdb3c4c521 |
6 changed files with 167 additions and 70 deletions
31
.SRCINFO
31
.SRCINFO
|
@ -1,27 +1,26 @@
|
|||
pkgbase = discord-electron
|
||||
pkgdesc = All-in-one voice and text chat for gamers that's free and secure.
|
||||
pkgver = 0.0.15
|
||||
pkgdesc = Discord using system provided electron (v30) for increased security and performance
|
||||
pkgver = 0.0.52
|
||||
pkgrel = 1
|
||||
url = https://discordapp.com
|
||||
url = https://discord.com
|
||||
install = discord-electron.install
|
||||
arch = x86_64
|
||||
license = custom
|
||||
makedepends = asar
|
||||
depends = electron
|
||||
depends = libnotify
|
||||
makedepends = curl
|
||||
makedepends = python-html2text
|
||||
depends = electron30
|
||||
depends = libxss
|
||||
depends = nspr
|
||||
depends = nss
|
||||
depends = gtk3
|
||||
optdepends = libpulse: Pulseaudio support
|
||||
optdepends = libappindicator-gtk3: Systray indicator support
|
||||
optdepends = xdg-utils: Open files
|
||||
optdepends = rizin: Allow patching Krisp support
|
||||
provides = discord
|
||||
conflicts = discord
|
||||
source = https://dl.discordapp.net/apps/linux/0.0.15/discord-0.0.15.tar.gz
|
||||
source = discord.sh
|
||||
source = LICENSE.html::https://discordapp.com/terms
|
||||
source = OSS-LICENSES.html::https://discordapp.com/licenses
|
||||
sha512sums = 4f220ecd0e0c9fcd793ed065055479391506d9401b75ca541cde4136d0290f2720fccca87139091faf269fdb2c020adb5b7333710a31ca603ce8552f3dd4841b
|
||||
sha512sums = b5fe7bfd31ae1867f3392605bd52ac155c6c02c4a2a132419d9806c08e61715461818919c2e480ba8e7f14b51aefcd588dcaa247f15d24286e177e45f43e17f9
|
||||
sha512sums = 6a2ebf7aadf06ba804c1c6f10677a014b2b9eb17a2bb34538426bf4c76686c4c11976bd682610965535f7a5d4a2f6b36dfa5aa875578defef1213ed866acb530
|
||||
sha512sums = f6d46b7a2dd6c8475625a988f36419788ab90149317c9a4e5e8ffea8613f27d0746c1557467332770c033349abd370bf721990ecadc383b4aee63cb8b74a280c
|
||||
options = !strip
|
||||
source = https://dl.discordapp.net/apps/linux/0.0.52/discord-0.0.52.tar.gz
|
||||
source = discord-launcher.sh
|
||||
sha512sums = 42ff4b59a0dd846f06a297a1a8b5a1e28f37daa6951b4ce597d103492458c5ae90f69545908cd41238c5ed91b249ad2dd9b9cec3ef4feeb9ad22245c692eaa72
|
||||
sha512sums = 9d00f9d2e05c2ba31c930c066f247954700bb0f96f2fc605e61c3973d7dacf962bf372659b71e05e5d8d4e152cc884bf12ec1fb5ecbfc4da55d22ab2591c4c40
|
||||
|
||||
pkgname = discord-electron
|
||||
|
|
6
.gitignore
vendored
6
.gitignore
vendored
|
@ -1,6 +0,0 @@
|
|||
pkg
|
||||
src
|
||||
*.tar.gz
|
||||
*.pkg.tar.zst
|
||||
LICENSE.html
|
||||
OSS-LICENSES.html
|
121
PKGBUILD
121
PKGBUILD
|
@ -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
|
||||
_Pkgname=Discord
|
||||
pkgver=0.0.15
|
||||
pkgver=0.0.52
|
||||
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')
|
||||
url='https://discordapp.com'
|
||||
provides=("${_pkgname}")
|
||||
conflicts=("${_pkgname}")
|
||||
url='https://discord.com'
|
||||
license=('custom')
|
||||
depends=("$_electron" 'libnotify' 'libxss' 'nspr' 'nss' 'gtk3')
|
||||
makedepends=('asar')
|
||||
optdepends=('libpulse: Pulseaudio support'
|
||||
'xdg-utils: Open files')
|
||||
conflicts=(discord)
|
||||
source=("https://dl.discordapp.net/apps/linux/$pkgver/$_pkgname-$pkgver.tar.gz"
|
||||
'discord.sh'
|
||||
'LICENSE.html::https://discordapp.com/terms'
|
||||
'OSS-LICENSES.html::https://discordapp.com/licenses')
|
||||
sha512sums=('4f220ecd0e0c9fcd793ed065055479391506d9401b75ca541cde4136d0290f2720fccca87139091faf269fdb2c020adb5b7333710a31ca603ce8552f3dd4841b'
|
||||
'b5fe7bfd31ae1867f3392605bd52ac155c6c02c4a2a132419d9806c08e61715461818919c2e480ba8e7f14b51aefcd588dcaa247f15d24286e177e45f43e17f9'
|
||||
'6a2ebf7aadf06ba804c1c6f10677a014b2b9eb17a2bb34538426bf4c76686c4c11976bd682610965535f7a5d4a2f6b36dfa5aa875578defef1213ed866acb530'
|
||||
'f6d46b7a2dd6c8475625a988f36419788ab90149317c9a4e5e8ffea8613f27d0746c1557467332770c033349abd370bf721990ecadc383b4aee63cb8b74a280c')
|
||||
options=('!strip')
|
||||
install="$pkgname.install"
|
||||
depends=("${_electronname}" 'libxss')
|
||||
makedepends=('asar' 'curl' 'python-html2text')
|
||||
optdepends=(
|
||||
'libpulse: Pulseaudio support'
|
||||
'libappindicator-gtk3: Systray indicator support'
|
||||
'xdg-utils: Open files'
|
||||
'rizin: Allow patching Krisp support'
|
||||
)
|
||||
source=("https://dl.discordapp.net/apps/linux/${pkgver}/${_pkgname}-${pkgver}.tar.gz"
|
||||
'discord-launcher.sh')
|
||||
sha512sums=('42ff4b59a0dd846f06a297a1a8b5a1e28f37daa6951b4ce597d103492458c5ae90f69545908cd41238c5ed91b249ad2dd9b9cec3ef4feeb9ad22245c692eaa72'
|
||||
'9d00f9d2e05c2ba31c930c066f247954700bb0f96f2fc605e61c3973d7dacf962bf372659b71e05e5d8d4e152cc884bf12ec1fb5ecbfc4da55d22ab2591c4c40')
|
||||
|
||||
_krisp_b2sum='ef14b1dc86613fdac87e3cd975f020192d9fd4dd5a88e685c3edbb245e343924c75179acb7724d81ae3e5b0b7b5f52d208f3f1a9b1ccd73a7fe06e96662c4e81'
|
||||
|
||||
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
|
||||
sed -i "s|Exec=.*|Exec=/usr/bin/$_pkgname|" "$_pkgname.desktop"
|
||||
sed -i "s|Icon=.*|Icon=$pkgname|" "$_pkgname.desktop"
|
||||
echo 'Path=/usr/bin' >> "$_pkgname.desktop"
|
||||
# fix the .desktop file
|
||||
sed -i -e "s|Exec=.*|Exec=/usr/bin/${_pkgname}|" ${_pkgname^}/$_pkgname.desktop
|
||||
|
||||
# Change resource path in asar archive
|
||||
asar extract resources/app.asar resources/app.asar.dest
|
||||
sed -i "s|process\.resourcesPath|'/', 'opt', '$pkgname'|" resources/app.asar.dest/app_bootstrap/buildInfo.js
|
||||
asar pack resources/app.asar.dest resources/app.asar
|
||||
# Cleanup unpacked files
|
||||
rm -r resources/app.asar.dest
|
||||
# create the license files
|
||||
curl https://discord.com/terms | html2text >"${srcdir}"/LICENSE.md
|
||||
curl https://discord.com/licenses | html2text >"${srcdir}"/OSS-LICENSES.md
|
||||
}
|
||||
|
||||
cd "$srcdir"
|
||||
build() {
|
||||
cd "${srcdir}"/${_pkgname^}
|
||||
|
||||
# Set electron version in startup script
|
||||
sed -i "s|@ELECTRON@|$_electron|" "$_pkgname.sh"
|
||||
# use system electron
|
||||
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() {
|
||||
# Install the app
|
||||
install -d "$pkgdir/opt/$pkgname"
|
||||
cp -a "$_Pkgname/resources/." "$pkgdir/opt/$pkgname"
|
||||
# create necessary directories
|
||||
install -d "${pkgdir}"/usr/{lib/$_pkgname,bin}
|
||||
install -d "${pkgdir}"/usr/share/{pixmaps,applications,licenses/$_pkgname}
|
||||
|
||||
# Install startup script
|
||||
install -Dm755 "$_pkgname.sh" "$pkgdir/usr/bin/$pkgname"
|
||||
ln -s "/usr/bin/$pkgname" "$pkgdir/usr/bin/$_pkgname"
|
||||
# copy relevant data
|
||||
cp -r ${_pkgname^}/resources "${pkgdir}"/usr/lib/$_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 -Dm644 "$_Pkgname/$_pkgname.png" "$pkgdir/usr/share/pixmaps/$pkgname.png"
|
||||
install -Dm644 "$_Pkgname/$_pkgname.desktop" "$pkgdir/usr/share/applications/$pkgname.desktop"
|
||||
# install the launch script
|
||||
install -Dm 755 discord-launcher.sh "${pkgdir}"/usr/bin/$_pkgname
|
||||
|
||||
# Licenses
|
||||
install -Dm644 LICENSE.html "$pkgdir/usr/share/licenses/$pkgname/LICENSE.html"
|
||||
install -Dm644 OSS-LICENSES.html "$pkgdir/usr/share/licenses/$pkgname/OSS-LICENSES.html"
|
||||
# install licenses
|
||||
install -Dm 644 LICENSE.md "${pkgdir}"/usr/share/licenses/$_pkgname/
|
||||
install -Dm 644 OSS-LICENSES.md "${pkgdir}"/usr/share/licenses/$_pkgname/
|
||||
}
|
||||
|
||||
|
|
35
discord-electron.install
Normal file
35
discord-electron.install
Normal 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
42
discord-launcher.sh
Normal 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[@]}" "$@"
|
|
@ -1,2 +0,0 @@
|
|||
#!/bin/sh
|
||||
exec @ELECTRON@ /opt/discord-electron/app.asar --disable-dev-mode "$@"
|
Loading…
Reference in a new issue