summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaleb Maclennan2018-09-01 08:37:08 +0300
committerCaleb Maclennan2018-09-01 09:37:39 +0300
commit6aa93248bed47e4d275b4ba24563d2425f9a6802 (patch)
tree83d94c7f3be7c2fec8b32fc151b18a6f2fb10c9b
parent34c4edb15cf9d8c425bb0c47378bd7c3f1e15298 (diff)
downloadaur-6aa93248bed47e4d275b4ba24563d2425f9a6802.tar.gz
Move launcher from heredoc to repository and include relevant warning message
The warning message doesn't do much good in build(), the package may not be installed on the system that built it, and it's likely to get lost. Moving it to the launcher (where the same test was being run anyway) and outputting it on STDERR makes the whole thing a bit less of a monkey patch. Also this makes reviewing changes to the AUR package a lot easier, changes to the launcher can be easily reviewed in git.
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD24
-rw-r--r--brave-bin.sh8
3 files changed, 15 insertions, 21 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 72ffac54cc46..8c3ce506b7be 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = brave-bin
pkgdesc = A web browser that stops ads and trackers by default. Binary release.
pkgver = 0.23.105
- pkgrel = 1
+ pkgrel = 2
url = https://www.brave.com
arch = x86_64
license = custom:several
@@ -20,9 +20,11 @@ pkgbase = brave-bin
options = !strip
source = brave-bin-0.23.105.tar.bz2::https://github.com/brave/browser-laptop/releases/download/v0.23.105dev/brave.tar.bz2
source = MPL2::https://raw.githubusercontent.com/brave/browser-laptop/master/LICENSE.txt
+ source = brave-bin.sh
source = brave-bin.desktop
sha512sums = a2063278b2c1f9a50571caf6a3a7b550daff7c52803402680790cbce571a9a8fca95de58ed1579b920582b7cbd4dcd453a0dd8c645506bd773b28fbeb9ced7e2
sha512sums = b8823586fead21247c8208bd842fb5cd32d4cb3ca2a02339ce2baf2c9cb938dfcb8eb7b24c95225ae625cd0ee59fbbd8293393f3ed1a4b45d13ba3f9f62a791f
+ sha512sums = 9b027e4ff5fd8b718b3f3eb2b4a78deccd5f7cfd577943b9d4a2c63031231f3ca8f892fed8c1b4f9f35d148b9656501d0f054719b24d355adcca96bb4975d947
sha512sums = 400d345271a3c98be668e4aa08743d707647c92ee35951e937238ac07074119cfdb9601e1934cdf46014bd181b26ab0b568e4cab67c790efe53d029d8b0f9c55
pkgname = brave-bin
diff --git a/PKGBUILD b/PKGBUILD
index e5ab2bf10e2a..963def341913 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,7 +3,7 @@
pkgname=brave-bin
pkgver=0.23.105
-pkgrel=1
+pkgrel=2
pkgdesc='A web browser that stops ads and trackers by default. Binary release.'
arch=('x86_64')
url='https://www.brave.com'
@@ -15,37 +15,21 @@ provides=("${pkgname%-bin}" 'brave-browser')
conflicts=("${pkgname%-bin}")
source=("$pkgname-$pkgver.tar.bz2::https://github.com/brave/browser-laptop/releases/download/v${pkgver}dev/brave.tar.bz2"
'MPL2::https://raw.githubusercontent.com/brave/browser-laptop/master/LICENSE.txt'
+ "$pkgname.sh"
"$pkgname.desktop")
options=(!strip)
sha512sums=('a2063278b2c1f9a50571caf6a3a7b550daff7c52803402680790cbce571a9a8fca95de58ed1579b920582b7cbd4dcd453a0dd8c645506bd773b28fbeb9ced7e2'
'b8823586fead21247c8208bd842fb5cd32d4cb3ca2a02339ce2baf2c9cb938dfcb8eb7b24c95225ae625cd0ee59fbbd8293393f3ed1a4b45d13ba3f9f62a791f'
+ '9b027e4ff5fd8b718b3f3eb2b4a78deccd5f7cfd577943b9d4a2c63031231f3ca8f892fed8c1b4f9f35d148b9656501d0f054719b24d355adcca96bb4975d947'
'400d345271a3c98be668e4aa08743d707647c92ee35951e937238ac07074119cfdb9601e1934cdf46014bd181b26ab0b568e4cab67c790efe53d029d8b0f9c55')
_bdir=brave-linux-x64
-build() {
- 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
- echo "User namespaces are not detected as enabled on your system, brave will run with the sandbox disabled"
- fi
-}
-
package() {
install -d -m0755 "$pkgdir/usr/lib"
cp -a --reflink=auto "$_bdir" "$pkgdir/usr/lib/$pkgname"
- _launcher="$pkgdir/usr/bin/brave"
- install -Dm0755 /dev/stdin "$_launcher"<<END
-#!/usr/bin/sh
-
-FLAG="--no-sandbox"
-
-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
- FLAG=""
-fi
-
-exec "/usr/lib/${pkgname}/brave" "\$FLAG" -- "\$@"
-END
-
+ install -Dm0755 "$pkgname.sh" "$pkgdir/usr/bin/brave"
install -Dm0644 -t "$pkgdir/usr/share/applications" "$pkgname.desktop"
install -Dm0644 "$_bdir/resources/extensions/brave/img/braveAbout.png" "$pkgdir/usr/share/pixmaps/brave.png"
install -Dm0664 -t "$pkgdir/usr/share/licenses/$pkgname" "MPL2"
diff --git a/brave-bin.sh b/brave-bin.sh
new file mode 100644
index 000000000000..912d67ffc121
--- /dev/null
+++ b/brave-bin.sh
@@ -0,0 +1,8 @@
+#!/usr/bin/env sh
+
+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"
+fi
+
+exec "/usr/lib/brave-bin/brave" "$FLAG" -- "$@"