blob: 2ac4e7bfe895a57d532e245f08eb9bfebdffa621 (
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
55
56
57
58
59
60
61
62
63
64
|
# Maintainer: Mikuro Kagamine <mikurok@forgecrushing.com>
pkgname=browsh
pkgver=1.4.13
pkgrel=1
pkgdesc='A fully-modern text-based browser, rendering to TTY and browsers'
arch=('x86_64' 'i686' 'arm' 'armv6h' 'armv7h' 'aarch64')
url='https://www.brow.sh'
license=('LGPL2.1')
depends=('firefox>=57')
makedepends=('go' 'go-bindata' 'dep' 'git')
optdepends=('upx: compress binary')
conflicts=('browsh-bin' 'browsh-git')
options=('!strip')
noextract=("${pkgname}-${pkgver}-an.fx.xpi")
source=("https://github.com/${pkgname}-org/${pkgname}/archive/v${pkgver}.tar.gz"
"https://github.com/${pkgname}-org/${pkgname}/releases/download/v${pkgver}/${pkgname}-${pkgver}-an.fx.xpi")
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...
xpipath="$(mktemp -d)"
cp "${srcdir}/${pkgname}-${pkgver}-an.fx.xpi" "${xpipath}/${pkgname}.xpi"
if [ $(which upx 2>/dev/null) ]; then
_compress="-nocompress"
else
_compress=""; fi
go-bindata $_compress\
-prefix "${xpipath}"\
-pkg $pkgname\
-o "${_interfacer}/src/${pkgname}/webextension.go"\
"${xpipath}/${pkgname}.xpi"
rm -r "${xpipath}"
echo Install $pkgname dependencies...
dep ensure
}
build() {
export GOPATH="${srcdir}/.gopath"
export _interfacer="${GOPATH}/src/${pkgname}/interfacer"
cd "$_interfacer"
echo Build ${pkgname}...
go build -x\
-gcflags "all=-trimpath=${GOPATH}"\
-asmflags "all=-trimpath=${GOPATH}"\
-o "${srcdir}/${pkgname}" ./src/main.go
strip --strip-all "${srcdir}/${pkgname}"
if [ $(which upx 2>/dev/null) ]; then
echo Compressing ${pkgname} with UPX...
upx --best "${srcdir}/${pkgname}"; fi
}
package() {
install -Dm755 $pkgname "${pkgdir}/usr/bin/${pkgname}"
}
sha512sums=('35c2294cd976b4e22dd93543a0c0de282997e4ac9771fc571f6aa7c0db2dd1d93448600b3b2352877a9861e2883e4bbde927b077c9a6adc9aa38d85af53c5685'
'78544d56bbfa2608dff5290031ee0752ceda43281acee85f0bb9be89bc4415ed7a468fc2d3f075ccea3d8e8128643f9f3a8d7cdf354bd9d12453c357f88661fd')
|