# Copyright 1999-2026 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 DISTUTILS_USE_PEP517=setuptools PYTHON_COMPAT=( python3_{11..14} ) inherit distutils-r1 shell-completion udev DESCRIPTION="An open source ecosystem for IoT development" HOMEPAGE="https://platformio.org/" SRC_URI="https://github.com/platformio/platformio-core/archive/refs/tags/v${PV}.tar.gz -> ${P}.gh.tar.gz" S="${WORKDIR}"/${PN}-core-${PV} LICENSE="BSD" SLOT="0" KEYWORDS="~amd64 ~x86" #TODO dev-python/requests[socks5] if proxy needed RDEPEND=" $(python_gen_cond_dep ' =dev-python/ajsonrpc-1.2*[${PYTHON_USEDEP}] =dev-python/bottle-0.13*[${PYTHON_USEDEP}] >=dev-python/click-8.2[${PYTHON_USEDEP}] =dev-python/zeroconf-0.37[${PYTHON_USEDEP}] =dev-python/requests-2*[${PYTHON_USEDEP}] =dev-python/semantic-version-2.10*[${PYTHON_USEDEP}] =dev-python/tabulate-0*[${PYTHON_USEDEP}] dev-python/twisted[${PYTHON_USEDEP}] dev-python/constantly[${PYTHON_USEDEP}] >=dev-python/pyelftools-0.30[${PYTHON_USEDEP}] =dev-python/starlette-0.21[${PYTHON_USEDEP}] =dev-python/uvicorn-0.19[${PYTHON_USEDEP}] =click-9.0 won't be compatible) # Allow marshmallow-4* sed \ -e '/click/s/<8\.[0-9]*/<9/' \ -e '/marshmallow/s/3\.[0-9.*]*/4.*/' \ -i platformio/dependencies.py || die distutils-r1_python_prepare_all } python_test() { epytest -k "not skip_ci" } python_compile_all() { #completions local _PIO_COMPLETE s_type for s_type in bash fish zsh; do _PIO_COMPLETE=${s_type}_source "${BUILD_DIR}"/install/usr/bin/pio > "${T}"/pio.${s_type} || die done } src_install() { distutils-r1_src_install udev_dorules platformio/assets/system/99-platformio-udev.rules newbashcomp "${T}"/pio.bash pio newfishcomp "${T}"/pio.fish pio.fish newzshcomp "${T}"/pio.zsh _pio } pkg_postinst() { udev_reload } pkg_postrm() { udev_reload }