2020-08-06 19:54:48 +02:00
|
|
|
# Maintained by johnnyapol (arch@johnnyapol.me)
|
2020-11-19 15:29:58 +01:00
|
|
|
# Contributors: huyizheng
|
2020-05-20 01:50:18 +02:00
|
|
|
# Based off the discord community repo PKGBUILD by Filipe Laíns (FFY00) <lains@archlinux.org>
|
|
|
|
pkgname=discord_arch_electron
|
|
|
|
_pkgname=discord
|
2020-12-04 22:28:44 +01:00
|
|
|
pkgver=0.0.13
|
2021-02-26 03:02:18 +01:00
|
|
|
pkgrel=3
|
2020-08-06 19:54:48 +02:00
|
|
|
pkgdesc="Discord (popular voice + video app) using the system provided electron for increased security and performance"
|
2020-05-20 01:50:18 +02:00
|
|
|
arch=('x86_64')
|
2020-05-20 01:56:50 +02:00
|
|
|
provides=('discord')
|
2020-05-30 18:10:13 +02:00
|
|
|
conflicts=('discord')
|
2020-05-20 01:50:18 +02:00
|
|
|
url='https://discordapp.com'
|
|
|
|
license=('custom')
|
2021-02-26 03:02:18 +01:00
|
|
|
depends=('electron')
|
2020-11-19 15:29:58 +01:00
|
|
|
makedepends=('asar')
|
2020-05-20 01:50:18 +02:00
|
|
|
optdepends=('libpulse: Pulseaudio support'
|
|
|
|
'xdg-utils: Open files')
|
|
|
|
source=("https://dl.discordapp.net/apps/linux/$pkgver/$_pkgname-$pkgver.tar.gz"
|
|
|
|
'LICENSE.html::https://discordapp.com/terms'
|
|
|
|
'OSS-LICENSES.html::https://discordapp.com/licenses')
|
2020-12-04 22:28:44 +01:00
|
|
|
sha512sums=('6b3c4b69501a88e79723b91c07eabd61c66cb257b62c543b01a59b2dcf494de9c311fbf79fe4f159310be67920ac71a70aa313fc7c249c183756b09156135690'
|
2020-05-20 01:50:18 +02:00
|
|
|
SKIP
|
|
|
|
SKIP)
|
|
|
|
|
|
|
|
prepare() {
|
|
|
|
cd Discord
|
|
|
|
|
|
|
|
sed -i "s|Exec=.*|Exec=/usr/bin/$_pkgname|" $_pkgname.desktop
|
|
|
|
echo 'Path=/usr/bin' >> $_pkgname.desktop
|
|
|
|
}
|
|
|
|
|
|
|
|
package() {
|
|
|
|
# Install the app
|
2020-11-19 15:29:58 +01:00
|
|
|
install -d "$pkgdir"/usr/lib/$_pkgname
|
|
|
|
|
|
|
|
# HACKS FOR SYSTEM ELECTRON
|
|
|
|
asar e Discord/resources/app.asar Discord/resources/app
|
2020-12-04 22:28:44 +01:00
|
|
|
rm Discord/resources/app.asar
|
2020-11-19 15:29:58 +01:00
|
|
|
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
|
2020-12-04 22:28:44 +01:00
|
|
|
asar p Discord/resources/app Discord/resources/app.asar --unpack-dir '**'
|
|
|
|
rm -rf Discord/resources/app
|
2020-05-20 01:50:18 +02:00
|
|
|
|
|
|
|
# Copy Relevanat data
|
2020-11-19 15:29:58 +01:00
|
|
|
cp -r Discord/resources/* "$pkgdir"/usr/lib/$_pkgname/
|
2020-05-20 01:50:18 +02:00
|
|
|
|
|
|
|
# Create starter script for discord
|
2021-01-13 17:12:42 +01:00
|
|
|
echo "#!/bin/sh" > "$srcdir"/$_pkgname
|
2021-02-26 03:02:18 +01:00
|
|
|
echo "exec electron /usr/lib/$_pkgname/app.asar \$@" >> "$srcdir"/$_pkgname
|
2020-05-20 01:50:18 +02:00
|
|
|
|
|
|
|
install -d "$pkgdir"/usr/{bin,share/{pixmaps,applications}}
|
2020-11-19 15:29:58 +01:00
|
|
|
install -Dm 755 $_pkgname "$pkgdir"/usr/bin/$_pkgname
|
2020-05-30 18:10:13 +02:00
|
|
|
|
2020-11-19 15:29:58 +01:00
|
|
|
cp Discord/discord.png "$pkgdir"/usr/share/pixmaps/$_pkgname.png
|
|
|
|
cp Discord/discord.desktop "$pkgdir"/usr/share/applications/$_pkgname.desktop
|
2020-05-20 01:50:18 +02:00
|
|
|
|
|
|
|
# Licenses
|
|
|
|
install -Dm 644 LICENSE.html "$pkgdir"/usr/share/licenses/$pkgname/LICENSE.html
|
|
|
|
install -Dm 644 OSS-LICENSES.html "$pkgdir"/usr/share/licenses/$pkgname/OSS-LICENSES.html
|
2021-01-13 17:12:42 +01:00
|
|
|
}
|