summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b078896112a8391f321f0a156f8b54cc7d0312d0 (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
47
48
49
50
51
52
53
54
55
56
57
58
# Maintainer:
# Contributor: Zanny <lordzanny@gmail.com>
# Contributor: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
# Contributor: Antonio Rojas <arojas@archlinux.org>

_pkgname="kaccounts-providers"
pkgname="$_pkgname-git"
pkgver=23.08.3.r30.gc1472cd
pkgrel=1
pkgdesc='Online account providers for the KAccounts system'
url='https://invent.kde.org/network/kaccounts-providers'
license=('GPL')
arch=(x86_64)

depends=(
  'kaccounts-integration'
)
makedepends=(
  'extra-cmake-modules'
  'git'
  'intltool'
)

provides=("$_pkgname=${pkgver%%.r*}")
conflicts=("$_pkgname")

_pkgsrc="$_pkgname"
source=("$_pkgsrc"::"git+$url.git")
sha256sums=('SKIP')

pkgver() {
  cd "$_pkgsrc"

  local _tag=$(git tag | grep -Ev '\.[0-9][0-9]$' | sort -V | tail -1)
  local _revision=$(git rev-list --count $_tag..HEAD)
  local _hash=$(git rev-parse --short HEAD)

  printf '%s.r%s.g%s' \
    "${_tag#v}" \
    "$_revision" \
    "$_hash"
}

build() {
  local _cmake_options=(
    -B build
    -S "$_pkgsrc"
    -DBUILD_TESTING=OFF
    -Wno-dev
  )

  cmake "${_cmake_options[@]}"
  cmake --build build
}

package() {
  DESTDIR="${pkgdir:?}" cmake --install build
}