Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions scripts/build-deb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ PY
)"
SITE="$ROOT/.venv/lib/python${PYVER}/site-packages"

if [[ ! -d "$SITE/androidtvremote2" || ! -d "$SITE/aiofiles" ]]; then
if [[ ! -d "$SITE/androidtvremote2" || ! -d "$SITE/aiofiles" || ! -d "$SITE/google" ]]; then
echo "Missing bundled Python dependencies in .venv. Run: python -m pip install -e ." >&2
exit 1
fi
Expand All @@ -31,6 +31,11 @@ mkdir -p "$PKGROOT/DEBIAN" "$PKGROOT/opt/tellykeys/lib" "$PKGROOT/usr/bin" "$PKG
cp -a "$ROOT/src/tellykeys" "$PKGROOT/opt/tellykeys/lib/"
cp -a "$SITE/androidtvremote2" "$PKGROOT/opt/tellykeys/lib/"
cp -a "$SITE/aiofiles" "$PKGROOT/opt/tellykeys/lib/"
# Bundle protobuf so we don't depend on the distro's (often too old) build.
# Strip the arch-specific C extension and force the pure-Python implementation
# (see launcher below) so the package stays Architecture: all.
cp -a "$SITE/google" "$PKGROOT/opt/tellykeys/lib/"
find "$PKGROOT/opt/tellykeys/lib/google" -name '*.so' -delete
cp "$ROOT/packaging/linux/tellykeys.desktop" "$PKGROOT/usr/share/applications/"
cp "$ROOT/packaging/linux/tellykeys-tray.desktop" "$PKGROOT/usr/share/applications/"
cp "$ROOT/assets/tellykeys.svg" "$PKGROOT/usr/share/icons/hicolor/scalable/apps/tellykeys.svg"
Expand All @@ -39,6 +44,9 @@ cp "$ROOT/README.md" "$PKGROOT/usr/share/doc/tellykeys/README.md"
cat > "$PKGROOT/usr/bin/tellykeys" <<'EOF'
#!/usr/bin/env bash
export PYTHONPATH="/opt/tellykeys/lib${PYTHONPATH:+:$PYTHONPATH}"
# Use the bundled pure-Python protobuf (the C extension is stripped to keep the
# package architecture-independent).
export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION="${PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION:-python}"
exec python3 -m tellykeys.app "$@"
EOF
chmod 0755 "$PKGROOT/usr/bin/tellykeys"
Expand All @@ -50,7 +58,7 @@ Section: utils
Priority: optional
Architecture: all
Maintainer: GaimsDevSoftware <noreply@gaims.dev>
Depends: python3 (>= 3.11), python3-gi, gir1.2-gtk-3.0, avahi-utils, python3-cryptography, python3-protobuf, pipewire-bin | pulseaudio-utils
Depends: python3 (>= 3.11), python3-gi, gir1.2-gtk-3.0, avahi-utils, python3-cryptography, pipewire-bin | pulseaudio-utils
Recommends: android-tools-adb
Description: Google TV and Android TV remote for Linux
TellyKeys is a GTK desktop remote for Google TV and Android TV with pairing,
Expand Down
12 changes: 10 additions & 2 deletions scripts/build-rpm
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ command -v rpmbuild >/dev/null 2>&1 || {
exit 1
}

if [[ ! -d "$SITE/androidtvremote2" || ! -d "$SITE/aiofiles" ]]; then
if [[ ! -d "$SITE/androidtvremote2" || ! -d "$SITE/aiofiles" || ! -d "$SITE/google" ]]; then
echo "Missing bundled Python dependencies in .venv. Run: python -m pip install -e ." >&2
exit 1
fi
Expand All @@ -36,6 +36,12 @@ mkdir -p "$PAYLOAD/opt/tellykeys/lib" "$PAYLOAD/usr/bin" "$PAYLOAD/usr/share/app
cp -a "$ROOT/src/tellykeys" "$PAYLOAD/opt/tellykeys/lib/"
cp -a "$SITE/androidtvremote2" "$PAYLOAD/opt/tellykeys/lib/"
cp -a "$SITE/aiofiles" "$PAYLOAD/opt/tellykeys/lib/"
# Bundle protobuf: Fedora's python3-protobuf (3.19.6) is too old for the
# generated *_pb2.py in androidtvremote2 (needs the >=3.20 'builder' module).
# Strip the arch-specific C extension and force the pure-Python implementation
# (see launcher below) so the package stays noarch.
cp -a "$SITE/google" "$PAYLOAD/opt/tellykeys/lib/"
find "$PAYLOAD/opt/tellykeys/lib/google" -name '*.so' -delete
cp "$ROOT/packaging/linux/tellykeys.desktop" "$PAYLOAD/usr/share/applications/"
cp "$ROOT/packaging/linux/tellykeys-tray.desktop" "$PAYLOAD/usr/share/applications/"
cp "$ROOT/assets/tellykeys.svg" "$PAYLOAD/usr/share/icons/hicolor/scalable/apps/tellykeys.svg"
Expand All @@ -44,6 +50,9 @@ cp "$ROOT/README.md" "$PAYLOAD/usr/share/doc/tellykeys/README.md"
cat > "$PAYLOAD/usr/bin/tellykeys" <<'EOF'
#!/usr/bin/env bash
export PYTHONPATH="/opt/tellykeys/lib${PYTHONPATH:+:$PYTHONPATH}"
# Use the bundled pure-Python protobuf (the C extension is stripped to keep the
# package noarch).
export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION="${PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION:-python}"
exec python3 -m tellykeys.app "$@"
EOF
chmod 0755 "$PAYLOAD/usr/bin/tellykeys"
Expand All @@ -63,7 +72,6 @@ Requires: python3-gobject
Requires: gtk3
Requires: avahi-tools
Requires: python3-cryptography
Requires: python3-protobuf
Requires: pipewire-utils
Recommends: android-tools

Expand Down