summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7caf2048f1ba05782b38e9917e2ec7bd07f4c65a (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
59
60
61
62
63
64
65
66
67
68
# Maintainer: Benoit Brummer (Trougnouf) <trougnouf@gmail.com>
pkgname=cfait-git
_pkgname=cfait
pkgver=974.9e96293.rolling
pkgrel=1
pkgdesc="Powerful, fast and elegant task / TODO manager. (GUI & TUI, CalDAV & local, git version)"
arch=('x86_64')
url="https://codeberg.org/trougnouf/cfait"
license=('GPL-3.0-or-later')
depends=(
    'gcc-libs'
    'glibc'
    'fontconfig'        # Required by the GUI for system font discovery
    'libxkbcommon'      # Required by the GUI for keyboard handling (especially on Wayland)
    'vulkan-icd-loader' # Required by the GUI to load Vulkan drivers for rendering
    'org.freedesktop.secrets'  # Required to store the CalDAV password
)
makedepends=('cargo' 'pkgconf' 'git')  # git is needed as long as libdav > 0.10.3 is not released
# Optional dependencies for the GUI and specific features
optdepends=(
    'vulkan-driver: Required by the GUI for hardware-accelerated rendering'
    'wayland: Required by the GUI for Wayland session support'
    'libx11: Required by the GUI for X11 session support'
    'libxcursor: Required by the GUI for X11 cursor support'
    'libxi: Required by the GUI for X11 input devices'
    'libxrandr: Required by the GUI for X11 monitor layout support'
    'xdg-desktop-portal: Required by the GUI for the file picker (export/import)'
)
conflicts=("$_pkgname")
source=("$_pkgname::git+$url.git")
sha256sums=('SKIP')
replaces=('rustycal' 'rustache' 'fairouille')
options=('!lto' '!strip' '!debug')
provides=('cfait-tui' 'cfait-gui' "$_pkgname")

pkgver() {
  cd "$_pkgname"
  # Get the commit hash and count
  local commit_hash=$(git rev-parse --short HEAD)
  local commit_count=$(git rev-list --count HEAD)
  # Get the latest tag (if any)
  local latest_tag=$(git describe --tags --abbrev=0 2>/dev/null || echo "rolling")

  # Format: <commit_count>.<commit_hash>.<tag>
  # If no tag, use "rolling" as the tag
  echo "$commit_count.$commit_hash.${latest_tag#v}"
}

build() {
  cd "$_pkgname"
  # Skip compiling the problematic fallback RNG.
  # Linux's native getrandom() is used instead.
  export AWS_LC_SYS_NO_JITTER_ENTROPY=1
  cargo build --release --features gui
}

package() {
  cd "$_pkgname"

  install -Dm755 "target/release/cfait" "$pkgdir/usr/bin/cfait"
  install -Dm755 "target/release/cfait-gui" "$pkgdir/usr/bin/cfait-gui"

  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"

  install -Dm644 "assets/cfait.desktop" "$pkgdir/usr/share/applications/cfait.desktop"
  install -Dm644 "assets/cfait.svg" "$pkgdir/usr/share/icons/hicolor/scalable/apps/cfait.svg"
}