blob: 97479ca3e6eecdfe253a51806e3039e8062039e3 (
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
|
# Maintainer: ZorudaRinku <zorudarinku@gmail.com>
pkgname=openchatbox
pkgver=0.0.7
pkgrel=1
pkgdesc="Desktop GUI for sending customized OSC chat messages to VRChat"
arch=('any')
url="https://github.com/ZorudaRinku/OpenChatbox"
license=('MIT')
depends=(
'python'
'pyside6'
'python-psutil'
'python-websockets'
'hicolor-icon-theme'
)
optdepends=(
'playerctl: <song>, <artist>, <nowplaying>, <song_progress> tokens'
'xdotool: <window> token on X11'
'kdotool: <window> token on KDE Wayland'
'wmctrl: <wm> token'
'wireless_tools: <network> token fallback (when NetworkManager is not in use)'
'libpulse: <volume> token (provides pactl; works against PulseAudio or PipeWire)'
)
makedepends=(
'python-pip'
'qt6-base'
'imagemagick'
)
source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
sha256sums=('7193287daf1882551dab40b61f14070496318fb9c97f0d0ecd78ce9a5900a88b')
build() {
cd "OpenChatbox-$pkgver"
# Tag is source of truth; rewrite in-tree placeholders.
sed -i -E "s/^version = .*/version = \"$pkgver\"/" pyproject.toml
sed -i -E "s/^VERSION = .*/VERSION = \"$pkgver\"/" app.py
/usr/lib/qt6/rcc -g python resources.qrc -o resources_rc.py
# Install app source into a staging lib dir.
PYTHONDONTWRITEBYTECODE=1 python -m pip install \
--target="$srcdir/lib" \
--no-compile \
--no-warn-script-location \
--no-deps \
.
# Bundle the three Python deps not available in Arch repos.
PYTHONDONTWRITEBYTECODE=1 python -m pip install \
--target="$srcdir/lib" \
--no-compile \
--no-warn-script-location \
'bleak>=3.0' 'python-osc>=1.9' 'tomli_w>=1.2'
}
package() {
cd "OpenChatbox-$pkgver"
install -dm755 "$pkgdir/usr/lib/$pkgname"
cp -a "$srcdir/lib/." "$pkgdir/usr/lib/$pkgname/"
# pip install --target leaves a `bin/` sidecar we don't use
rm -rf "$pkgdir/usr/lib/$pkgname/bin"
# direct_url.json records the build-time srcdir path but unused
rm -f "$pkgdir/usr/lib/$pkgname/$pkgname-$pkgver.dist-info/direct_url.json"
install -dm755 "$pkgdir/usr/bin"
cat > "$pkgdir/usr/bin/$pkgname" <<EOF
#!/bin/sh
exec /usr/bin/python -c "import sys; sys.path.insert(0, '/usr/lib/$pkgname'); from main import main; main()" "\$@"
EOF
chmod 755 "$pkgdir/usr/bin/$pkgname"
install -Dm644 openchatbox.desktop "$pkgdir/usr/share/applications/$pkgname.desktop"
convert OpenChatbox.png -resize 512x512 "$srcdir/openchatbox.png"
install -Dm644 "$srcdir/openchatbox.png" "$pkgdir/usr/share/icons/hicolor/512x512/apps/$pkgname.png"
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
|