diff --git a/dev-embedded/esp-idf/Manifest b/dev-embedded/esp-idf/Manifest index 86009d1e61..1a724050e0 100644 --- a/dev-embedded/esp-idf/Manifest +++ b/dev-embedded/esp-idf/Manifest @@ -1,5 +1,6 @@ DIST esp-idf-5.4.4.zip 1988234779 BLAKE2B d8ebf069b71addf6052544da837089a3607a30a1873be9fa4bcd0a32eb683472000d45e4ea35105871320dc7d7f2101ac890801377a93b032e72a24228851121 SHA512 f1fd1a25a96cc3d56404eadd2808a9db9c6c620f0e64ba3ccf1c1cbe671372adc9af379da77b68a647a0f7bfde24866235157771c7f10dcd2352ff1414c83d9b DIST esp-idf-5.5.4.zip 1829210055 BLAKE2B 607effb487d67a614d5bfe9e49912362668e9dddfbd92550287d4657abde691bc2b6d62a10a2013b3ae3696f607623eee5fed10afa4a32036c28df4881d4c5e5 SHA512 5c59b21169dee3161517de63c7f02c6838aeac4725410a86654095a80dbe3c0e7da92d6889a5aaf8a8914f7d583a27987609d948b231b1c17ac988b3c97d66b7 +DIST esp-idf-5.5.5.zip 1998138049 BLAKE2B 4a625776e0725a7295cc29728fb794d91d846e0c6f3a49d04148d462d5975a127dcea2b838ffc5e778b581a277b4bfdbd45a3236f85d8a10f8f7fef16dfda21d SHA512 a1d5d337ee633d1e144777a777bfb761673d177e7a54e9e4fabfb29995657015a53de3e872702d212809fc39d45f2c29b1ea854e9719719caa86bd7304c33aad DIST esp-idf-6.0.1.zip 1825997344 BLAKE2B c318ec28f06b7bea6ff6496c674817eef714e1762a75765b412d8f1a7663574cd598ac9ad2786062b8b3e1bf5959c70c8fca398a219cb5b202689686542b1aba SHA512 c0813fa92adfbe5c664e6d121564b7d8e590ae32d9dfe0551bed7237fca38b0318c521e85e82321d5dcb067b48455d22b8c0142629488b243b8829149365d132 DIST esp-idf-6.0.2.zip 1914371137 BLAKE2B fa7730d37d6b031cb05aac1e929f1a73c664ccb79d4a3e4872948315fae7d8163591e5778f3420174c9d2a9fcd0763968ec636c84b36dc4f2e422b1bd32842c5 SHA512 32448eb20da60d6f594a5529e84a19c15e17d581357b2de505d4aecdb557c4d985488f56c6458098913f887fbf56551c19bec87d8d6e1833dc5c1b14f8ad844b DIST openocd-esp32-linux-amd64-0.12.0-esp32-20251215.tar.gz 2547606 BLAKE2B c7f875f2b63f0dff29239a4623b06f96760773a7686fa6a9aa0074fd4b10dff6621e09838402a62222cf282a120399fbe7b6cbc4fb70a7c0f4d96c85e02c3e46 SHA512 a6e52a5b35cf053f45d917dbcea87087cad42cdb09381c082c20fac43f65ae341949223f55289bc6c084db61d4a963a8277e030202db4495578801ea7e83b281 diff --git a/dev-embedded/esp-idf/esp-idf-5.5.5.ebuild b/dev-embedded/esp-idf/esp-idf-5.5.5.ebuild new file mode 100644 index 0000000000..c9d9091514 --- /dev/null +++ b/dev-embedded/esp-idf/esp-idf-5.5.5.ebuild @@ -0,0 +1,200 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# TODO: add esp-doc package in order to build documentation +# TODO: add examples USE +# TODO: fix to python-single which should help to fix python-gdb dep + +EAPI=8 + +PYTHON_COMPAT=( python3_{12..13} ) +PYTHON_GDB_USE=( python_targets_python3_{12..13} ) +VER="14.2.0_20260121" +GDB_VER="17.1_20260402" +OPENOCD_VER="0.12.0-esp32-20260424" + +CROSSTOOL_URL="https://github.com/espressif/crosstool-NG/releases/download/esp-${VER}" + +inherit estack optfeature python-r1 + +DESCRIPTION="Espressif IoT Development Framework" +HOMEPAGE="https://www.espressif.com/" + +# See https://dl.espressif.com/dl/esp-idf/espidf.constraints.v5.4.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/v${OPENOCD_VER}/openocd-esp32-linux-amd64-${OPENOCD_VER}.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 + ${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/$(ver_cut 1-2)" +KEYWORDS="~amd64" + +IUSE="python-gdb riscv32" +REQUIRED_USE=" + python-gdb? ( || ( ${PYTHON_GDB_USE[@]} ) ) + ${PYTHON_REQUIRED_USE} +" + +BDEPEND="app-arch/unzip" +RDEPEND=" + ${PYTHON_DEPS} + + dev-build/cmake + 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-diag[${PYTHON_USEDEP}] + /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 + + ( + 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 + ) + + if [[ -d "../${1}/bin" ]]; then + exeinto /opt/${1}/bin + doexe ../${1}/bin/* + + ( + 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 + ) + fi + + eshopts_pop +} + +src_install() { + echo "v${PV}" > version.txt || die + + 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 + install_tool xtensa-esp-elf/picolibc + install_tool xtensa-esp-elf/picolibc/xtensa-esp-elf + + if use riscv32; then + install_tool riscv32-esp-elf + install_tool riscv32-esp-elf/riscv32-esp-elf + install_tool riscv32-esp-elf/picolibc + install_tool riscv32-esp-elf/picolibcriscv32-esp-elf + fi + + install_tool openocd-esp32 + + # Remove unsupported python versions + rm "${WORKDIR}"/xtensa-esp-elf-gdb/bin/xtensa-esp-elf-gdb-3.{8..11} || die + if use riscv32; then + rm "${WORKDIR}"/riscv32-esp-elf-gdb/bin/riscv32-esp-elf-gdb-3.{8..11} || die + fi + + # Remove disabled python versions + for i in "${PYTHON_GDB_USE[@]}"; do + if ! has "${i}" "${PYTHON_COMPAT[@]}"; then + rm -f "${WORKDIR}"/xtensa-esp-elf-gdb/bin/xtensa-esp-elf-gdb-3."${i##*_}" || die + if use riscv32; then + rm -f "${WORKDIR}"/riscv32-esp-elf-gdb/bin/riscv32-esp-elf-gdb-3."${i##*_}" || die + fi + fi + done + + install_tool xtensa-esp-elf-gdb + if use riscv32; then + install_tool riscv32-esp-elf-gdb + fi + + newenvd - 99esp-idf <<-EOF + IDF_PATH=/usr/share/${PN} + ESP_IDF_VERSION=${PV} + ESP_ROM_ELF_DIR=/usr/share/${PN}/tools + OPENOCD_SCRIPTS=/opt/openocd-esp32/share/openocd/scripts +EOF + + insinto /usr/share/${PN} + + rm -r .git || die + find . -name ".git" -exec rm -rf {} \; || die + doins -r . +} + +pkg_postinst() { + optfeature "gdbgui target" dev-debug/gdbgui +}