summarylogtreecommitdiffstats
path: root/update-package.sh
diff options
context:
space:
mode:
authorManuel Hüsers2024-06-09 21:58:06 +0200
committerManuel Hüsers2024-06-09 21:58:06 +0200
commit9fafba484a420eb6acbc4fa7d92220a621f6e96e (patch)
tree06d91b459d3d7f61cefe0e0b29679e1f6c59cc70 /update-package.sh
parent3cb800694bd6a6c56bb3c399a43193a448dcee83 (diff)
downloadaur-9fafba484a420eb6acbc4fa7d92220a621f6e96e.tar.gz
upgpkg: discord 0.0.55-2: refactor, fix autostart, add deps, use wayland
* Slightly refactor PKGBUILD * Fix autostart desktop file * Add optional dependency used in official arch package * Include patcher to allow Krisp noise suppression support * Add install file to inform user about this change * Use Wayland instead of Xwayland in a Wayland session by setting Electron flag `ozone-platform-hint` to auto (default is X11)
Diffstat (limited to 'update-package.sh')
-rwxr-xr-xupdate-package.sh57
1 files changed, 57 insertions, 0 deletions
diff --git a/update-package.sh b/update-package.sh
new file mode 100755
index 000000000000..90cdc1e788c5
--- /dev/null
+++ b/update-package.sh
@@ -0,0 +1,57 @@
+#!/usr/bin/env bash
+
+set -euo pipefail
+
+readonly all_off="$(tput sgr0)"
+readonly bold="${all_off}$(tput bold)"
+readonly white="${bold}$(tput setaf 7)"
+readonly blue="${bold}$(tput setaf 4)"
+readonly red="${bold}$(tput setaf 1)"
+
+msg() {
+ printf "${blue}::${white} $1${all_off}\n"
+}
+
+error() {
+ printf "${red}::${white} $1${all_off}\n"
+}
+
+msgbegin() {
+ printf "${blue}::${white} $1"
+}
+
+msgend() {
+ printf "$1${all_off}\n"
+}
+
+
+readonly krisp_zip='discord_krisp-1.zip'
+readonly krisp_bin='discord_krisp.node'
+
+# head to directory of this script
+cd $(dirname "$0")
+
+# update package to version used in PKGBUILD
+source PKGBUILD
+
+msg "Running updpkgsums (Updating checksums)"
+updpkgsums
+
+msg "Running mksrcinfo (Updating SRCINFO file)"
+makepkg --printsrcinfo > .SRCINFO
+
+msg "Getting Krisp module"
+curl -O "https://dl.discordapp.net/apps/linux/${_pkgver:-${pkgver}}/modules/${krisp_zip}"
+unzip "${krisp_zip}" "${krisp_bin}"
+
+msg "Checking if Krisp module is patchable (watch output)"
+python krisp-patcher.py "${krisp_bin}"
+
+#msg "Updating Krisp module checksum"
+#readonly chcksm=$(b2sum "${krisp_bin}.orig" | head -c 128)
+#sed -i "s/^_krisp_b2sum='.*'$/_krisp_b2sum='${chcksm}'/" PKGBUILD
+
+msgbegin "Cleaning up... "
+rm -f "${krisp_zip}" "${krisp_bin}" "${krisp_bin}.orig"
+
+msgend "Done"