blob: dc23d04e16ba047b38346675e1f049571528071c (
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
46
47
48
49
50
51
52
53
54
|
# Maintainer: Mikuro Kagamine <mikurok@forgecrushing.com>
pkgname=browsh
pkgver=1.4.9
pkgrel=1
pkgdesc='A fully-modern text-based browser, rendering to TTY and browsers'
arch=('x86_64' 'i686')
url='https://www.brow.sh'
license=('LGPL2.1')
depends=('firefox>=57')
makedepends=('go' 'go-bindata' 'dep')
optdepends=('upx: compress binary')
conflicts=('browsh-bin' 'browsh-git')
noextract=("${pkgname}.xpi")
source=("https://github.com/${pkgname}-org/${pkgname}/archive/v${pkgver}.tar.gz"
"${pkgname}.xpi::https://github.com/${pkgname}-org/${pkgname}/releases/download/v1.4.9/${pkgname}-${pkgver}-an.fx.xpi")
sha512sums=('cda0af1e45d16405fc00804c3c95c16de830ab9e151dc93ae05f71f1c42b9d90baa02ceff9fb6d9e35d7c6dc294d0795e0be92be46f2b7be69296a28774f2340'
'3420427a7d5abd26962079a75cb1ddd1bfaa0f1ce03094802efcab7b0555ebe87c1b7f48a611e500547589e09e69b6eba9f7bad3225adb19155026470746570d')
prepare() {
## Go is fussy.
export GOPATH="${srcdir}/.gopath"
export _interfacer="${GOPATH}/src/${pkgname}/interfacer"
mkdir -p "${GOPATH}/src"
mv "${srcdir}/${pkgname}-${pkgver}" "${GOPATH}/src/${pkgname}"
cd "$_interfacer"
echo Turn webext into an embeddable binary...
if [ $(which upx) ]; then
_compress="-nocompress"; else
_compress=""; fi
go-bindata $_compress\
-prefix "${srcdir}"\
-pkg $pkgname\
-o "${_interfacer}/src/${pkgname}/webextension.go"\
"${srcdir}/${pkgname}.xpi"
echo Install $pkgname dependencies...
dep ensure
}
build() {
cd "$_interfacer"
echo Build ${pkgname}...
go build -x -gcflags "-trimpath=${srcdir}" -o "${srcdir}/${pkgname}" ./src/main.go
if [ $(which upx) ]; then
echo Compressing ${pkgname} with UPX...
strip --strip-all "${srcdir}/${pkgname}"
upx --best "${srcdir}/${pkgname}"; fi
}
package() {
install -Dm755 $pkgname ${pkgdir}/usr/bin/${pkgname}
}
|