switch to sse3 version

This commit is contained in:
xiota 2024-02-09 20:57:59 -08:00
parent 6534fb5297
commit 4fa030862f
7 changed files with 736 additions and 71 deletions

View file

@ -1,7 +1,7 @@
pkgbase = thorium-browser-bin
pkgdesc = Chromium fork focused on high performance and security
pkgver = 120.0.6099.235
pkgrel = 1
pkgrel = 2
url = https://github.com/Alex313031/Thorium
install = thorium-browser.install
arch = x86_64
@ -10,13 +10,11 @@ pkgbase = thorium-browser-bin
optdepends = kdialog: for file dialogs in KDE
optdepends = kwallet5: for storing passwords in KWallet
optdepends = pipewire: WebRTC desktop sharing under Wayland
noextract = thorium-browser_120.0.6099.235_amd64.deb
noextract = thorium-browser_120.0.6099.235_SSE3.deb
options = !emptydirs
options = !strip
source = https://github.com/Alex313031/Thorium/releases/download/M120.0.6099.235/thorium-browser_120.0.6099.235_amd64.deb
source = thorium-browser.sh
source = https://github.com/Alex313031/Thorium/releases/download/M120.0.6099.235/thorium-browser_120.0.6099.235_SSE3.deb
sha256sums = SKIP
sha256sums = 8c6cd4c85389d9642afce9549c750d7b27ab9e2f4032a05fa03d02799cd8ac9b
pkgname = thorium-browser-bin
depends = alsa-lib

View file

