From b09bd231d5b651f308b8d28aade1fb9f5bd839d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20H=C3=BCsers?= Date: Sat, 27 May 2023 20:10:10 +0200 Subject: [PATCH] upgpkg: discord-electron 0.0.27-2 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 --- discord-electron/.SRCINFO | 6 ++- discord-electron/PKGBUILD | 47 ++++++----------------- discord-electron/discord-electron.install | 18 +++++++++ discord-electron/discord-launcher.sh | 28 ++++++++++++++ 4 files changed, 63 insertions(+), 36 deletions(-) create mode 100644 discord-electron/discord-electron.install create mode 100644 discord-electron/discord-launcher.sh diff --git a/discord-electron/.SRCINFO b/discord-electron/.SRCINFO index 9e5707f..9975a49 100644 --- a/discord-electron/.SRCINFO +++ b/discord-electron/.SRCINFO @@ -1,20 +1,24 @@ pkgbase = discord-electron pkgdesc = Discord using system provided electron (v22) for increased security and performance pkgver = 0.0.27 - pkgrel = 1 + pkgrel = 2 url = https://discord.com + install = discord-electron.install arch = x86_64 license = custom makedepends = asar 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 = discord-launcher.sh sha512sums = 285a0119b4740402a3fa94d3679a52bc8d883413ee32187e90087960a4d34aaf316788d2708bbccafe3f995c2b99767b45bc4b7c731704ef887a8de1b3d3926f + sha512sums = d8c531d23014611b1e9dfa2d268747ba601f647c2cbfc26c15c9eebcec6f9feb454d10c6f603b9938e8da568da3080372b14309e966e0d00c0e1284a14591a83 pkgname = discord-electron diff --git a/discord-electron/PKGBUILD b/discord-electron/PKGBUILD index 4dd62cd..7ed6943 100644 --- a/discord-electron/PKGBUILD +++ b/discord-electron/PKGBUILD @@ -1,4 +1,6 @@ # Maintainer: Manuel Hüsers +# Contributor: Zoddo +# Contributor: Thaodan # Contributor: Stick # Contributor: johnnyapol # Contributor: huyizheng @@ -6,14 +8,14 @@ # Contributor: Morgan # 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 _pkgname=discord _electron=22 pkgver=0.0.27 -pkgrel=1 +pkgrel=2 pkgdesc="Discord using system provided electron (v${_electron}) for increased security and performance" arch=('x86_64') provides=("${_pkgname}") @@ -21,49 +23,24 @@ conflicts=("${_pkgname}") url='https://discord.com' license=('custom') options=('!strip') -depends=("electron${_electron}") +install="$pkgname.install" +depends=("electron${_electron}" 'libxss') makedepends=('asar' 'curl' 'python-html2text') optdepends=( 'libpulse: Pulseaudio support' 'xdg-utils: Open files' ) -source=("https://dl.discordapp.net/apps/linux/${pkgver}/discord-${pkgver}.tar.gz") -sha512sums=('285a0119b4740402a3fa94d3679a52bc8d883413ee32187e90087960a4d34aaf316788d2708bbccafe3f995c2b99767b45bc4b7c731704ef887a8de1b3d3926f') +source=("https://dl.discordapp.net/apps/linux/${pkgver}/discord-${pkgver}.tar.gz" + 'discord-launcher.sh') +sha512sums=('285a0119b4740402a3fa94d3679a52bc8d883413ee32187e90087960a4d34aaf316788d2708bbccafe3f995c2b99767b45bc4b7c731704ef887a8de1b3d3926f' + 'd8c531d23014611b1e9dfa2d268747ba601f647c2cbfc26c15c9eebcec6f9feb454d10c6f603b9938e8da568da3080372b14309e966e0d00c0e1284a14591a83') 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/discord-electron.install b/discord-electron/discord-electron.install new file mode 100644 index 0000000..3947c77 --- /dev/null +++ b/discord-electron/discord-electron.install @@ -0,0 +1,18 @@ +post_upgrade() { + # return if old package version is greater than or equal to 0.0.27-2... + (( $(vercmp $2 '0.0.27-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-electron/discord-launcher.sh b/discord-electron/discord-launcher.sh new file mode 100644 index 0000000..398e61d --- /dev/null +++ b/discord-electron/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}" <