summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 24e7a26fadbdbc23a864a6b9ab03b84f865bf0d7 (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
# Maintainer: eNV25 <env252525@gmail.com>
# Contributor: w0rty <mawo97 at gmail.com>

pkgname=wgcf-git
pkgver=2.2.15.r0.140f983
pkgrel=1
pkgdesc='Generate WireGuard profile from Cloudflare Warp account'
arch=('x86_64' 'aarch64')
url='https://github.com/ViRb3/wgcf'
license=('MIT')
makedepends=('go' 'git')
conflicts=("${pkgname%-git}")
provides=("${pkgname%-git}")
source=('git+https://github.com/ViRb3/wgcf.git')
sha256sums=('SKIP')

pkgver() {
	cd "${pkgname%-git}/"
	git describe --long --tags | sed -E '
		s/([^-]*-)g/r\1/
		s/-/./g
		s/^v//
	'
}

build() {
	cd "${pkgname%-git}/"
	export GOPATH="$srcdir/gopath"
	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 -o builddir/wgcf
}

package() {
	cd "${pkgname%-git}/"
	install -Dm755 builddir/wgcf "$pkgdir/usr/bin/wgcf"
	install -Dm644 LICENSE "$pkgdir/usr/share/licenses/${pkgname%-git}/LICENSE"
}