117.0.5938.157: add autoupdate

This commit is contained in:
xiota 2023-10-09 20:45:26 -07:00
parent 3eb23f282d
commit ec97f16625
4 changed files with 126 additions and 102 deletions

View file

@ -1,11 +1,25 @@
pkgbase = thorium-browser-bin
pkgdesc = Chromium fork focused on high performance and security.
pkgver = 116.0.5845.169
pkgver = 117.0.5938.157
pkgrel = 1
url = https://github.com/Alex313031/Thorium
install = thorium-browser.install
arch = x86_64
license = GPLv3
license = GPL3
optdepends = pipewire: WebRTC desktop sharing under Wayland
optdepends = kdialog: for file dialogs in KDE
optdepends = gnome-keyring: for storing passwords in GNOME keyring
optdepends = kwallet: for storing passwords in KWallet
provides = thorium-browser
conflicts = thorium-browser
options = !emptydirs
options = !strip
source = https://github.com/Alex313031/Thorium/releases/download/M117.0.5938.157/thorium-browser_117.0.5938.157_amd64.deb
source = thorium-browser.sh
sha256sums = SKIP
sha256sums = 4bbf1ad3a3ecaeda2dc92c5531d16ef7a8efbcb1fefe3a0dff77e9782aefdd1b
pkgname = thorium-browser-bin
depends = alsa-lib
depends = gtk3
depends = libcups
@ -14,15 +28,3 @@ pkgbase = thorium-browser-bin
depends = nss
depends = ttf-liberation
depends = xdg-utils
optdepends = pipewire: WebRTC desktop sharing under Wayland
optdepends = kdialog: for file dialogs in KDE
optdepends = gnome-keyring: for storing passwords in GNOME keyring
optdepends = kwallet: for storing passwords in KWallet
options = !emptydirs
options = !strip
source = https://github.com/Alex313031/Thorium/releases/download/M116.0.5845.169/thorium-browser_116.0.5845.169_amd64.deb
source = thorium-browser.sh
sha512sums = 2a7f3f1ef21eec825f0f74cb48307926a12cb7574a354954ae099fd2a129eac1a7cc9bf9354cab72fb24ebeb485234c66d8fc8b46b5ed93d84c576eae7c3c249
sha512sums = 91a532fde9e6e87d65b909a170d32808f1c05367104cdaab07043fef0de66bdfc307a4138584cd1eedc169a03207372df39c09268ab1ec741432e79e0dcc2dfb
pkgname = thorium-browser-bin

10
.gitignore vendored
View file

@ -1,6 +1,4 @@
*.deb
*.pkg.tar.*
*.part
*.kate-swp
src/
pkg/
*
!PKGBUILD
!.SRCINFO
!.gitignore

153
PKGBUILD
View file

