diff options
author | Andrés Rodríguez | 2019-06-23 20:17:24 -0300 |
---|---|---|
committer | Andrés Rodríguez | 2019-06-23 20:17:24 -0300 |
commit | 3d649180045fbfea1a764341f6ccc3c8085e0722 (patch) | |
tree | 0b7d9790a4f19e0bce3cacbd2c98e278582245d7 | |
parent | 13b2990326f5679265ec282f18e9a21101a429c4 (diff) | |
download | aur-3d649180045fbfea1a764341f6ccc3c8085e0722.tar.gz |
Solve a few QoL issues
- Work around Brave segfaulting on new window (which messes up xdg-open)
- Added support for user flags, much like Arch's own chromium package
- Remove old, non-working workaround for pepper-flash support from Muon era
and replace it with a horrible hack necessary for enabling it in modern Brave
-rw-r--r-- | .SRCINFO | 4 | ||||
-rw-r--r-- | PKGBUILD | 6 | ||||
-rw-r--r-- | brave-bin.sh | 25 |
3 files changed, 26 insertions, 9 deletions
@@ -1,7 +1,7 @@ pkgbase = brave-bin pkgdesc = Web browser that blocks ads and trackers by default (binary release). pkgver = 0.65.121 - pkgrel = 1 + pkgrel = 2 url = https://brave.com/download arch = x86_64 license = custom @@ -25,7 +25,7 @@ pkgbase = brave-bin source = logo.png sha512sums = 34d4e63610ef1e106f2071101299d5d33b6394d5a564c5b1e9cbbea16200bb11d665a99b81f6abee87dff9fba805bdc311c357d5b4beb7f34553bb3b3fc9af86 sha512sums = b8823586fead21247c8208bd842fb5cd32d4cb3ca2a02339ce2baf2c9cb938dfcb8eb7b24c95225ae625cd0ee59fbbd8293393f3ed1a4b45d13ba3f9f62a791f - sha512sums = 20b010e199127fa185da2e78eb97724a1b4d6d279c79b87bb0901ceb832d19ea755485c9039d06d92e6ffd686683990cd1939dc78f37859a798f4a8ba40e05b5 + sha512sums = f5ea8d0c22b414bff87f5c6a5d1547804a307a71f2bc111e4fea362ad2656163219bec1632aaa9e1d9fa2bcaca27350bbdd296e3e51b9e384212de49311e5c6c sha512sums = c21aecaafec43bc1ce1ea3439667efb4c7ea5e54bfa87346a9ae9650de1e90c80174b1610a9216f936f693593816c9585c6be1875b3bd318d067079c06251e92 sha512sums = d7bef52e336bd908d24bf3a084a1fc480831d27a3c80af4c31872465b6a0ce39bdf298e620ae9865526c974465807559cc75610b835e60b4358f65a8a8ff159e @@ -9,7 +9,7 @@ pkgname=brave-bin pkgver=0.65.121 -pkgrel=1 +pkgrel=2 pkgdesc="Web browser that blocks ads and trackers by default (binary release)." arch=("x86_64") url="https://brave.com/download" @@ -28,7 +28,7 @@ source=("$pkgname-$pkgver.zip::https://github.com/brave/brave-browser/releases/d options=(!strip) sha512sums=("34d4e63610ef1e106f2071101299d5d33b6394d5a564c5b1e9cbbea16200bb11d665a99b81f6abee87dff9fba805bdc311c357d5b4beb7f34553bb3b3fc9af86" "b8823586fead21247c8208bd842fb5cd32d4cb3ca2a02339ce2baf2c9cb938dfcb8eb7b24c95225ae625cd0ee59fbbd8293393f3ed1a4b45d13ba3f9f62a791f" - "20b010e199127fa185da2e78eb97724a1b4d6d279c79b87bb0901ceb832d19ea755485c9039d06d92e6ffd686683990cd1939dc78f37859a798f4a8ba40e05b5" + "f5ea8d0c22b414bff87f5c6a5d1547804a307a71f2bc111e4fea362ad2656163219bec1632aaa9e1d9fa2bcaca27350bbdd296e3e51b9e384212de49311e5c6c" "c21aecaafec43bc1ce1ea3439667efb4c7ea5e54bfa87346a9ae9650de1e90c80174b1610a9216f936f693593816c9585c6be1875b3bd318d067079c06251e92" "d7bef52e336bd908d24bf3a084a1fc480831d27a3c80af4c31872465b6a0ce39bdf298e620ae9865526c974465807559cc75610b835e60b4358f65a8a8ff159e") noextract=("$pkgname-$pkgver.zip") @@ -50,6 +50,4 @@ package() { install -Dm0644 "logo.png" "$pkgdir/usr/share/pixmaps/brave.png" install -Dm0664 -t "$pkgdir/usr/share/licenses/$pkgname" "MPL2" mv "$pkgdir/usr/lib/$pkgname/"{LICENSE,LICENSES.chromium.html} "$pkgdir/usr/share/licenses/$pkgname" - - ln -s /usr/lib/PepperFlash "$pkgdir/usr/lib/pepperflashplugin-nonfree" } diff --git a/brave-bin.sh b/brave-bin.sh index 5244555dda2d..31ee9e904e04 100644 --- a/brave-bin.sh +++ b/brave-bin.sh @@ -1,8 +1,27 @@ #!/usr/bin/env bash +XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}" +BRAVE_USE_FLASH_IF_AVAILABLE="${BRAVE_USE_FLASH_IF_AVAILABLE:-true}" + +# Allow users to override command-line options +BRAVE_USER_FLAGS_FILE="$XDG_CONFIG_HOME/brave-flags.conf" +if [[ -f $USER_FLAGS_FILE ]]; then + USER_FLAGS="$(cat $USER_FLAGS_FILE)" +fi if [[ ! (-r /proc/sys/kernel/unprivileged_userns_clone && $(< /proc/sys/kernel/unprivileged_userns_clone) == 1 && -n $(zcat /proc/config.gz | grep CONFIG_USER_NS=y) ) ]]; then - >&2 echo "User namespaces are not detected as enabled on your system, brave will run with the sandbox disabled" - FLAG="--no-sandbox" + >&2 echo "User namespaces are not detected as enabled on your system, Brave will run with the sandbox disabled" + SANDBOX_FLAG="--no-sandbox" +fi + +BRAVE_PEPPER_FLASH_SO=${BRAVE_PEPPER_FLASH_SO:-/usr/lib/PepperFlash/libpepflashplayer.so} +if [[ -f $BRAVE_PEPPER_FLASH_SO && $BRAVE_USE_FLASH_IF_AVAILABLE == "true" ]]; then + BRAVE_PEPPER_FLASH_VERSION=${BRAVE_PEPPER_FLASH_VERSION:-$(LANG=C pacman -Qi pepper-flash | grep Version | sed 's/.*: //; s/\-[^-]*$//')} + PEPPER_FLASH_FLAG="--ppapi-flash-path=$BRAVE_PEPPER_FLASH_SO --ppapi-flash-version=$BRAVE_PEPPER_FLASH_VERSION" fi -exec "/usr/lib/brave-bin/brave" $@ $FLAG +# OR true included because Brave currently segfaults when a second +# window is opened from running the brave binary. +# GH Issue: https://github.com/brave/brave-browser/issues/4142 +# NOTE: Replace with an exec call once we don't have to work around +# this bug by having the browser be a subprocess of this script +/usr/lib/brave-bin/brave $@ $SANDBOX_FLAG $PEPPER_FLASH_FLAG $USER_FLAGS || true |