142 lines
4 KiB
Bash
142 lines
4 KiB
Bash
# Copyright 1999-2025 Gentoo Authors
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
EAPI=8
|
|
|
|
PYTHON_COMPAT=( python3_{10..13} )
|
|
DISTUTILS_USE_PEP517=poetry
|
|
inherit distutils-r1 meson
|
|
|
|
DESCRIPTION="Python CLI and API for Meshtastic devices, with optional GUI client"
|
|
HOMEPAGE="https://github.com/meshtastic/python https://gitlab.com/kop316/gtk-meshtastic-client/"
|
|
|
|
GUI_PV="1.2" # Verify this version exists at https://gitlab.com/kop316/gtk-meshtastic-client/-/tags
|
|
SRC_URI="
|
|
https://github.com/meshtastic/python/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz
|
|
gui? ( https://gitlab.com/kop316/gtk-meshtastic-client/-/archive/${GUI_PV}/gtk-meshtastic-client-${GUI_PV}.tar.gz )
|
|
"
|
|
|
|
LICENSE="GPL-3"
|
|
SLOT="0"
|
|
KEYWORDS="~amd64 ~x86 ~arm64"
|
|
IUSE="gui minimal +qrcode +tun"
|
|
|
|
DEPEND="
|
|
${PYTHON_DEPS}
|
|
>=dev-python/bleak-1.0.1[${PYTHON_USEDEP}]
|
|
>=dev-python/packaging-25.0[${PYTHON_USEDEP}]
|
|
>=dev-python/platformdirs-4.3.8[${PYTHON_USEDEP}]
|
|
>=dev-python/protobuf-6.31.1[${PYTHON_USEDEP}]
|
|
>=dev-python/pyserial-3.5-r2[${PYTHON_USEDEP}]
|
|
>=dev-python/pyyaml-6.0.2[${PYTHON_USEDEP}]
|
|
>=dev-python/requests-2.32.4[${PYTHON_USEDEP}]
|
|
>=dev-python/setuptools-80.9.0-r1[${PYTHON_USEDEP}]
|
|
>=dev-python/tabulate-0.9.0-r1[${PYTHON_USEDEP}]
|
|
>=dev-python/build-1.2.2_p1-r2[${PYTHON_USEDEP}]
|
|
>=dev-python/dotmap-1.3.0[${PYTHON_USEDEP}]
|
|
>=dev-python/pypubsub-4.0.3[${PYTHON_USEDEP}]
|
|
!minimal? ( dev-python/print-color[${PYTHON_USEDEP}] )
|
|
qrcode? ( >=dev-python/pyqrcode-1.2.1[${PYTHON_USEDEP}] )
|
|
tun? ( >=dev-python/pytap2-2.3.0[${PYTHON_USEDEP}] )
|
|
gui? (
|
|
dev-libs/gobject-introspection
|
|
gui-libs/libadwaita[introspection]
|
|
>=gui-libs/gtk-4.10:4[introspection]
|
|
x11-libs/pango[introspection]
|
|
media-libs/libshumate[introspection]
|
|
$(python_gen_cond_dep '
|
|
dev-python/pygobject[${PYTHON_USEDEP}]
|
|
dev-python/dotmap[${PYTHON_USEDEP}]
|
|
dev-python/pyqrcode[${PYTHON_USEDEP}]
|
|
')
|
|
)
|
|
"
|
|
|
|
RDEPEND="
|
|
${PYTHON_DEPS}
|
|
>=dev-python/bleak-1.0.1[${PYTHON_USEDEP}]
|
|
>=dev-python/packaging-25.0[${PYTHON_USEDEP}]
|
|
>=dev-python/platformdirs-4.3.8[${PYTHON_USEDEP}]
|
|
>=dev-python/protobuf-6.31.1[${PYTHON_USEDEP}]
|
|
>=dev-python/pyserial-3.5-r2[${PYTHON_USEDEP}]
|
|
>=dev-python/pyyaml-6.0.2[${PYTHON_USEDEP}]
|
|
>=dev-python/requests-2.32.4[${PYTHON_USEDEP}]
|
|
>=dev-python/setuptools-80.9.0-r1[${PYTHON_USEDEP}]
|
|
>=dev-python/tabulate-0.9.0-r1[${PYTHON_USEDEP}]
|
|
>=dev-python/build-1.2.2_p1-r2[${PYTHON_USEDEP}]
|
|
>=dev-python/dotmap-1.3.0[${PYTHON_USEDEP}]
|
|
>=dev-python/pypubsub-4.0.3[${PYTHON_USEDEP}]
|
|
!minimal? ( dev-python/print-color[${PYTHON_USEDEP}] )
|
|
qrcode? ( >=dev-python/pyqrcode-1.2.1[${PYTHON_USEDEP}] )
|
|
tun? ( >=dev-python/pytap2-2.3.0[${PYTHON_USEDEP}] )
|
|
gui? (
|
|
dev-libs/glib:2
|
|
x11-libs/gdk-pixbuf:2
|
|
dev-libs/gobject-introspection
|
|
gui-libs/libadwaita[introspection]
|
|
>=gui-libs/gtk-4.10:4[introspection]
|
|
>=x11-libs/pango-1.44.0[introspection]
|
|
media-libs/libshumate[introspection]
|
|
$(python_gen_cond_dep '
|
|
>=dev-python/pygobject-3.36[${PYTHON_USEDEP},cairo]
|
|
dev-python/dotmap[${PYTHON_USEDEP}]
|
|
')
|
|
)
|
|
"
|
|
|
|
BDEPEND="
|
|
${PYTHON_DEPS}
|
|
dev-python/poetry-core[${PYTHON_USEDEP}]
|
|
dev-python/wheel[${PYTHON_USEDEP}]
|
|
dev-python/installer[${PYTHON_USEDEP}]
|
|
gui? (
|
|
$(python_gen_cond_dep '
|
|
dev-python/meson-python[${PYTHON_USEDEP}]
|
|
')
|
|
dev-util/desktop-file-utils
|
|
)
|
|
"
|
|
|
|
S="${WORKDIR}/python-${PV}"
|
|
|
|
src_unpack() {
|
|
default
|
|
if use gui; then
|
|
mv "${WORKDIR}/gtk-meshtastic-client-${GUI_PV}" "${WORKDIR}/gtk-meshtastic-client" || die
|
|
fi
|
|
}
|
|
|
|
src_prepare() {
|
|
default
|
|
distutils-r1_src_prepare
|
|
}
|
|
|
|
src_configure() {
|
|
if use gui; then
|
|
# Configure GUI build in a separate build directory
|
|
mkdir -p "${WORKDIR}/gui-build" || die
|
|
pushd "${WORKDIR}/gui-build" || die
|
|
ECONF_SOURCE="${WORKDIR}/gtk-meshtastic-client" meson_src_configure
|
|
popd || die
|
|
fi
|
|
}
|
|
|
|
src_compile() {
|
|
distutils-r1_src_compile
|
|
if use gui; then
|
|
pushd "${WORKDIR}/gui-build" || die
|
|
meson_src_compile
|
|
popd || die
|
|
fi
|
|
}
|
|
|
|
src_install() {
|
|
distutils-r1_src_install
|
|
dodoc README.md
|
|
if use gui; then
|
|
pushd "${WORKDIR}/gui-build" || die
|
|
meson_src_install
|
|
python_optimize
|
|
popd || die
|
|
fi
|
|
}
|