@ -1,4 +1,4 @@
# Maintainer: xiota / aur.chaotic.cx
# Maintainer:
# Contributor: JPratama7 <josepratama080@gmail.com>
# Contributor: Dominik Adrian Grzywak <starterx4 at gmail dot com>
@ -13,7 +13,7 @@ fi
_pkgname="thorium-browser"
pkgname="$_pkgname-bin"
pkgver=120.0.6099.235
pkgrel=1
pkgrel=2
pkgdesc="Chromium fork focused on high performance and security"
url="https://github.com/Alex313031/Thorium"
license=('BSD')
@ -36,24 +36,56 @@ _main_package() {
install="$_pkgname.install"
_dl_url="https://github.com/Alex313031/Thorium/releases/download/M${_pkgver:?}"
_dl_filename="${_pkgname}_${_pkgver:?}_amd64.deb"
_dl_filename="${_pkgname}_${_pkgver:?}_SSE3.deb"
noextract+=("$_dl_filename")
source=(
"$_dl_url/$_dl_filename"
"$_pkgname.sh"
)
sha256sums=(
'SKIP'
'8c6cd4c85389d9642afce9549c750d7b27ab9e2f4032a05fa03d02799cd8ac9b'
)
source=("$_dl_url/$_dl_filename")
sha256sums=('SKIP')
pkgver() {
printf '%s' "${_pkgver:?}"
echo "${_pkgver:?}"
}
}
# common functions
prepare() {
install -Dvm644 /dev/stdin "$_pkgname.sh" <<END
#!/usr/bin/env bash
# check microprocessor architecture level
if /usr/lib/ld-linux-x86-64.so.2 --help | grep -qsE '^\s+x86-64-v3.*supported.*\$' ; then
_message=''
_message+=\$'The fastest browser on Earth.'
elif grep -qE '\bpni\b' /proc/cpuinfo ; then
_message=''
_message+=\$'Your processor does not support x86-64-v3 instructions.\n'
_message+=\$'You may want to use thorium-browser-sse3-bin.'
else
_message=''
_message+=\$'Your processor does not support SSE3 instructions.\n'
_message+=\$'thorium-browser may not work on your computer.'
fi
# Allow users to override command-line options
XDG_CONFIG_HOME=\${XDG_CONFIG_HOME:-~/.config}
_FLAGS_FILE="\$XDG_CONFIG_HOME/thorium-flags.conf"
if [[ -f "\$_FLAGS_FILE" ]]; then
_USER_FLAGS="\$(cat "\$_FLAGS_FILE")"
fi
# display processor support message
if tty -s ; then
echo "\$_message"
else
[ ! -e "\$XDG_CONFIG_HOME/thorium" ] && notify-send -a "thorium-browser" -t 7500 "\$_message"
fi
# Launch
exec /opt/thorium-browser/thorium-browser \$_USER_FLAGS "\$@"
END
}
package() {
provides=("$_pkgname")
conflicts=("$_pkgname")
@ -86,46 +118,46 @@ package() {
echo " -> Extracting the archive..."
bsdtar -xf "$_dl_filename" data.tar.xz
bsdtar -xf data.tar.xz -C "${pkgdir:?}/"
bsdtar -xf data.tar.xz -C "$pkgdir/"
rm data.tar.xz
echo " -> Moving files in place..."
mv "${pkgdir:?}/opt/chromium.org/thorium" "${pkgdir:?}/opt/$_pkgname"
unlink "${pkgdir:?}/usr/bin/thorium-browser"
unlink "${pkgdir:?}/usr/bin/pak"
mv "$pkgdir/opt/chromium.org/thorium" "$pkgdir/opt/$_pkgname"
unlink "$pkgdir/usr/bin/thorium-browser"
unlink "$pkgdir/usr/bin/pak"
# thorium-browser
install -Dm755 "$_pkgname.sh" "${pkgdir:?}/usr/bin/$_pkgname"
chmod 4755 "${pkgdir:?}/opt/$_pkgname/chrome-sandbox"
install -Dm755 "$_pkgname.sh" "$pkgdir/usr/bin/$_pkgname"
chmod 4755 "$pkgdir/opt/$_pkgname/chrome-sandbox"
# thorium-shell
sed -E \
-e "s@/opt/chromium.org/thorium/@/opt/$_pkgname/@" \
-i "${pkgdir:?}/usr/bin/thorium-shell"
-i "$pkgdir/usr/bin/thorium-shell"
# thorium-browser.xml
sed -E \
-e "s@/opt/chromium.org/thorium/@/opt/$_pkgname/@" \
-i "${pkgdir:?}/usr/share/gnome-control-center/default-apps/thorium-browser.xml"
-i "$pkgdir/usr/share/gnome-control-center/default-apps/thorium-browser.xml"
# Icons
for i in 16 24 32 48 64 128 256; do
install -Dm644 "${pkgdir:?}/opt/$_pkgname/product_logo_${i}.png" \
"${pkgdir:?}/usr/share/icons/hicolor/${i}x${i}/apps/$_pkgname.png"
install -Dm644 "$pkgdir/opt/$_pkgname/product_logo_${i}.png" \
"$pkgdir/usr/share/icons/hicolor/${i}x${i}/apps/$_pkgname.png"
done
install -Dm644 "${pkgdir:?}/opt/$_pkgname/thorium_shell.png" \
"${pkgdir:?}/usr/share/icons/hicolor/256x256/apps/thorium-shell.png"
install -Dm644 "$pkgdir/opt/$_pkgname/thorium_shell.png" \
"$pkgdir/usr/share/icons/hicolor/256x256/apps/thorium-shell.png"
# clean-up
echo " -> Removing Debian Cron job, duplicate product logos and menu directory..."
rm -r -- \
"${pkgdir:?}/opt/chromium.org" \
"${pkgdir:?}/etc/cron.daily/" \
"${pkgdir:?}/usr/share/doc/" \
"${pkgdir:?}/opt/$_pkgname/cron/" \
"${pkgdir:?}/opt/$_pkgname"/product_logo_*.{png,xpm} \
"${pkgdir:?}/usr/share/menu/"
"$pkgdir/opt/chromium.org" \
"$pkgdir/etc/cron.daily/" \
"$pkgdir/usr/share/doc/" \
"$pkgdir/opt/$_pkgname/cron/" \
"$pkgdir/opt/$_pkgname"/product_logo_*.{png,xpm} \
"$pkgdir/usr/share/menu/"
}
# update version

223
PKGBUILD.avx Normal file
View file

@ -0,0 +1,223 @@
# Maintainer:
# options
if [ -n "$_srcinfo" ] || [ -n "$_pkgver" ] ; then
: ${_autoupdate:=false}
else
: ${_autoupdate:=true}
fi
# basic info
_pkgname="thorium-browser-avx"
pkgname="$_pkgname-bin"
pkgver=120.0.6099.235
pkgrel=1
pkgdesc="Chromium fork focused on high performance and security"
url="https://github.com/Alex313031/Thorium"
license=('BSD')
arch=('x86_64')
# main package
_main_package() {
_update_version
depends=()
makedepends=()
optdepends=(
'gnome-keyring: for storing passwords in GNOME keyring'
'kdialog: for file dialogs in KDE'
'kwallet5: for storing passwords in KWallet'
'pipewire: WebRTC desktop sharing under Wayland'
)
options=('!emptydirs' '!strip' '!debug')
_dl_url="$url/releases/download/M${_pkgver:?}"
_dl_filename="${_pkgname%-avx}_${_pkgver:?}_amd64.deb"
noextract+=("$_dl_filename")
source=("$_dl_url/$_dl_filename")
sha256sums=('SKIP')
pkgver() {
echo "${_pkgver:?}"
}
}
# common functions
prepare() {
install -Dvm644 /dev/stdin "$_pkgname.sh" <<END
#!/usr/bin/env bash
# check microprocessor architecture level
if grep -qE '\bavx\b' /proc/cpuinfo ; then
_message=''
_message+=\$'The fastest browser on Earth.'
else
_message=''
_message+=\$'Your processor does not support AVX instructions.\n'
_message+=\$'thorium-browser may not work on your computer.'
fi
# Allow users to override command-line options
XDG_CONFIG_HOME=\${XDG_CONFIG_HOME:-~/.config}
_FLAGS_FILE="\$XDG_CONFIG_HOME/thorium-flags.conf"
if [[ -f "\$_FLAGS_FILE" ]]; then
_USER_FLAGS="\$(cat "\$_FLAGS_FILE")"
fi
# display processor support message
if tty -s ; then
echo "\$_message"
else
[ ! -e "\$XDG_CONFIG_HOME/thorium" ] && notify-send -a "thorium-browser" -t 7500 "\$_message"
fi
# Launch
exec /opt/$_pkgname/thorium-browser \$_USER_FLAGS "\$@"
END
}
package() {
provides=("$_pkgname")
conflicts=("$_pkgname")
depends+=(
'alsa-lib'
'at-spi2-core'
'cairo'
'dbus'
'libcups'
'libnotify' # notify-send
'libxcomposite'
'libxkbcommon'
'libxrandr'
'mesa'
'nspr'
'nss'
'pango'
## implicit
#expat
#glib2
#libdrm
#libx11
#libxcb
#libxdamage
#libxext
#libxfixes
)
echo " -> Extracting the archive..."
bsdtar -xf "$_dl_filename" data.tar.xz
bsdtar -xf data.tar.xz -C "$pkgdir/"
rm data.tar.xz
echo " -> Moving files in place..."
mv "$pkgdir/opt/chromium.org/thorium" "$pkgdir/opt/$_pkgname"
unlink "$pkgdir/usr/bin/thorium-browser"
unlink "$pkgdir/usr/bin/pak"
# thorium-browser
install -Dm755 "$_pkgname.sh" "$pkgdir/usr/bin/$_pkgname"
chmod 4755 "$pkgdir/opt/$_pkgname/chrome-sandbox"
# thorium-shell
sed -E \
-e "s@/opt/chromium.org/thorium/@/opt/$_pkgname/@" \
-i "$pkgdir/usr/bin/thorium-shell"
mv "$pkgdir/usr/bin/thorium-shell" "$pkgdir/usr/bin/thorium-shell-${_pkgname: -4}"
# thorium-browser.xml
sed -E \
-e "s@thorium-browser@$_pkgname@" \
-e "s@/opt/chromium.org/thorium/@/opt/$_pkgname/@" \
-i "$pkgdir/usr/share/gnome-control-center/default-apps/thorium-browser.xml"
mv "$pkgdir/usr/share/gnome-control-center/default-apps/thorium-browser.xml" "$pkgdir/usr/share/gnome-control-center/default-apps/$_pkgname.xml"
# thorium-browser.appdata.xml
sed -E \
-e "s@thorium-browser@$_pkgname@" \
-i "$pkgdir/usr/share/appdata/thorium-browser.appdata.xml"
mv "$pkgdir/usr/share/appdata/thorium-browser.appdata.xml" "$pkgdir/usr/share/appdata/$_pkgname.appdata.xml"
# thorium-browser.desktop
sed -E \
-e "s@thorium-browser@$_pkgname@" \
-e "s@thorium-shell@thorium-shell-${_pkgname: -4}@" \
-e "s@^(Name\S*=.*)\$@\1 AVX@" \
-e "s@^(GenericName\S*=.*)\$@\1 AVX@" \
-i "$pkgdir/usr/share/applications/thorium-browser.desktop"
mv "$pkgdir/usr/share/applications/thorium-browser.desktop" "$pkgdir/usr/share/applications/$_pkgname.desktop"
# thorium-shell.desktop
sed -E \
-e "s@^Icon=.*\$@Icon=thorium-shell-${_pkgname: -4}@" \
-e "s@thorium-shell@thorium-shell-${_pkgname: -4}@" \
-e "s@thorium_shell@thorium_shell_${_pkgname: -4}@" \
-e "s@^(Name\S*=.*)\$@\1 AVX@" \
-e "s@^(GenericName\S*=.*)\$@\1 AVX@" \
-i "$pkgdir/usr/share/applications/thorium-shell.desktop"
mv "$pkgdir/usr/share/applications/thorium-shell.desktop" "$pkgdir/usr/share/applications/thorium-shell-${_pkgname: -4}.desktop"
# man page
mv "$pkgdir/usr/share/man/man1/thorium-browser.1.gz" "$pkgdir/usr/share/man/man1/$_pkgname.1.gz"
# Icons
for i in 16 24 32 48 64 128 256; do
install -Dm644 "$pkgdir/opt/$_pkgname/product_logo_${i}.png" \
"$pkgdir/usr/share/icons/hicolor/${i}x${i}/apps/$_pkgname.png"
done
install -Dm644 "$pkgdir/opt/$_pkgname/thorium_shell.png" \
"$pkgdir/usr/share/icons/hicolor/256x256/apps/thorium-shell-${_pkgname: -4}.png"
# clean-up
echo " -> Removing Debian Cron job, duplicate product logos and menu directory..."
rm -r -- \
"$pkgdir/opt/chromium.org" \
"$pkgdir/etc/cron.daily/" \
"$pkgdir/usr/share/doc/" \
"$pkgdir/opt/$_pkgname/cron/" \
"$pkgdir/opt/$_pkgname"/product_logo_*.{png,xpm} \
"$pkgdir/usr/share/menu/"
}
# update version
_update_version() {
: ${_pkgver:=${pkgver%%.r*}}
if [[ "${_autoupdate::1}" != "t" ]] ; then
return
fi
local _blacklist _response _tags _tag _pkgver_new
_blacklist=(
)
_response=$(curl -Ssf "$url/releases.atom")
_tags=$(
printf '%s' "$_response" \
| grep '/releases/tag/' \
| sed -E 's@^.*/releases/tag/(.*)".*$@\1@' \
| grep -Ev '[a-z]{2}'
)
for i in "${_blacklist[@]}" ; do
_tags=${_tags/$i}
done
_tag=$(printf '%s' "$_tags" | sort -rV | head -1)
_pkgver_new="${_tag#M}"
# update _pkgver
if [ "$_pkgver" != "${_pkgver_new:?}" ] ; then
_pkgver="${_pkgver_new:?}"
fi
}
# execute
_main_package

225
PKGBUILD.avx2 Normal file
View file

@ -0,0 +1,225 @@
# Maintainer:
# options
if [ -n "$_srcinfo" ] || [ -n "$_pkgver" ] ; then
: ${_autoupdate:=false}
else
: ${_autoupdate:=true}
fi
# basic info
_pkgname="thorium-browser-avx2"
pkgname="$_pkgname-bin"
pkgver=119.0.6045.214
pkgrel=1
pkgdesc="Chromium fork focused on high performance and security"
url="https://github.com/Alex313031/Thorium-Other"
license=('BSD')
arch=('x86_64')
# main package
_main_package() {
_update_version
depends=()
makedepends=()
optdepends=(
'gnome-keyring: for storing passwords in GNOME keyring'
'kdialog: for file dialogs in KDE'
'kwallet5: for storing passwords in KWallet'
'pipewire: WebRTC desktop sharing under Wayland'
)
options=('!emptydirs' '!strip' '!debug')
_dl_url="https://github.com/Alex313031/Thorium-Other/releases/download/${_pkgver:?}"
_dl_filename="${_pkgname%-avx2}_${_pkgver:?}_AVX2.deb"
noextract+=("$_dl_filename")
source=("$_dl_url/$_dl_filename")
sha256sums=('SKIP')
pkgver() {
echo "${_pkgver:?}"
}
}
# common functions
prepare() {
install -Dvm644 /dev/stdin "$_pkgname.sh" <<END
#!/usr/bin/env bash
# check microprocessor architecture level
if grep -qE '\bavx2\b' /proc/cpuinfo ; then
_message=''
_message+=\$'The fastest browser on Earth.'
else
_message=''
_message+=\$'Your processor does not support SSE3 instructions.\n'
_message+=\$'thorium-browser may not work on your computer.'
fi
# Allow users to override command-line options
XDG_CONFIG_HOME=\${XDG_CONFIG_HOME:-~/.config}
_FLAGS_FILE="\$XDG_CONFIG_HOME/thorium-flags.conf"
if [[ -f "\$_FLAGS_FILE" ]]; then
_USER_FLAGS="\$(cat "\$_FLAGS_FILE")"
fi
# display processor support message
if tty -s ; then
echo "\$_message"
else
[ ! -e "\$XDG_CONFIG_HOME/thorium" ] && notify-send -a "thorium-browser" -t 7500 "\$_message"
fi
# Launch
exec /opt/$_pkgname/thorium-browser \$_USER_FLAGS "\$@"
END
}
package() {
provides=("$_pkgname")
conflicts=("$_pkgname")
depends+=(
'alsa-lib'
'at-spi2-core'
'cairo'
'dbus'
'libcups'
'libnotify' # notify-send
'libxcomposite'
'libxkbcommon'
'libxrandr'
'mesa'
'nspr'
'nss'
'pango'
## implicit
#expat
#glib2
#libdrm
#libx11
#libxcb
#libxdamage
#libxext
#libxfixes
)
echo " -> Extracting the archive..."
bsdtar -xf "$_dl_filename" data.tar.xz
bsdtar -xf data.tar.xz -C "$pkgdir/"
rm data.tar.xz
echo " -> Moving files in place..."
mv "$pkgdir/opt/chromium.org/thorium" "$pkgdir/opt/$_pkgname"
unlink "$pkgdir/usr/bin/thorium-browser"
unlink "$pkgdir/usr/bin/pak"
# thorium-browser
install -Dm755 "$_pkgname.sh" "$pkgdir/usr/bin/$_pkgname"
chmod 4755 "$pkgdir/opt/$_pkgname/chrome-sandbox"
# thorium-shell
sed -E \
-e "s@/opt/chromium.org/thorium/@/opt/$_pkgname/@" \
-i "$pkgdir/usr/bin/thorium-shell"
mv "$pkgdir/usr/bin/thorium-shell" "$pkgdir/usr/bin/thorium-shell-${_pkgname: -4}"
# thorium-browser.xml
sed -E \
-e "s@thorium-browser@$_pkgname@" \
-e "s@/opt/chromium.org/thorium/@/opt/$_pkgname/@" \
-i "$pkgdir/usr/share/gnome-control-center/default-apps/thorium-browser.xml"
mv "$pkgdir/usr/share/gnome-control-center/default-apps/thorium-browser.xml" "$pkgdir/usr/share/gnome-control-center/default-apps/$_pkgname.xml"
# thorium-browser.appdata.xml
sed -E \
-e "s@thorium-browser@$_pkgname@" \
-i "$pkgdir/usr/share/appdata/thorium-browser.appdata.xml"
mv "$pkgdir/usr/share/appdata/thorium-browser.appdata.xml" "$pkgdir/usr/share/appdata/$_pkgname.appdata.xml"
# thorium-browser.desktop
sed -E \
-e "s@thorium-browser@$_pkgname@" \
-e "s@thorium-shell@thorium-shell-${_pkgname: -4}@" \
-e "s@^(Name\S*=.*)\$@\1 AVX2@" \
-e "s@^(GenericName\S*=.*)\$@\1 AVX2@" \
-i "$pkgdir/usr/share/applications/thorium-browser.desktop"
mv "$pkgdir/usr/share/applications/thorium-browser.desktop" "$pkgdir/usr/share/applications/$_pkgname.desktop"
# thorium-shell.desktop
sed -E \
-e "s@^Icon=.*\$@Icon=thorium-shell-${_pkgname: -4}@" \
-e "s@thorium-shell@thorium-shell-${_pkgname: -4}@" \
-e "s@thorium_shell@thorium_shell_${_pkgname: -4}@" \
-e "s@^(Name\S*=.*)\$@\1 AVX2@" \
-e "s@^(GenericName\S*=.*)\$@\1 AVX2@" \
-i "$pkgdir/usr/share/applications/thorium-shell.desktop"
mv "$pkgdir/usr/share/applications/thorium-shell.desktop" "$pkgdir/usr/share/applications/thorium-shell-${_pkgname: -4}.desktop"
# man page
mv "$pkgdir/usr/share/man/man1/thorium-browser.1.gz" "$pkgdir/usr/share/man/man1/$_pkgname.1.gz"
# Icons
for i in 16 24 32 48 64 128 256; do
install -Dm644 "$pkgdir/opt/$_pkgname/product_logo_${i}.png" \
"$pkgdir/usr/share/icons/hicolor/${i}x${i}/apps/$_pkgname.png"
done
install -Dm644 "$pkgdir/opt/$_pkgname/thorium_shell.png" \
"$pkgdir/usr/share/icons/hicolor/256x256/apps/thorium-shell-${_pkgname: -4}.png"
# clean-up
echo " -> Removing Debian Cron job, duplicate product logos and menu directory..."
rm -r -- \
"$pkgdir/opt/chromium.org" \
"$pkgdir/etc/cron.daily/" \
"$pkgdir/usr/share/doc/" \
"$pkgdir/opt/$_pkgname/cron/" \
"$pkgdir/opt/$_pkgname"/product_logo_*.{png,xpm} \
"$pkgdir/usr/share/menu/"
}
# update version
_update_version() {
: ${_pkgver:=${pkgver%%.r*}}
if [[ "${_autoupdate::1}" != "t" ]] ; then
return
fi
local _blacklist _response _tags _tag _pkgver_new
_blacklist=(
119.0.6045.214-2 # 32-bit SSE2
119.0.6045.214-1 # Windows
)
_response=$(curl -Ssf "$url/releases.atom")
_tags=$(
printf '%s' "$_response" \
| grep '/releases/tag/' \
| sed -E 's@^.*/releases/tag/(.*)".*$@\1@' \
| grep -Ev '[a-z]{2}'
)
for i in "${_blacklist[@]}" ; do
_tags=${_tags/$i}
done
_tag=$(printf '%s' "$_tags" | sort -rV | head -1)
_pkgver_new="${_tag#v.}"
# update _pkgver
if [ "$_pkgver" != "${_pkgver_new:?}" ] ; then
_pkgver="${_pkgver_new:?}"
fi
}
# execute
_main_package

223
PKGBUILD.sse3 Normal file
View file

@ -0,0 +1,223 @@
# Maintainer:
# options
if [ -n "$_srcinfo" ] || [ -n "$_pkgver" ] ; then
: ${_autoupdate:=false}
else
: ${_autoupdate:=true}
fi
# basic info
_pkgname="thorium-browser-sse3"
pkgname="$_pkgname-bin"
pkgver=120.0.6099.235
pkgrel=1
pkgdesc="Chromium fork focused on high performance and security"
url="https://github.com/Alex313031/Thorium"
license=('BSD')
arch=('x86_64')
# main package
_main_package() {
_update_version
depends=()
makedepends=()
optdepends=(
'gnome-keyring: for storing passwords in GNOME keyring'
'kdialog: for file dialogs in KDE'
'kwallet5: for storing passwords in KWallet'
'pipewire: WebRTC desktop sharing under Wayland'
)
options=('!emptydirs' '!strip' '!debug')
_dl_url="$url/releases/download/M${_pkgver:?}"
_dl_filename="${_pkgname%-sse3}_${_pkgver:?}_SSE3.deb"
noextract+=("$_dl_filename")
source=("$_dl_url/$_dl_filename")
sha256sums=('SKIP')
pkgver() {
echo "${_pkgver:?}"
}
}
# common functions
prepare() {
install -Dvm644 /dev/stdin "$_pkgname.sh" <<END
#!/usr/bin/env bash
# check microprocessor architecture level
if grep -qE '\bpni\b' /proc/cpuinfo ; then
_message=''
_message+=\$'The fastest browser on Earth.'
else
_message=''
_message+=\$'Your processor does not support SSE3 instructions.\n'
_message+=\$'thorium-browser may not work on your computer.'
fi
# Allow users to override command-line options
XDG_CONFIG_HOME=\${XDG_CONFIG_HOME:-~/.config}
_FLAGS_FILE="\$XDG_CONFIG_HOME/thorium-flags.conf"
if [[ -f "\$_FLAGS_FILE" ]]; then
_USER_FLAGS="\$(cat "\$_FLAGS_FILE")"
fi
# display processor support message
if tty -s ; then
echo "\$_message"
else
[ ! -e "\$XDG_CONFIG_HOME/thorium" ] && notify-send -a "thorium-browser" -t 7500 "\$_message"
fi
# Launch
exec /opt/$_pkgname/thorium-browser \$_USER_FLAGS "\$@"
END
}
package() {
provides=("$_pkgname")
conflicts=("$_pkgname")
depends+=(
'alsa-lib'
'at-spi2-core'
'cairo'
'dbus'
'libcups'
'libnotify' # notify-send
'libxcomposite'
'libxkbcommon'
'libxrandr'
'mesa'
'nspr'
'nss'
'pango'
## implicit
#expat
#glib2
#libdrm
#libx11
#libxcb
#libxdamage
#libxext
#libxfixes
)
echo " -> Extracting the archive..."
bsdtar -xf "$_dl_filename" data.tar.xz
bsdtar -xf data.tar.xz -C "$pkgdir/"
rm data.tar.xz
echo " -> Moving files in place..."
mv "$pkgdir/opt/chromium.org/thorium" "$pkgdir/opt/$_pkgname"
unlink "$pkgdir/usr/bin/thorium-browser"
unlink "$pkgdir/usr/bin/pak"
# thorium-browser
install -Dm755 "$_pkgname.sh" "$pkgdir/usr/bin/$_pkgname"
chmod 4755 "$pkgdir/opt/$_pkgname/chrome-sandbox"
# thorium-shell
sed -E \
-e "s@/opt/chromium.org/thorium/@/opt/$_pkgname/@" \
-i "$pkgdir/usr/bin/thorium-shell"
mv "$pkgdir/usr/bin/thorium-shell" "$pkgdir/usr/bin/thorium-shell-${_pkgname: -4}"
# thorium-browser.xml
sed -E \
-e "s@thorium-browser@$_pkgname@" \
-e "s@/opt/chromium.org/thorium/@/opt/$_pkgname/@" \
-i "$pkgdir/usr/share/gnome-control-center/default-apps/thorium-browser.xml"
mv "$pkgdir/usr/share/gnome-control-center/default-apps/thorium-browser.xml" "$pkgdir/usr/share/gnome-control-center/default-apps/$_pkgname.xml"
# thorium-browser.appdata.xml
sed -E \
-e "s@thorium-browser@$_pkgname@" \
-i "$pkgdir/usr/share/appdata/thorium-browser.appdata.xml"
mv "$pkgdir/usr/share/appdata/thorium-browser.appdata.xml" "$pkgdir/usr/share/appdata/$_pkgname.appdata.xml"
# thorium-browser.desktop
sed -E \
-e "s@thorium-browser@$_pkgname@" \
-e "s@thorium-shell@thorium-shell-${_pkgname: -4}@" \
-e "s@^(Name\S*=.*)\$@\1 SSE3@" \
-e "s@^(GenericName\S*=.*)\$@\1 SSE3@" \
-i "$pkgdir/usr/share/applications/thorium-browser.desktop"
mv "$pkgdir/usr/share/applications/thorium-browser.desktop" "$pkgdir/usr/share/applications/$_pkgname.desktop"
# thorium-shell.desktop
sed -E \
-e "s@^Icon=.*\$@Icon=thorium-shell-${_pkgname: -4}@" \
-e "s@thorium-shell@thorium-shell-${_pkgname: -4}@" \
-e "s@thorium_shell@thorium_shell_${_pkgname: -4}@" \
-e "s@^(Name\S*=.*)\$@\1 SSE3@" \
-e "s@^(GenericName\S*=.*)\$@\1 SSE3@" \
-i "$pkgdir/usr/share/applications/thorium-shell.desktop"
mv "$pkgdir/usr/share/applications/thorium-shell.desktop" "$pkgdir/usr/share/applications/thorium-shell-${_pkgname: -4}.desktop"
# man page
mv "$pkgdir/usr/share/man/man1/thorium-browser.1.gz" "$pkgdir/usr/share/man/man1/$_pkgname.1.gz"
# Icons
for i in 16 24 32 48 64 128 256; do
install -Dm644 "$pkgdir/opt/$_pkgname/product_logo_${i}.png" \
"$pkgdir/usr/share/icons/hicolor/${i}x${i}/apps/$_pkgname.png"
done
install -Dm644 "$pkgdir/opt/$_pkgname/thorium_shell.png" \
"$pkgdir/usr/share/icons/hicolor/256x256/apps/thorium-shell-${_pkgname: -4}.png"
# clean-up
echo " -> Removing Debian Cron job, duplicate product logos and menu directory..."
rm -r -- \
"$pkgdir/opt/chromium.org" \
"$pkgdir/etc/cron.daily/" \
"$pkgdir/usr/share/doc/" \
"$pkgdir/opt/$_pkgname/cron/" \
"$pkgdir/opt/$_pkgname"/product_logo_*.{png,xpm} \
"$pkgdir/usr/share/menu/"
}
# update version
_update_version() {
: ${_pkgver:=${pkgver%%.r*}}
if [[ "${_autoupdate::1}" != "t" ]] ; then
return
fi
local _blacklist _response _tags _tag _pkgver_new
_blacklist=(
)
_response=$(curl -Ssf "$url/releases.atom")
_tags=$(
printf '%s' "$_response" \
| grep '/releases/tag/' \
| sed -E 's@^.*/releases/tag/(.*)".*$@\1@' \
| grep -Ev '[a-z]{2}'
)
for i in "${_blacklist[@]}" ; do
_tags=${_tags/$i}
done
_tag=$(printf '%s' "$_tags" | sort -rV | head -1)
_pkgver_new="${_tag#M}"
# update _pkgver
if [ "$_pkgver" != "${_pkgver_new:?}" ] ; then
_pkgver="${_pkgver_new:?}"
fi
}
# execute
_main_package

View file

@ -26,9 +26,6 @@ post_install() {
if /usr/lib/ld-linux-x86-64.so.2 --help | grep -qsE '^\s+x86-64-v3.*supported.*$' ; then
note1 "Custom flags should be put directly in: ~/.config/thorium-flags.conf"
note2 "The launcher is called: 'thorium-browser'"
elif grep -qE '\bpni\b' /proc/cpuinfo ; then
note1 "Your processor does not support x86-64-v3 instructions."
note2 "You may want to install thorium-browser-sse3-bin instead."
else
note1 "Your processor does not support SSE3 instructions."
note2 "thorium-browser may not work on your computer."

View file

@ -1,33 +0,0 @@
#!/usr/bin/env bash
# check microprocessor architecture level
if /usr/lib/ld-linux-x86-64.so.2 --help | grep -qsE '^\s+x86-64-v3.*supported.*$' ; then
_message=''
_message+=$'The fastest browser on Earth.'
elif grep -qE '\bpni\b' /proc/cpuinfo ; then
_message=''
_message+=$'Your processor does not support x86-64-v3 instructions.\n'
_message+=$'You may want to use thorium-browser-sse3-bin.'
else
_message=''
_message+=$'Your processor does not support SSE3 instructions.\n'
_message+=$'thorium-browser may not work on your computer.'
fi
# Allow users to override command-line options
XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-~/.config}
_FLAGS_FILE="$XDG_CONFIG_HOME/thorium-flags.conf"
if [[ -f "$_FLAGS_FILE" ]]; then
_USER_FLAGS="$(cat "$_FLAGS_FILE")"
fi
# display processor support message
if tty -s ; then
echo "$_message"
else
[ ! -e "$XDG_CONFIG_HOME/thorium" ] && notify-send -a "thorium-browser" -t 7500 "$_message"
fi
# Launch
exec /opt/thorium-browser/thorium-browser $_USER_FLAGS "$@"