@ -1,60 +1,119 @@
# Copyright (c) 2022 Alex313031, JPratama7, and StarterX4.
# Maintainer: JPratama7 <josepratama080@gmail.com>
# Maintainer: Dominik Adrian Grzywak <starterx4 at gmail dot com>
# Maintainer: xiota / aur.chaotic.cx
_pkgname=thorium-browser
pkgname=${_pkgname}-bin
pkgver=116.0.5845.169
# Copyright (c) 2022 Alex313031, JPratama7, and StarterX4.
# Contributor: JPratama7 <josepratama080@gmail.com>
# Contributor: Dominik Adrian Grzywak <starterx4 at gmail dot com>
# options - defaults
if [ -z "$_pkgver" ] ; then
: ${_autoupdate:=true}
else
: ${_autoupdate:=false}
fi
: ${_pkgver:=117.0.5938.157}
# basic info
_pkgname="thorium-browser"
pkgname="$_pkgname-bin"
pkgver=117.0.5938.157
pkgrel=1
pkgdesc="Chromium fork focused on high performance and security."
arch=('x86_64')
url="https://github.com/Alex313031/Thorium"
license=('GPLv3')
depends=(
'alsa-lib'
'gtk3'
'libcups'
'libxss'
'libxtst'
'nss'
'ttf-liberation'
'xdg-utils'
)
# update version
case "${_autoupdate::1}" in
't'|'y'|'1')
_response=$(curl "https://api.github.com/repos/Alex313031/Thorium/releases" -s)
_get() {
printf '%s' "$_response" \
| awk -F '"' '/"'"$1"'":/{print $4}' \
| head -1 | sed 's/^M//'
}
_pkgver_new=$(_get tag_name)
# update _pkgver
if [ x"$_pkgver" != x"$_pkgver_new" ] ; then
_pkgver="$_pkgver_new"
sed -Ei "s@^(\s*: \\\$\{_pkgver):=[0-9]+.*\}\$@\1:=$_pkgver}@" "$startdir/PKGBUILD"
fi
;;
esac
arch=('x86_64')
license=('GPL3')
depends=()
makedepends=()
optdepends=(
'pipewire: WebRTC desktop sharing under Wayland'
'kdialog: for file dialogs in KDE'
'gnome-keyring: for storing passwords in GNOME keyring'
'kwallet: for storing passwords in KWallet'
'pipewire: WebRTC desktop sharing under Wayland'
'kdialog: for file dialogs in KDE'
'gnome-keyring: for storing passwords in GNOME keyring'
'kwallet: for storing passwords in KWallet'
)
if [ x"$_pkgname" != x"$pkgname" ] ; then
provides=("$_pkgname")
conflicts=("$_pkgname")
fi
options=('!emptydirs' '!strip')
install=$_pkgname.install
source=("https://github.com/Alex313031/Thorium/releases/download/M${pkgver}/${_pkgname}_${pkgver}_amd64.deb"
"$_pkgname.sh")
sha512sums=('2a7f3f1ef21eec825f0f74cb48307926a12cb7574a354954ae099fd2a129eac1a7cc9bf9354cab72fb24ebeb485234c66d8fc8b46b5ed93d84c576eae7c3c249'
'91a532fde9e6e87d65b909a170d32808f1c05367104cdaab07043fef0de66bdfc307a4138584cd1eedc169a03207372df39c09268ab1ec741432e79e0dcc2dfb')
install="$_pkgname.install"
_dl_url="$url/releases/download/M${_pkgver}"
_dl_filename="${_pkgname}_${_pkgver}_amd64.deb"
source=(
"$_dl_url/$_dl_filename"
"$_pkgname.sh"
)
sha256sums=(
'SKIP'
'4bbf1ad3a3ecaeda2dc92c5531d16ef7a8efbcb1fefe3a0dff77e9782aefdd1b'
)
pkgver() {
printf '%s' \
"$_pkgver"
}
package() {
echo " -> Extracting the data.tar.xz..."
bsdtar -xf data.tar.xz -C "$pkgdir/"
depends+=(
'alsa-lib'
'gtk3'
'libcups'
'libxss'
'libxtst'
'nss'
'ttf-liberation'
'xdg-utils'
)
echo " -> Moving stuff in place..."
# Launcher
install -m755 $_pkgname.sh "$pkgdir"/usr/bin/$_pkgname
echo " -> Extracting the data.tar.xz..."
bsdtar -xf data.tar.xz -C "$pkgdir/"
chmod 4755 "$pkgdir/opt/chromium.org/thorium/chrome-sandbox"
# Icons
for i in 16x16 24x24 32x32 48x48 64x64 128x128 256x256; do
install -Dm644 "$pkgdir"/opt/chromium.org/thorium/product_logo_${i/x*/}.png \
"$pkgdir"/usr/share/icons/hicolor/$i/apps/thorium-browser.png
done
install -Dm644 "$pkgdir/opt/chromium.org/thorium/thorium_shell.png" -t \
"$pkgdir/usr/share/icons/hicolor/256x256/apps/"
echo " -> Moving stuff in place..."
# Launcher
install -Dm755 "$_pkgname.sh" "$pkgdir/usr/bin/$_pkgname"
echo " -> Removing Debian Cron job, duplicate product logos and menu directory..."
rm -r \
"$pkgdir"/etc/cron.daily/ \
"$pkgdir"/opt/chromium.org/thorium/cron/ \
"$pkgdir"/opt/chromium.org/thorium/product_logo_*.{png,xpm} \
"$pkgdir"/usr/share/menu/
chmod 4755 "$pkgdir/opt/chromium.org/thorium/chrome-sandbox"
# Icons
for i in 16 24 32 48 64 128 256; do
install -Dm644 "$pkgdir/opt/chromium.org/thorium/product_logo_${i}.png" \
"$pkgdir/usr/share/icons/hicolor/${i}x${i}/apps/thorium-browser.png"
done
install -Dm644 "$pkgdir/opt/chromium.org/thorium/thorium_shell.png" \
-t "$pkgdir/usr/share/icons/hicolor/256x256/apps/"
echo " -> Removing Debian Cron job, duplicate product logos and menu directory..."
rm -r -- \
"$pkgdir/etc/cron.daily/" \
"$pkgdir/opt/chromium.org/thorium/cron/" \
"$pkgdir/opt/chromium.org/thorium"/product_logo_*.{png,xpm} \
"$pkgdir/usr/share/menu/"
}

View file

@ -1,35 +0,0 @@
#!/bin/bash
set -euxo pipefail
# Get pkgname
PKG=$(awk -F '=' '/^pkgname/{ print $2 }' PKGBUILD)
# Get latest version
VER=$(curl -sSf https://dl.thorium.rocks/debian/dists/stable/main/binary-amd64/Packages.gz |
grep -A1 "Package: ${PKG}" |
awk '/Version/{print $2}' |
cut -d '-' -f1)
# Insert latest version into PKGBUILD and update hashes
sed -i \
-e "s/^pkgver=.*/pkgver=${VER}/" \
PKGBUILD
# Check whether this changed anything
if (git diff --exit-code PKGBUILD); then
echo "Package ${PKG} has most recent version ${VER}"
exit 0
fi
sed -i \
-e 's/pkgrel=.*/pkgrel=1/' \
PKGBUILD
updpkgsums
# Update .SRCINFO
makepkg --printsrcinfo >.SRCINFO
# Commit changes
git add PKGBUILD .SRCINFO
git commit -m "${PKG} v${VER}"