summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b33e474bc1c8cfd6cf899ace28ca26680d7f141b (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
# Maintainer: Mohammadreza Abdollahzadeh <morealaz at gmail dot com>
pkgname='warp-plus-git'
pkgver=1.1.3.r1.69977d9
pkgrel=1
pkgdesc="An open-source implementation of Cloudflare's Warp, enhanced with Psiphon integration (GitHub Version)."
arch=('x86_64')
url="https://github.com/bepass-org/warp-plus"
license=('MIT')
makedepends=('git' 'go')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
install="${pkgname%-git}.install"
source=("${pkgname%-git}::git+${url}.git"
		"${pkgname%-git}.service")

sha256sums=('SKIP'
            '5ada20e3b2871c0921dfe36d721914fa02fe2f4892919160daa71992e91be49b')
pkgver() {
    cd "${pkgname%-git}"
    printf "%s" "$(git describe --long --tags | sed 's/^v//;s/\([^-]*-\)g/r\1/;s/-/./g')"
}

prepare() {
    cd "${pkgname%-git}"
    sed -i 's|"gool": false|"gool": true|' example_config.json
    go mod tidy
}

build() {
    cd "${pkgname%-git}"
    export CGO_CPPFLAGS="${CPPFLAGS}"
    export CGO_CFLAGS="${CFLAGS}"
    export CGO_CXXFLAGS="${CXXFLAGS}"
    export CGO_LDFLAGS="${LDFLAGS}"
    export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
    go build .
}

package() {
    cd "${pkgname%-git}"
	install -Dm 755 warp-plus "${pkgdir}/usr/bin/${pkgname%-git}"
	install -D -t "${pkgdir}/usr/lib/systemd/system/" -m 644 ../"${pkgname%-git}.service"
	install -Dm 644 example_config.json "${pkgdir}/etc/${pkgname%-git}/config.json"
	install -Dm 644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname%-git}/LICENSE"
}
# vim:set ts=4 sw=4 et: