summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 5fdf81adbfa1f5a1355f1c7269c6073f9d6ed4e6 (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
# Maintainer:  <reg-archlinux AT klein DOT tuxli DOT ch> 

pkgname=mabel-git
_pkgname=mabel
pkgver=r266.1e74a44
pkgrel=1
pkgdesc="A fancy BitTorrent client for the terminal"
arch=('any')
url="https://github.com/smmr-software/mabel.git"
license=('GPL3')
depends=('ttf-nerd-fonts-symbols')
makedepends=('git' 'go')
provides=('mabel')
conflicts=('mabel')
source=(git+${url})
sha256sums=('SKIP')
build() {
  cd "${srcdir}"/"${_pkgname}"
  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"
  BUILD_DATE=$(date '+%Y-%m-%d %H:%M:%S')
  go build -o build/${_pkgname} -ldflags="-X 'main.buildVersion=${pkgver}' -X 'main.buildDate=${BUILD_DATE}'" ./
}

pkgver() {
  cd "${_pkgname}"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

package() {
  cd "${srcdir}"/"${_pkgname}"
  mkdir -p "$pkgdir"/usr/bin/
  install -Dm644 "COPYING" "${pkgdir}/usr/share/licenses/${_pkgname}/LICENSE"
  install -Dm755 build/"${_pkgname}" "${pkgdir}"/usr/bin/"${_pkgname}"
  install -Dm644 README.md "${pkgdir}"/usr/share/doc/"${_pkgname}"/README.md
}