summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 314c3303571be90578aa28076a06e986d4a64f6e (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
# Maintainer: Martchus <martchus@gmx.net>

# All my PKGBUILDs are managed at https://github.com/Martchus/PKGBUILDs where
# you also find the URL of a binary repository.

_reponame=sadav
pkgname=$_reponame-git
pkgver=61.4d9feb3
sover=1
pkgrel=1
arch=('i686' 'x86_64' 'armv6h' 'armv7h' 'aarch64')
pkgdesc='CalDAV/CardDAV client library and command line CalDAV/CardDAV client'
license=('GPL')
depends=('libdate-tz.so' 'libcurl.so' 'pugixml' 'libnotify.so')
checkdepends=('catch2')
makedepends=('cmake' 'git' 'ninja')
provides=('libsadav.so' 'cadav')
conflicts=($_reponame)
url="https://codeberg.org/trill/${_reponame}"
source=("${_reponame}::git+https://codeberg.org/trill/sadav.git")
sha256sums=('SKIP')

pkgver() {
  cd "${_reponame}"
  echo "$(git rev-list --count HEAD).$(git rev-parse --short HEAD)"
}

prepare() {
  cd "${_reponame}"
  echo "set_target_properties(sadav PROPERTIES SOVERSION r$sover)" >> libsadav/CMakeLists.txt
  echo 'install(TARGETS sadav)' >> libsadav/CMakeLists.txt
}

build() {
  cmake -G Ninja -S "${_reponame}" -B build \
    -DCMAKE_BUILD_TYPE:STRING='Release' \
    -DCMAKE_INSTALL_PREFIX:PATH='/usr' \
    -DBUILD_SHARED_LIBS:BOOL=ON
  cmake --build build
}

check() {
  ctest --test-dir build
}

package() {
  DESTDIR="${pkgdir}" cmake --install build
  install -D --target-directory="$pkgdir/usr/include/libsadav" "${_reponame}"/libsadav/*.h
}