arch-packages/PKGBUILD

61 lines
2.6 KiB
Text
Raw Normal View History

2022-06-08 21:02:54 +02:00
# Maintainer: Zoddo <archlinux+aur@zoddo.fr>
# Contributor: Thaodan <AUR+me@thaodan.de>
2022-06-08 21:02:54 +02:00
# Contributor: huyizheng
# Contributor: johnnyapol <arch@johnnyapol.me>
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
_electron=electron29
pkgname=${_pkgname}_arch_electron
2024-04-09 20:36:33 +02:00
pkgver=0.0.49
pkgrel=2
2020-08-06 19:54:48 +02:00
pkgdesc="Discord (popular voice + video app) using the system provided electron for increased security and performance"
2023-10-17 18:44:23 +02:00
arch=('any')
provides=("${_pkgname}")
conflicts=("${_pkgname}")
2022-06-08 21:02:54 +02:00
url='https://discord.com'
2020-05-20 01:50:18 +02:00
license=('custom')
options=(!strip)
depends=("${_electron}" 'libxss')
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"
'discord-launcher.sh'
'LICENSE.html::https://discord.com/terms'
'OSS-LICENSES.html::https://discord.com/licenses')
2024-04-09 20:36:33 +02:00
sha512sums=('b8b1509c31e4c237255d678bbc3e8c4d0cd8b3731050b732e149399f8dda8abb12a46ad9ea3e718016f430ebfe17f88629d0964fe1266efe8b4cd20a2f9abbce'
2023-10-17 18:44:23 +02:00
'd398351b209cd89432d8e9cebe9122f152484236d8ca4dd91e5679d3853fe2f082625d35a9ac3f450f1f08250736bf3a23db9926311e8271730d884b57d12dbc'
2022-06-08 21:02:54 +02:00
SKIP
SKIP)
2020-05-20 01:50:18 +02:00
prepare() {
2022-12-10 12:07:22 +01:00
sed -i "s|@PKGNAME@|${_pkgname}|;s|@ELECTRON@|${_electron}|" discord-launcher.sh
sed -i "s|Exec=.*|Exec=/usr/bin/$_pkgname|" Discord/discord.desktop
# 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
2023-10-17 18:44:23 +02:00
sed -i "s|process.resourcesPath|'/usr/share/${_pkgname}/resources'|" Discord/resources/app/app_bootstrap/buildInfo.js
sed -i "s|exeDir,|'/usr/share/pixmaps',|" Discord/resources/app/app_bootstrap/autoStart/linux.js
sed -i -E "s|resourcesPath = _path.+;|resourcesPath = '/usr/share/${_pkgname}/resources';|" Discord/resources/app/common/paths.js
asar p Discord/resources/app Discord/resources/app.asar
2020-12-04 22:28:44 +01:00
rm -rf Discord/resources/app
2023-04-27 20:14:03 +02:00
}
package() {
# Install the app
2023-10-17 18:44:23 +02:00
install -d "${pkgdir}/usr/share/${_pkgname}/resources"
2020-05-20 01:50:18 +02:00
# Copy Relevanat data
2023-10-17 18:44:23 +02:00
cp -r Discord/resources/* "${pkgdir}/usr/share/${_pkgname}/resources/"
2020-05-20 01:50:18 +02:00
install -Dm 755 "${srcdir}/discord-launcher.sh" "${pkgdir}/usr/bin/${_pkgname}"
2020-05-30 18:10:13 +02:00
2023-10-17 18:44:23 +02:00
install -Dm 644 Discord/discord.png "${pkgdir}/usr/share/pixmaps/${_pkgname}.png"
install -Dm 644 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
}