2021-05-25 08:58:51 +00:00
|
|
|
# Maintainer: Knut Ahlers <knut at ahlers dot me>
|
2023-04-16 15:19:34 +00:00
|
|
|
# Contributor: Manuel Hüsers <aur@huesers.de>
|
|
|
|
# Contributor: Stick <stick@stma.is>
|
|
|
|
# Contributor: johnnyapol <arch@johnnyapol.me>
|
|
|
|
# Contributor: huyizheng <huyizheng@hotmail.com>
|
2021-05-25 08:58:51 +00:00
|
|
|
# Contributor: Filipe Laíns (FFY00) <lains@archlinux.org>
|
2023-04-16 15:19:34 +00:00
|
|
|
# Contributor: Morgan <morganamilo@archlinux.org>
|
|
|
|
|
|
|
|
# Based off the discord_arch_electron_wayland PKGBUILD from Stick
|
|
|
|
# Based off the discord_arch_electron PKGBUILD from johnnyapol and huyizheng
|
|
|
|
# Based off the discord community repo PKGBUILD by Filipe Laíns (FFY00)
|
2021-05-25 08:58:51 +00:00
|
|
|
|
|
|
|
pkgname=discord
|
2023-04-16 15:19:34 +00:00
|
|
|
_pkgname=discord
|
2024-04-30 10:17:36 +00:00
|
|
|
_electron=29
|
|
|
|
pkgver=0.0.52
|
2021-05-25 08:58:51 +00:00
|
|
|
pkgrel=1
|
2023-04-16 15:19:34 +00:00
|
|
|
pkgdesc="Discord using system provided electron (v${_electron}) for increased security and performance"
|
2021-05-25 08:58:51 +00:00
|
|
|
arch=('x86_64')
|
2023-04-16 15:19:34 +00:00
|
|
|
provides=("${_pkgname}")
|
|
|
|
conflicts=("${_pkgname}")
|
|
|
|
url='https://discord.com'
|
2021-05-25 08:58:51 +00:00
|
|
|
license=('custom')
|
2023-04-16 15:19:34 +00:00
|
|
|
options=('!strip')
|
|
|
|
depends=("electron${_electron}" 'libnotify' 'libxss' 'nspr' 'nss' 'gtk3')
|
2024-04-30 10:17:36 +00:00
|
|
|
makedepends=('asar')
|
2023-04-16 15:19:34 +00:00
|
|
|
optdepends=(
|
|
|
|
'libpulse: Pulseaudio support'
|
|
|
|
'xdg-utils: Open files'
|
|
|
|
)
|
2024-04-30 10:17:36 +00:00
|
|
|
source=(
|
|
|
|
"https://dl.discordapp.net/apps/linux/${pkgver}/discord-${pkgver}.tar.gz"
|
|
|
|
'discord-launcher.sh'
|
|
|
|
'LICENSE.html::https://discord.com/terms'
|
|
|
|
'OSS-LICENSES.html::https://discord.com/licenses'
|
|
|
|
)
|
2024-04-30 11:25:47 +00:00
|
|
|
sha512sums=('42ff4b59a0dd846f06a297a1a8b5a1e28f37daa6951b4ce597d103492458c5ae90f69545908cd41238c5ed91b249ad2dd9b9cec3ef4feeb9ad22245c692eaa72'
|
|
|
|
'140b8fd340caf1069fcde0d23c8058488a59518b0b55db70290bd2c50b6c3c1c28978fe7d3a6e8feff65cec990f41e34cf68876acfc0183c51f6a58e9f8cb668'
|
|
|
|
'SKIP'
|
|
|
|
'SKIP')
|
2021-05-25 08:58:51 +00:00
|
|
|
|
|
|
|
prepare() {
|
2023-04-16 15:19:34 +00:00
|
|
|
# fix the .desktop file
|
|
|
|
sed -i "s|Exec=.*|Exec=/usr/bin/${_pkgname}|" Discord/$_pkgname.desktop
|
|
|
|
echo 'Path=/usr/bin' >>Discord/$_pkgname.desktop
|
|
|
|
|
2024-04-30 10:17:36 +00:00
|
|
|
# patch launcher electron version
|
|
|
|
sed -i "s|@ELECTRON_VER@|${_electron}|" discord-launcher.sh
|
2023-04-16 15:19:34 +00:00
|
|
|
|
|
|
|
cd "${srcdir}/Discord"
|
2021-05-25 08:58:51 +00:00
|
|
|
|
2023-04-16 15:19:34 +00:00
|
|
|
# use system electron
|
|
|
|
asar e resources/app.asar resources/app
|
|
|
|
rm resources/app.asar
|
2024-04-30 10:17:36 +00:00
|
|
|
sed -i "s|process.resourcesPath|'/usr/share/${_pkgname}/resources'|" resources/app/app_bootstrap/buildInfo.js
|
2023-04-16 15:19:34 +00:00
|
|
|
sed -i "s|exeDir,|'/usr/share/pixmaps',|" resources/app/app_bootstrap/autoStart/linux.js
|
2024-04-30 10:17:36 +00:00
|
|
|
sed -i -E "s|resourcesPath = _path.+;|resourcesPath = '/usr/share/${_pkgname}/resources';|" resources/app/common/paths.js
|
2023-04-16 15:19:34 +00:00
|
|
|
asar p resources/app resources/app.asar
|
|
|
|
rm -rf resources/app
|
2024-04-30 10:17:36 +00:00
|
|
|
}
|
2021-05-25 08:58:51 +00:00
|
|
|
|
2024-04-30 10:17:36 +00:00
|
|
|
package() {
|
|
|
|
# install the launch script
|
|
|
|
install -Dm 755 discord-launcher.sh "${pkgdir}/usr/bin/${_pkgname}"
|
2021-05-25 08:58:51 +00:00
|
|
|
|
2024-04-30 10:17:36 +00:00
|
|
|
# copy resources into patched path
|
|
|
|
install -d "${pkgdir}/usr/share/${_pkgname}/resources"
|
|
|
|
cp -r Discord/resources/* "${pkgdir}/usr/share/${_pkgname}/resources/"
|
2021-05-25 08:58:51 +00:00
|
|
|
|
2024-04-30 10:17:36 +00:00
|
|
|
install -Dm 644 Discord/$_pkgname.png "${pkgdir}/usr/share/pixmaps/${_pkgname}.png"
|
|
|
|
install -Dm 644 Discord/$_pkgname.desktop "${pkgdir}/usr/share/applications/${_pkgname}.desktop"
|
2021-05-25 08:58:51 +00:00
|
|
|
|
2023-04-16 15:19:34 +00:00
|
|
|
# install licenses
|
2024-04-30 10:17:36 +00:00
|
|
|
install -Dm 644 -t "${pkgdir}/usr/share/licenses/${_pkgname}" LICENSE.html OSS-LICENSES.html
|
2021-05-25 08:58:51 +00:00
|
|
|
}
|