dev-embedded/esp-idf - 6.0.2 (guru)

Search

Install

Install this version:

emerge -a =dev-embedded/esp-idf-6.0.2

If this version is masked, you can unmask it using the autounmask tool or standard emerge options:

autounmask =dev-embedded/esp-idf-6.0.2

Or alternatively:

emerge --autounmask-write -a =dev-embedded/esp-idf-6.0.2

Package Information

Description:
Espressif IoT Development Framework
Homepage:
https://www.espressif.com/
License:
Apache-2.0

Ebuild Details

Version EAPI Keywords Slot
6.0.2 8 ~amd64 0/$(ver_cut 1-2)
View Raw Ebuild
# 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..14} )
PYTHON_GDB_USE=( python_targets_python3_{12..14} )
VER="15.2.0_20251204"
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-embedded/esp-idf-kconfig-4.0.0[${PYTHON_USEDEP}]
	<dev-embedded/esp-idf-monitor-2.0.0[${PYTHON_USEDEP}]
	dev-embedded/esp-idf-nvs-partition-gen[${PYTHON_USEDEP}]
	dev-embedded/esp-idf-panic-decoder[${PYTHON_USEDEP}]
	<dev-embedded/esp-idf-size-3.0.0[${PYTHON_USEDEP}]
	dev-embedded/freertos-gdb[${PYTHON_USEDEP}]
	dev-embedded/idf-component-manager[${PYTHON_USEDEP}]
	virtual/zlib:=
"

RESTRICT="strip"

QA_PREBUILT="opt/* usr/lib* usr/share/esp-idf/*"

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

	(
	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
}

USE Flags

Manage flags for this package: euse -i <flag> -p dev-embedded/esp-idf | euse -E <flag> -p dev-embedded/esp-idf | euse -D <flag> -p dev-embedded/esp-idf

Global/Standard Flags

Inherited Eclasses

Dependencies

RDEPEND

	

	dev-build/cmake
	dev-libs/libusb:1
	dev-python/click[]
	dev-python/pyserial[]
	dev-python/cryptography[]
	dev-python/pyparsing[]
	dev-python/pyelftools[]
	dev-embedded/esp-coredump[]
	dev-embedded/esptool
	dev-embedded/esp-idf-diag[]
	<dev-embedded/esp-idf-kconfig-4.0.0[]
	<dev-embedded/esp-idf-monitor-2.0.0[]
	dev-embedded/esp-idf-nvs-partition-gen[]
	dev-embedded/esp-idf-panic-decoder[]
	<dev-embedded/esp-idf-size-3.0.0[]
	dev-embedded/freertos-gdb[]
	dev-embedded/idf-component-manager[]
	virtual/zlib:=

BDEPEND

app-arch/unzip

Manifest for 6.0.2

Type File Size Source URLs
DIST esp-idf-6.0.2.zip 1914371137 bytes https://dl.espressif.com/github_assets/espressif/esp-idf/releases/download/v6.0.2/esp-idf-v6.0.2.zip
DIST openocd-esp32-linux-amd64-0.12.0-esp32-20260424.tar.gz 2630575 bytes https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20260424/openocd-esp32-linux-amd64-0.12.0-esp32-20260424.tar.gz
DIST riscv32-esp-elf-15.2.0_20251204-x86_64-linux-gnu.tar.xz 393927372 bytes https://github.com/espressif/crosstool-NG/releases/download/esp-15.2.0_20251204/riscv32-esp-elf-15.2.0_20251204-x86_64-linux-gnu.tar.xz
DIST riscv32-esp-elf-gdb-17.1_20260402-x86_64-linux-gnu.tar.gz 43045928 bytes https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v17.1_20260402/riscv32-esp-elf-gdb-17.1_20260402-x86_64-linux-gnu.tar.gz
DIST xtensa-esp-elf-15.2.0_20251204-x86_64-linux-gnu.tar.xz 180530004 bytes https://github.com/espressif/crosstool-NG/releases/download/esp-15.2.0_20251204/xtensa-esp-elf-15.2.0_20251204-x86_64-linux-gnu.tar.xz
DIST xtensa-esp-elf-gdb-17.1_20260402-x86_64-linux-gnu.tar.gz 42655871 bytes https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v17.1_20260402/xtensa-esp-elf-gdb-17.1_20260402-x86_64-linux-gnu.tar.gz