2023-04-03 08:35:46 +02:00
|
|
|
# Maintainer: Manuel Hüsers <aur@huesers.de>
|
|
|
|
|
|
|
|
# Based off the discord_arch_electron_wayland PKGBUILD from Stick
|
2023-05-27 20:10:31 +02:00
|
|
|
# Based off the discord_arch_electron PKGBUILD from johnnyapol, huyizheng, Thaodan and Zoddo
|
2023-04-03 08:35:46 +02:00
|
|
|
# Based off the discord community repo PKGBUILD by Filipe Laíns (FFY00)
|
|
|
|
|
|
|
|
pkgname=discord-electron-openasar
|
|
|
|
_pkgname=discord
|
2023-04-17 22:30:04 +02:00
|
|
|
_electron=22
|
2023-07-13 06:40:55 +02:00
|
|
|
pkgver=0.0.28+811
|
2023-04-03 08:35:46 +02:00
|
|
|
_pkgver=${pkgver%%+*}
|
2023-06-08 21:56:34 +02:00
|
|
|
pkgrel=1
|
2023-04-03 08:35:46 +02:00
|
|
|
pkgdesc="Discord packaged with OpenAsar using system provided electron (v${_electron}) for increased security and performance"
|
|
|
|
arch=('x86_64')
|
|
|
|
provides=("${_pkgname}")
|
|
|
|
conflicts=("${_pkgname}")
|
|
|
|
url='https://discord.com'
|
|
|
|
license=('custom')
|
|
|
|
options=('!strip')
|
2023-05-27 20:10:31 +02:00
|
|
|
install="$pkgname.install"
|
|
|
|
depends=("electron${_electron}" 'libxss')
|
2023-04-03 08:35:46 +02:00
|
|
|
makedepends=('git' 'asar' 'nodejs' 'curl' 'python-html2text')
|
|
|
|
optdepends=(
|
|
|
|
'libpulse: Pulseaudio support'
|
2023-07-07 22:59:23 +02:00
|
|
|
'libappindicator-gtk3: Systray indicator support'
|
2023-04-03 08:35:46 +02:00
|
|
|
'xdg-utils: Open files'
|
2023-06-02 21:52:38 +02:00
|
|
|
'rizin: Allow patching Krisp support'
|
2023-04-03 08:35:46 +02:00
|
|
|
)
|
2023-07-13 06:40:55 +02:00
|
|
|
source=("https://dl.discordapp.net/apps/linux/${_pkgver}/${_pkgname}-${_pkgver}.tar.gz"
|
2023-05-27 20:10:31 +02:00
|
|
|
'discord-launcher.sh'
|
2023-07-07 22:59:23 +02:00
|
|
|
"git+https://github.com/goosemod/openasar.git#commit=5ac246dc92e9a2a9b314d899df728f37096c482b")
|
2023-07-13 06:40:55 +02:00
|
|
|
sha512sums=('763fe47a0fb21a13e852bcc818d4e0e2ea4faf23fcfdc02fddfe06e8c829499e028e27b45d807d3b3edcc36788990f3f21c0460b9b8efc538b62f3b41aeb744d'
|
|
|
|
'f516b1dba10f423f1ebe69b14f70740232b19d343b603c3479ba1e1dd2b7bcf472e92d354fde3a9d553bfae78207ae0420be60372a4b38ba78c3421172230826'
|
2023-04-03 08:35:46 +02:00
|
|
|
'SKIP')
|
|
|
|
|
2023-07-13 06:40:55 +02:00
|
|
|
_krisp_b2sum='56c8c5167e3c4b51720accf0acfe46e7e073b015600088b6bb4d2b7a259cd788c4facba2d7332b535cfa39b91ee94840d6ea905c5d0c9cca43fa0a26f5185cc9'
|
2023-06-02 21:52:38 +02:00
|
|
|
|
2023-04-06 06:55:37 +02:00
|
|
|
# just in case I get the version wrong
|
|
|
|
pkgver() {
|
|
|
|
cd "${srcdir}/openasar"
|
|
|
|
printf "%s+%s" "$_pkgver" "$(git rev-list --count HEAD)"
|
|
|
|
}
|
2023-04-03 08:35:46 +02:00
|
|
|
|
|
|
|
prepare() {
|
2023-06-02 21:52:38 +02:00
|
|
|
# prepare launcher script
|
|
|
|
sed -i "s|@PKGNAME@|${_pkgname}|g;s|@PKGVER@|${_pkgver}|g;s|@ELECTRON@|${_electron}|g;s|@KRISPB2@|${_krisp_b2sum}|g" discord-launcher.sh
|
2023-04-03 08:35:46 +02:00
|
|
|
|
|
|
|
# fix the .desktop file
|
2023-07-13 06:40:55 +02:00
|
|
|
sed -i "s|Exec=.*|Exec=/usr/bin/${_pkgname}|" ${_pkgname^}/$_pkgname.desktop
|
2023-04-03 08:35:46 +02:00
|
|
|
|
|
|
|
# create the license files
|
|
|
|
curl https://discord.com/terms | html2text >"${srcdir}"/LICENSE.md
|
|
|
|
curl https://discord.com/licenses | html2text >"${srcdir}"/OSS-LICENSES.md
|
|
|
|
}
|
|
|
|
|
2023-07-13 06:40:55 +02:00
|
|
|
build() {
|
|
|
|
cd "${srcdir}"/openasar
|
2023-04-03 08:35:46 +02:00
|
|
|
|
|
|
|
# pack openasar
|
|
|
|
sed -i -e "s/nightly/nightly-$(git rev-parse HEAD | cut -c 1-7)/" src/index.js
|
|
|
|
node scripts/strip.js
|
|
|
|
asar p src app.asar
|
2023-07-13 06:40:55 +02:00
|
|
|
}
|
2023-04-03 08:35:46 +02:00
|
|
|
|
2023-07-13 06:40:55 +02:00
|
|
|
package() {
|
|
|
|
# create necessary directories
|
|
|
|
install -d "${pkgdir}"/usr/{lib/$_pkgname,bin}
|
|
|
|
install -d "${pkgdir}"/usr/share/{pixmaps,applications,licenses/$_pkgname}
|
2023-04-03 08:35:46 +02:00
|
|
|
|
|
|
|
# copy relevant data
|
2023-07-13 06:40:55 +02:00
|
|
|
cp -r ${_pkgname^}/resources/* "${pkgdir}"/usr/lib/$_pkgname/
|
|
|
|
cp ${_pkgname^}/$_pkgname.png \
|
2023-04-03 08:35:46 +02:00
|
|
|
"${pkgdir}"/usr/share/pixmaps/$_pkgname.png
|
2023-07-13 06:40:55 +02:00
|
|
|
cp ${_pkgname^}/$_pkgname.desktop \
|
2023-04-03 08:35:46 +02:00
|
|
|
"${pkgdir}"/usr/share/applications/$_pkgname.desktop
|
|
|
|
|
2023-07-13 06:40:55 +02:00
|
|
|
# overwrite Discord asar
|
2023-04-03 08:35:46 +02:00
|
|
|
install -Dm 644 openasar/app.asar "${pkgdir}"/usr/lib/$_pkgname/
|
|
|
|
|
|
|
|
# install the launch script
|
|
|
|
install -Dm 755 discord-launcher.sh "${pkgdir}"/usr/bin/$_pkgname
|
|
|
|
|
|
|
|
# install licenses
|
|
|
|
install -Dm 644 LICENSE.md "${pkgdir}"/usr/share/licenses/$_pkgname/
|
|
|
|
install -Dm 644 OSS-LICENSES.md "${pkgdir}"/usr/share/licenses/$_pkgname/
|
|
|
|
}
|