blob: ad9c5f2167789069d4ac13a1f4032ae4797ac6e3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
# Maintainer: mpsijm
pkgname=browsers-bin
pkgver=0.5.3
pkgrel=1
pkgdesc="Open the right browser at the right time"
arch=("x86_64")
url="https://browsers.software"
license=("Apache" "MIT")
provides=("browsers=$pkgver")
conflicts=("browsers-git")
# Make source file name unique: https://wiki.archlinux.org/title/PKGBUILD#source
source=("browsers_linux-$pkgver.tar.xz::https://github.com/Browsers-software/browsers/releases/download/$pkgver/browsers_linux.tar.xz")
sha256sums=("ad1734e992a9a403c8af5d3bc8fa5081bc972f25c2e10b631de530b014a67655")
package() {
bsdtar -xf "$srcdir/browsers_linux-$pkgver.tar.xz" -C "$srcdir"
# install.sh assumes it's installing in /usr/local, so replace paths by $pkgdir/usr
sed -Ei "s|=\"/usr(\/local)?|=\"$pkgdir\/usr|" "$srcdir/install.sh"
mkdir -p "$pkgdir/usr/share/icons/hicolor"
# Run install.sh with updated root and --skip-desktop-database.
# Since install.sh would (by default) update the mime database, this would generate conflicts in mimeinfo.cache,
# so we move this to the post_install() instead. See https://github.com/Browsers-software/browsers/pull/129#issuecomment-1919579765
XDG_DATA_DIRS="$pkgdir/usr/share" "$srcdir/install.sh" --system --skip-desktop-database
# Since we replaced the TARGET_INSTALL_BINARY_PATH in install.sh, we should update any references to it
sed -Ei "s|$pkgdir||" "$pkgdir/usr/share/applications/software.Browsers.desktop" "$pkgdir/usr/share/xfce4/helpers/software.Browsers.desktop"
ln -snf /usr/share/software.Browsers/bin/browsers "$pkgdir/usr/bin/browsers"
}
# Thanks to https://bbs.archlinux.org/viewtopic.php?pid=1544072#p1544072
post_install() {
xdg-icon-resource forceupdate --theme hicolor &>/dev/null
update-mime-database usr/share/mime &>/dev/null
update-desktop-database -q
}
post_upgrade() {
post_install "$1"
}
post_remove() {
post_install "$1"
}
|