summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c53bedd8e4f80a3ee531302fc4ae12970c87ef49 (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
# Maintainer: gilcu3 <gilcu3 [at] gmail [dot] com>

_pkgname=gpodder2go
pkgname=${_pkgname}-git
pkgver=0.1.2.r43.20c230d
pkgrel=1
pkgdesc='simple self-hosted, drop-in replacement for gpodder/mygpo'
arch=('x86_64')
url="https://github.com/oxtyped/gpodder2go"
license=('AGPL')
makedepends=('go')
source=("git+$url.git")
sha256sums=('SKIP')

pkgver() {
  cd $_pkgname
  TAG=$(git describe --tags $(git rev-list --tags --max-count=1) | sed 's/^v//')
  COMMIT=$(git rev-parse --short HEAD)
  REVISION=$(git rev-list --count HEAD)
  printf "%s.r%s.%s" "$TAG" "$REVISION" "$COMMIT"
}

prepare(){
    cd "$_pkgname"
    mkdir -p build
}

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


package() {
  cd "$_pkgname"
  install -Dm755 build/$_pkgname "$pkgdir"/usr/bin/$_pkgname
}