diff options
Diffstat (limited to 'dev-embedded/esp-idf')
-rw-r--r-- | dev-embedded/esp-idf/Manifest | 1 | ||||
-rw-r--r-- | dev-embedded/esp-idf/esp-idf-5.3.1.ebuild | 158 |
2 files changed, 159 insertions, 0 deletions
diff --git a/dev-embedded/esp-idf/Manifest b/dev-embedded/esp-idf/Manifest index e47926ecb..9ca2e77f9 100644 --- a/dev-embedded/esp-idf/Manifest +++ b/dev-embedded/esp-idf/Manifest @@ -1,4 +1,5 @@ DIST esp-idf-5.2.2.zip 1488330027 BLAKE2B 00ba4c6f6a08ff1a8a398b8fea3dff1cb23e9f61435d9b69035df81579b65a026030f7fc67bb1b43c90484b5c4cfbd5143383b4171f0fed70931e58718c906fa SHA512 35b2b6ab028a9075702e7441b0354e7c30deaabc97da1b758a6206e2c78760b415ed5d60cbaf7b90b5fdce95f9faeb99d6ae1ad4991635024e2a3cfcbc8c38f2 +DIST esp-idf-5.3.1.zip 1695394487 BLAKE2B 97168a8ab5c482a86588e87d42caafb5bbeb4192966294fa56cb237883490b86746571ba6d00b6306b06b3ede8e7b041726e17fe09e2a7e747021e580e575a10 SHA512 c82517801628a6f5d74a5d22a0cc1320226cac6a0d79120273e500b8e8cfbc49e4129b3dfa7eda45f94a9220221b7894ef77e208aeab17d3d452bf06a3419678 DIST esp-idf-5.3.zip 1617510710 BLAKE2B 423c993efc32af9bd4b25509439c94ae06d474a20db70fc14b2dffaeb476aa647ff0f774cd58b5872de3e4c1768ce8b9e5dd7a99c6d36cba54cd7fea2eb2f5fa SHA512 3a5a7668a7c1419cfd0ead032a856d55a99e70d306c7db6bd3301d1349a128ed95a220c9a5adf310dd749e70ba460acb0c502d64b54d54e7a082422885c2b619 DIST openocd-esp32-linux-amd64-0.12.0-esp32-20240318.tar.gz 2252682 BLAKE2B fbec39f77c7e2d423eacaf45d0f8c3373e24c65c3d5e2db0edf5b952945edcc838dd41f8c852ff0b2104dce62184b3b0803014e53d8dd4dcf6427955ec18f194 SHA512 5acb5d90740ea8b54be57fe80956c2bbcc6bb3c48dc4969043a7d49da7e9135ede4add8bdf8f7d772681867aca1faa72594fa8f70e7e8d2bc7ed93128ff1ec8d DIST riscv32-esp-elf-13.2.0_20230928-x86_64-linux-gnu.tar.xz 143575940 BLAKE2B a888291f4b2c482cf2f3620519fc02607ba22d99f8d02e20415daf58cf2eecfa96144b0fc6fdbf98b3569ff0e5755d854650735e30cbfab56701a3d61627ddba SHA512 71b5def3d291eb80ab98adfbd23626ea4c6c5d8b30ab34a9f8a100013df58c4867044b974d8ced9405b5b45b26232835806746814051f55b650dde82bffe40f4 diff --git a/dev-embedded/esp-idf/esp-idf-5.3.1.ebuild b/dev-embedded/esp-idf/esp-idf-5.3.1.ebuild new file mode 100644 index 000000000..fba617de1 --- /dev/null +++ b/dev-embedded/esp-idf/esp-idf-5.3.1.ebuild @@ -0,0 +1,158 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{11,12} ) + +VER="13.2.0_20240530" +GDB_VER="14.2_20240403" + +CROSSTOOL_URL="https://github.com/espressif/crosstool-NG/releases/download/esp-${VER}" + +inherit estack python-r1 + +DESCRIPTION="Espressif IoT Development Framework" +HOMEPAGE="https://www.espressif.com/" + +# See https://dl.espressif.com/dl/esp-idf/espidf.constraints.v5.3.txt for information about version dependencies + +SRC_URI="https://dl.espressif.com/github_assets/espressif/${PN}/releases/download/v${PV}/${PN}-v${PV}.zip -> ${P}.zip + https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20240318/openocd-esp32-linux-amd64-0.12.0-esp32-20240318.tar.gz + https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v${GDB_VER}/xtensa-esp-elf-gdb-${GDB_VER}-x86_64-linux-gnu.tar.gz" +SRC_URI+=" ${CROSSTOOL_URL}/xtensa-esp-elf-${VER}-x86_64-linux-gnu.tar.xz" +SRC_URI+=" riscv32? ( + ${CROSSTOOL_URL}/riscv32-esp-elf-${VER}-x86_64-linux-gnu.tar.xz + https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v${GDB_VER}/riscv32-esp-elf-gdb-${GDB_VER}-x86_64-linux-gnu.tar.gz +)" + +S="${WORKDIR}/${PN}-v${PV}" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64" + +IUSE="riscv32" +REQUIRED_USE="${PYTHON_REQUIRED_USE}" + +BDEPEND="app-arch/unzip" +RDEPEND=" + ${PYTHON_DEPS} + + dev-libs/libusb:1 + dev-python/click[${PYTHON_USEDEP}] + dev-python/pyserial[${PYTHON_USEDEP}] + dev-python/cryptography[${PYTHON_USEDEP}] + dev-python/pyparsing[${PYTHON_USEDEP}] + dev-python/pyelftools[${PYTHON_USEDEP}] + dev-embedded/esp-coredump[${PYTHON_USEDEP}] + dev-embedded/esptool + dev-embedded/esp-idf-kconfig[${PYTHON_USEDEP}] + dev-embedded/esp-idf-monitor[${PYTHON_USEDEP}] + dev-embedded/esp-idf-panic-decoder[${PYTHON_USEDEP}] + dev-embedded/esp-idf-size[${PYTHON_USEDEP}] + dev-embedded/freertos-gdb[${PYTHON_USEDEP}] + dev-embedded/idf-component-manager[${PYTHON_USEDEP}] + sys-libs/zlib +" + +RESTRICT="strip" + +QA_PREBUILT="opt/* usr/lib* usr/share/esp-idf/*" +QA_PRESTRIPPED="opt/*" + +PATCHES=( + "${FILESDIR}/allow-system-install-${PN}-5.3.patch" +) + +install_tool() { + eshopts_push -s globstar + + into /opt/${1} + + if [[ -d "../${1}/lib" ]]; then + if stat *.so &>/dev/null; then + for i in ../${1}/lib/**/*.so*; do + dolib.so ${i} + done + fi + + if stat *.a &>/dev/null; then + for i in ../${1}/lib/**/*.a*; do + dolib.a ${i} + done + fi + + insinto /opt/${1}/lib + doins -r ../${1}/lib/* + fi + + exeinto /opt/${1}/bin + doexe ../${1}/bin/* + ( + cd ../${1} + for i in libexec/**/*; do + exeinto /opt/${1}/$(dirname ${i}) + if [[ -x "${i}" && ! -d "${i}" ]]; then + doexe ${i} + fi + done + + if [[ -d "include" ]]; then + insinto /opt/${1} + doins -r include + fi + + if [[ -d "share" ]]; then + insinto /opt/${1} + doins -r share + fi + ) + + ( + cd "${D}"/opt/${1}/bin/ || die + for i in *; do + dodir /opt/bin + cd "${D}"/opt/bin || die + dosym ../${1}/bin/${i} /opt/bin/${i} + done + ) + + eshopts_pop +} + +src_install() { + newbin - idf <<-EOF + #!/bin/sh + + # Silence a warning by idf.py + export IDF_PYTHON_ENV_PATH= + exec python /usr/share/${PN}/tools/idf.py \$@ +EOF + + install_tool xtensa-esp-elf + install_tool xtensa-esp-elf/xtensa-esp-elf + + if use riscv32; then + install_tool riscv32-esp-elf + install_tool riscv32-esp-elf/riscv32-esp-elf + fi + + install_tool openocd-esp32 + + # Remove unsupported python versions + rm "${WORKDIR}"/xtensa-esp-elf-gdb/bin/xtensa-esp-elf-gdb-3.{8..10} || die + install_tool xtensa-esp-elf-gdb + if use riscv32; then + install_tool riscv32-esp-elf-gdb + fi + + echo "IDF_PATH=/usr/share/${PN}" > 99esp-idf || die + doenvd 99esp-idf + + insinto /usr/share/${PN} + + rm -r .git || die + find . -name ".git" -exec rm -rf {} \; || die + doins -r . +} |