summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 897db34ee8f7b137c3e8f5b88a150cd5c7dff23a (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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# Maintainer: Luca Steccanella <steccas at pm dot me>
pkgname=voxd-git
pkgver=r254.9c067c6
pkgrel=1
pkgdesc="Voice-typing/dictation app for Linux using local speech-to-text processing (git version)"
arch=('x86_64' 'aarch64')
url="https://github.com/jakovius/voxd"
license=('GPL-3.0-or-later')
depends=(
    'python>=3.9'
    'python-sounddevice'
    'python-pyqt6'
    'python-platformdirs'
    'python-yaml'
    'python-pyperclip'
    'python-psutil'
    'python-numpy'
    'python-requests'
    'python-tqdm'
    'python-pyqtgraph'
    'ffmpeg'
    'portaudio'
    'xclip'
    'xsel'
    'wl-clipboard'
    'xdotool'
    'ydotool'
    'xcb-util-cursor'
    'xcb-util-wm'
)
makedepends=(
    'python-build'
    'python-installer'
    'python-wheel'
    'python-hatchling'
    'git'
    'cmake'
    'gcc'
    'make'
)
optdepends=(
    'whisper.cpp: Local speech recognition backend'
    'llama.cpp: Local AI post-processing'
)
provides=('voxd')
conflicts=('voxd' 'voxd-bin')
source=(
    "voxd::git+https://github.com/jakovius/voxd.git"
)
sha256sums=('SKIP')

pkgver() {
    cd "$srcdir/voxd"
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
    cd "$srcdir/voxd"
    python -m build --wheel --no-isolation
}

package() {
    cd "$srcdir/voxd"
    
    python -m installer --destdir="$pkgdir" dist/*.whl
    
    # Install desktop launchers if they exist
    if [ -f "launcher_setup.sh" ]; then
        install -Dm755 launcher_setup.sh "$pkgdir/usr/share/$pkgname/launcher_setup.sh"
    fi
    
    # Install setup script for reference
    if [ -f "setup.sh" ]; then
        install -Dm755 setup.sh "$pkgdir/usr/share/$pkgname/setup.sh"
    fi
    
    # Install assets
    if [ -d "src/voxd/assets" ]; then
        install -dm755 "$pkgdir/usr/share/voxd/assets"
        cp -r src/voxd/assets/* "$pkgdir/usr/share/voxd/assets/"
    fi
    
    # Install default configs
    if [ -d "src/voxd/defaults" ]; then
        install -dm755 "$pkgdir/usr/share/voxd/defaults"
        cp -r src/voxd/defaults/* "$pkgdir/usr/share/voxd/defaults/"
    fi
    
    # Install README and LICENSE
    install -Dm644 README.md "$pkgdir/usr/share/doc/voxd/README.md"
    if [ -f "LICENSE" ]; then
        install -Dm644 LICENSE "$pkgdir/usr/share/licenses/voxd/LICENSE"
    fi
}