From c09839e4742fce2d00abc0c45c91c7ee6595a9f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20H=C3=BCsers?= Date: Sat, 27 May 2023 20:10:31 +0200 Subject: [PATCH] upgpkg: discord-electron-openasar 0.0.27+809-2 Update to latest OpenAsar commit Update Discord launcher script (Original by Zoddo) Add libxss as dependency to fix Discord corruption warning Add install script to notify user about discord-flags.conf Remove duplicate Path variable in .desktop file Update contributor list --- .SRCINFO | 10 ++++--- PKGBUILD | 45 +++++++------------------------ discord-electron-openasar.install | 18 +++++++++++++ discord-launcher.sh | 28 +++++++++++++++++++ 4 files changed, 63 insertions(+), 38 deletions(-) create mode 100644 discord-electron-openasar.install create mode 100644 discord-launcher.sh diff --git a/.SRCINFO b/.SRCINFO index 98e27e9..217ad2f 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -1,8 +1,9 @@ pkgbase = discord-electron-openasar pkgdesc = Discord packaged with OpenAsar using system provided electron (v22) for increased security and performance - pkgver = 0.0.27+808 - pkgrel = 1 + pkgver = 0.0.27+809 + pkgrel = 2 url = https://discord.com + install = discord-electron-openasar.install arch = x86_64 license = custom makedepends = git @@ -11,14 +12,17 @@ pkgbase = discord-electron-openasar makedepends = curl makedepends = python-html2text depends = electron22 + depends = libxss optdepends = libpulse: Pulseaudio support optdepends = xdg-utils: Open files provides = discord conflicts = discord options = !strip source = https://dl.discordapp.net/apps/linux/0.0.27/discord-0.0.27.tar.gz - source = git+https://github.com/goosemod/openasar.git#commit=99cd4f53bf910f5f6ce5234905126f261a35fefa + source = discord-launcher.sh + source = git+https://github.com/goosemod/openasar.git#commit=a8b07392808032f95ac3a7c5856e76d2619c91ae sha512sums = 285a0119b4740402a3fa94d3679a52bc8d883413ee32187e90087960a4d34aaf316788d2708bbccafe3f995c2b99767b45bc4b7c731704ef887a8de1b3d3926f + sha512sums = d8c531d23014611b1e9dfa2d268747ba601f647c2cbfc26c15c9eebcec6f9feb454d10c6f603b9938e8da568da3080372b14309e966e0d00c0e1284a14591a83 sha512sums = SKIP pkgname = discord-electron-openasar diff --git a/PKGBUILD b/PKGBUILD index a62e6b7..4e7d355 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,15 +1,15 @@ # Maintainer: Manuel Hüsers # 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_arch_electron PKGBUILD from johnnyapol, huyizheng, Thaodan and Zoddo # Based off the discord community repo PKGBUILD by Filipe Laíns (FFY00) pkgname=discord-electron-openasar _pkgname=discord _electron=22 -pkgver=0.0.27+808 +pkgver=0.0.27+809 _pkgver=${pkgver%%+*} -pkgrel=1 +pkgrel=2 pkgdesc="Discord packaged with OpenAsar using system provided electron (v${_electron}) for increased security and performance" arch=('x86_64') provides=("${_pkgname}") @@ -17,15 +17,18 @@ conflicts=("${_pkgname}") url='https://discord.com' license=('custom') options=('!strip') -depends=("electron${_electron}") +install="$pkgname.install" +depends=("electron${_electron}" 'libxss') makedepends=('git' 'asar' 'nodejs' 'curl' 'python-html2text') optdepends=( 'libpulse: Pulseaudio support' 'xdg-utils: Open files' ) source=("https://dl.discordapp.net/apps/linux/${_pkgver}/discord-${_pkgver}.tar.gz" - "git+https://github.com/goosemod/openasar.git#commit=99cd4f53bf910f5f6ce5234905126f261a35fefa") + 'discord-launcher.sh' + "git+https://github.com/goosemod/openasar.git#commit=a8b07392808032f95ac3a7c5856e76d2619c91ae") sha512sums=('285a0119b4740402a3fa94d3679a52bc8d883413ee32187e90087960a4d34aaf316788d2708bbccafe3f995c2b99767b45bc4b7c731704ef887a8de1b3d3926f' + 'd8c531d23014611b1e9dfa2d268747ba601f647c2cbfc26c15c9eebcec6f9feb454d10c6f603b9938e8da568da3080372b14309e966e0d00c0e1284a14591a83' 'SKIP') # just in case I get the version wrong @@ -35,39 +38,11 @@ pkgver() { } prepare() { - # create launcher script - cat >> "${srcdir}"/discord-launcher.sh <> Discord/$_pkgname.desktop # create the license files curl https://discord.com/terms | html2text >"${srcdir}"/LICENSE.md diff --git a/discord-electron-openasar.install b/discord-electron-openasar.install new file mode 100644 index 0000000..11da629 --- /dev/null +++ b/discord-electron-openasar.install @@ -0,0 +1,18 @@ +post_upgrade() { + # return if old package version is greater than or equal to 0.0.27+809-2... + (( $(vercmp $2 '0.0.27+809-2') >= 0 )) && return + + cat < You can now add or uncomment additional Electron flags in + '~/.config/discord-flags.conf' (if XDG_CONFIG_HOME is not set) + +EOF +} + +post_install() { + cat < In case of performance problems consider adding or uncommenting Electron + flags in '~/.config/discord-flags.conf' (if XDG_CONFIG_HOME is not set) + +EOF +} diff --git a/discord-launcher.sh b/discord-launcher.sh new file mode 100644 index 0000000..398e61d --- /dev/null +++ b/discord-launcher.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +set -euo pipefail + +flags_file="${XDG_CONFIG_HOME:-$HOME/.config}/@PKGNAME@-flags.conf" + +declare -a flags + +if [[ -f "${flags_file}" ]]; then + mapfile -t < "${flags_file}" +else + cat > "${flags_file}" <