commit 815ad77727937e812e53771910532dde4bbd64bf Author: StarterX4 Date: Wed Aug 3 16:39:10 2022 +0200 first commit/push diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 0000000000000..800f079f9dc57 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,28 @@ +pkgbase = thorium-browser-bin + pkgdesc = Chromium fork focused on high performance and security. + pkgver = 106.0.5212.0 + pkgrel = 1 + url = https://github.com/Alex313031/Thorium + install = thorium-browser.install + arch = x86_64 + license = GPLv3 + depends = alsa-lib + depends = gtk3 + depends = libcups + depends = libxss + depends = libxtst + 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://dl.thorium.rocks/debian/dists/stable/main/binary-amd64/thorium-browser_106.0.5212.0-1_amd64.deb + source = thorium-browser.sh + sha512sums = 21e94067cd91cc4e9d1405f57f44c192d334cf2694de974bc7eaefd3673c0e6f1f26b110018d1e0b3f06934b55932fcf66bbecdbc15bd48921ca290bde67634e + sha512sums = 5e34cfbd67d86b31292a61eb5dcee68aeb2c4818bb557fa9aee458215eef8042c57be43b2250f5d89a66df90e4df6473a85688aa63ba2255e789d0f37ed83d8b + +pkgname = thorium-browser-bin diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000000000..7ef471ab0ea3b --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,54 @@ +# Maintainer: Dominik Adrian Grzywak + +_pkgname=thorium-browser +pkgname=${_pkgname}-bin +pkgver=106.0.5212.0 +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' +) +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' +) +options=('!emptydirs' '!strip') +install=$_pkgname.install +source=("https://dl.thorium.rocks/debian/dists/stable/main/binary-amd64/${_pkgname}_${pkgver}-1_amd64.deb" + "$_pkgname.sh") +sha512sums=('21e94067cd91cc4e9d1405f57f44c192d334cf2694de974bc7eaefd3673c0e6f1f26b110018d1e0b3f06934b55932fcf66bbecdbc15bd48921ca290bde67634e' + '5e34cfbd67d86b31292a61eb5dcee68aeb2c4818bb557fa9aee458215eef8042c57be43b2250f5d89a66df90e4df6473a85688aa63ba2255e789d0f37ed83d8b') + +package() { + echo " -> Extracting the data.tar.xz..." + bsdtar -xf data.tar.xz -C "$pkgdir/" + + echo " -> Moving stuff in place..." + # Launcher + install -m755 $_pkgname.sh "$pkgdir"/usr/bin/$_pkgname + + # 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-unstable.png + done + + 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/ +} diff --git a/thorium-browser.install b/thorium-browser.install new file mode 100644 index 0000000000000..37a4860072abb --- /dev/null +++ b/thorium-browser.install @@ -0,0 +1,22 @@ +# Colored makepkg-like functions +msg_blue() { + printf "${blue}==>${bold} $1${all_off}\n" +} + +note() { + printf "${blue}==>${yellow} NOTE:${bold} $1${all_off}\n" +} + +all_off="$(tput sgr0)" +bold="${all_off}$(tput bold)" +blue="${bold}$(tput setaf 4)" +yellow="${bold}$(tput setaf 3)" + +post_install() { + note "Custom flags should be put directly in: ~/.config/thorium-flags.conf" + note "The launcher is called: 'thorium-browser'" +} + +post_upgrade() { + post_install +} diff --git a/thorium-browser.sh b/thorium-browser.sh new file mode 100644 index 0000000000000..38878b0289e0e --- /dev/null +++ b/thorium-browser.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-~/.config} + +# Allow users to override command-line options +if [[ -f $XDG_CONFIG_HOME/thorium-flags.conf ]]; then + THORIUM_USER_FLAGS="$(cat $XDG_CONFIG_HOME/thorium-flags.conf)" +fi + +# Launch +exec /opt/chromium.org/thorium/thorium-browser-unstable $THORIUM_USER_FLAGS "$@" diff --git a/update_version.sh b/update_version.sh new file mode 100755 index 0000000000000..eb26d6bfd7ead --- /dev/null +++ b/update_version.sh @@ -0,0 +1,35 @@ +#!/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 | + 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}"