archrelease: copy trunk to community-any
[ArchLinux/community.git] / wgcf / trunk / PKGBUILD
blobe282ea8d92830c2fc36c977a29d27c4387546057
1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
2 # Contributor: w0rty <mawo97 at gmail.com>
4 pkgname=wgcf
5 pkgver=2.2.16
6 pkgrel=1
7 pkgdesc='Generate WireGuard profile from Cloudflare Warp account'
8 arch=('x86_64')
9 url="https://github.com/ViRb3/wgcf"
10 license=('MIT')
11 makedepends=('go')
12 depends=('glibc')
13 source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/v${pkgver}.tar.gz")
14 sha256sums=('f990bf8f08bab1390f2357324a79724aee40970845bef16b2281a5ca6b0c3b88')
16 prepare(){
17   cd "$pkgname-$pkgver"
18   mkdir -p build/
21 build() {
22   export GOPATH="$srcdir"/gopath
23   cd "$pkgname-$pkgver"
24   # Buildflags according to https://wiki.archlinux.org/index.php/Go_package_guidelines#Flags_and_build_options
25   export CGO_CPPFLAGS="${CPPFLAGS}"
26   export CGO_CFLAGS="${CFLAGS}"
27   export CGO_CXXFLAGS="${CXXFLAGS}"
28   export CGO_LDFLAGS="${LDFLAGS}"
29   go build -o build -trimpath -buildmode=pie -ldflags "-linkmode=external -extldflags \"${LDFLAGS}\" -s -w" -modcacherw
32 package() {
33   cd "$pkgname-$pkgver"
34   install -Dm755 build/$pkgname "$pkgdir"/usr/bin/$pkgname
35   install -Dm644 $srcdir/$pkgname-$pkgver/LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"