summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8c1ebda72343cd00ea6cecd26c7cfd08df917d1d (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: Your Name <your@email>
# Contributor: lingzolabs

_pkgbase=vibetype
pkgbase=$_pkgbase
pkgname=("$_pkgbase" "$_pkgbase-fcitx5" "$_pkgbase-ibus")
pkgver=0.1.4
pkgrel=1
pkgdesc="Voice-to-text input method backend with IBus and Fcitx5 frontends"
arch=('x86_64')
url="https://github.com/lingzolabs/vibetype"
license=('MIT')
depends=('gcc-libs' 'glibc' 'python' 'curl' 'alsa-utils')
makedepends=('cmake' 'git' 'ninja' 'openssl' 'fcitx5')
optdepends=('wl-clipboard: Wayland clipboard support'
  'xclip: X11 clipboard support'
  'xdotool: X11 key simulation for auto-paste')
source=("$_pkgbase::git+https://github.com/lingzolabs/vibetype.git#tag=v$pkgver")
sha256sums=('SKIP')

# The three package variants are mutually exclusive — each includes a full
# backend + CLI. Installing more than one would create file conflicts.
#
# Build picks up Fcitx5Core automatically when fcitx5 is present (makedepends).
# The ibus frontend is pure Python, no C++ build needed.

pkgver() {
  cd "$srcdir/$_pkgbase"
  git describe --tags --abbrev=0 | sed 's/^v//'
}

build() {
  cd "$srcdir/$_pkgbase"
  cmake -B build -G Ninja \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DBUILD_FCITX5_ADDON=ON \
    -DCPACK_PACKAGE_VERSION="$pkgver"
  cmake --build build -j"$(nproc)"
}

package_vibetype() {
  pkgdesc="Voice-to-text input method backend and CLI (standalone, no input method frontend)"

  DESTDIR="$pkgdir" cmake --install "$srcdir/$_pkgbase/build" --component cli
}

package_vibetype-fcitx5() {
  pkgdesc="Voice-to-text input method backend with Fcitx5 frontend"
  depends=('gcc-libs' 'glibc' 'python' 'curl' 'alsa-utils' 'fcitx5')
  conflicts=("$_pkgbase" "$_pkgbase-ibus")
  provides=("$_pkgbase")

  DESTDIR="$pkgdir" cmake --install "$srcdir/$_pkgbase/build" --component cli
  DESTDIR="$pkgdir" cmake --install "$srcdir/$_pkgbase/build" --component fcitx5
}

package_vibetype-ibus() {
  pkgdesc="Voice-to-text input method backend with IBus frontend"
  depends=('gcc-libs' 'glibc' 'python' 'curl' 'alsa-utils' 'ibus' 'python-gobject' 'gtk3')
  conflicts=("$_pkgbase" "$_pkgbase-fcitx5")
  provides=("$_pkgbase")

  DESTDIR="$pkgdir" cmake --install "$srcdir/$_pkgbase/build" --component cli
  DESTDIR="$pkgdir" cmake --install "$srcdir/$_pkgbase/build" --component ibus
}

# vim: ts=2 sw=2 et: