summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2d70ce320707894832052dd749620535abb170b6 (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: Lukas Wölfer (domain is thasky) <aur at [domain] dot one>
pkgname=diaria-git
pkgver=0.2.0.r0.gefe59b9
pkgrel=1
pkgdesc='Diary entry manager'
url='https://github.com/corrodedHash/diaria'
source=("${pkgname}::git+https://github.com/corrodedHash/${pkgname%-git}#branch=main")
arch=('x86_64' 'i686')
license=('MIT')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")

makedepends=('git' 'cmake')
checkdepends=('python-pytest')
depends=('libsodium' 'glibc' 'gcc-libs' 'xz')
optdepends=()

sha256sums=('SKIP')

pkgver() {
  cd "${srcdir}/${pkgname}"
  # cutting off 'foo-' prefix that presents in the git tag
  git describe --long --tags --abbrev=7 | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  cd "${srcdir}/${pkgname}"

  cmake --preset=release-linux -B build/
}

build () {
  cd "${srcdir}/${pkgname}"

  cmake --build build/ --parallel `nproc --all`
}

check() {
  cd "${srcdir}/${pkgname}"
  cd test/end_to_end
  DIARIA="../../build/diaria" pytest
}

package() {
  cd "${srcdir}/${pkgname}"
  install -Dm0755 build/diaria "${pkgdir}/usr/bin/diaria"
  install -Dm644 "LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
  install -Dm644 "extra/zsh_completions" "${pkgdir}/usr/share/zsh/site-functions/_diaria"
}