Explorar o código

cross-avr/avr-libc: local bump to 2.3.2 for avrxmega3 device support

::gentoo only carries avr-libc 2.1.0, which predates the upstream 2.2.0
release that first shipped tinyAVR 0/1/2-series and megaAVR-0 (avrxmega3)
device support: I/O headers, startup code and per-device libraries.
Without it the crossdev avr toolchain cannot build for parts such as the
ATtiny3217 (no <avr/iotn3217.h>, crtattiny3217.o or libattiny3217.a) even
though avr-gcc 15 itself knows the avrxmega3 core and ships
device-specs/specs-attiny3217.

Upstream moved from Savannah to GitHub with 2.2.0.  The GitHub release
tarball ships a pre-generated ./configure and the avr/{lib,devices} trees
(mlib-gen.py output), so no bootstrap / autotools / python is needed to
build it.  Manual pages are no longer a separate download; they build
from the tree only when doxygen is present, which we do not pull in, so
docs are disabled explicitly.

Portage prefers this over the ::gentoo 2.1.0 automatically (higher
version), so an `emerge --sync` / `@world` upgrade will not revert it.
/etc/portage/crossdev/avr/env pins CROSSDEV_OVERLAY to this repo so a
future `crossdev -t avr` re-run stays consistent.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016Qt4fDtTZPTpDz2cr7ZNT2
k4be hai 2 semanas
pai
achega
e783c8561c

+ 1 - 0
cross-avr/avr-libc/Manifest

@@ -0,0 +1 @@
+DIST avr-libc-2.3.2.tar.bz2 11303422 BLAKE2B 766546962425bef2b4960c8e46d8d7d0ef34a5880bf3cf071468fa714e501ae66b59a925b5146633df41f46911ff8cdb44f44099fe747569a50f0e3c10243e5c SHA512 cd38bc9a25bfbebfbbcf9691246e6a84d7b43769d42f3a3586cf7a4038cd2ff95b9fb235500c9adcbd6613468f54e9b36400f2c6275b5390a873ad806a806283

+ 86 - 0
cross-avr/avr-libc/avr-libc-2.3.2.ebuild

@@ -0,0 +1,86 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="8"
+
+CHOST="avr"
+CTARGET="avr"
+
+inherit flag-o-matic
+
+DESCRIPTION="C library for Atmel AVR microcontrollers"
+HOMEPAGE="https://github.com/avrdudes/avr-libc https://www.nongnu.org/avr-libc/"
+
+# Upstream moved from Savannah to GitHub with 2.2.0.  The GitHub "release"
+# tarball ships a pre-generated ./configure and the avr/{lib,devices} trees
+# (mlib-gen.py output), so no bootstrap / autotools / python is needed to
+# build it.  Manual pages are no longer a separate download; they are built
+# from the tree only when doxygen is present, which we do not pull in.
+MY_TAG="avr-libc-$(ver_rs 1- '_')-release"
+SRC_URI="https://github.com/avrdudes/avr-libc/releases/download/${MY_TAG}/${P}.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0"
+# 'amd64' is a blessed placeholder for crossdev. It could
+# be any other arch. See bug #620316#c5
+# Don't add more arches to KEYWORDS.
+KEYWORDS="amd64"
+IUSE="headers-only"
+
+DEPEND=">=sys-devel/crossdev-0.9.1"
+[[ ${CATEGORY/cross-} != ${CATEGORY} ]] \
+	&& RDEPEND="!dev-embedded/avr-libc" \
+	|| RDEPEND=""
+
+DOCS="AUTHORS NEWS NEWS.md README.md"
+
+pkg_setup() {
+	# check for avr-gcc, bug #134738
+	ebegin "Checking for avr-gcc"
+	if type -p avr-gcc > /dev/null ; then
+		eend 0
+	else
+		eend 1
+
+		eerror
+		eerror "Failed to locate 'avr-gcc' in \$PATH. You can install an AVR toolchain using:"
+		eerror "  $ crossdev -t avr"
+		eerror
+		die "AVR toolchain not found"
+	fi
+}
+
+src_prepare() {
+	default
+
+	# work around broken gcc versions PR45261: drop MCUs the installed
+	# avr-gcc does not know about so ./configure does not choke on them.
+	local mcu
+	for mcu in $(sed -r -n '/CHECK_AVR_DEVICE/{s:.*[(](.*)[)]:\1:;p}' configure.ac) ; do
+		if avr-gcc -E - -mmcu=${mcu} <<<"" |& grep -q 'unknown MCU' ; then
+			sed -i "/HAS_${mcu}=yes/s:yes:no:" configure || die
+		fi
+	done
+
+	strip-flags
+	strip-unsupported-flags
+}
+
+src_configure() {
+	# --enable-device-lib builds the per-device lib<mcu>.a / crt<mcu>.o.
+	# It is on by default with avr-gcc >= 5.1 but be explicit.  Docs are
+	# off by default in 2.2+; keep them off (no doxygen dependency).
+	econf \
+		--host=avr \
+		--enable-device-lib \
+		--disable-doc
+}
+
+src_install() {
+	default
+
+	# Make sure different cross-compilers don't collide #414075
+	if [[ -d ${ED}/usr/share/doc/${PF} ]] ; then
+		mv "${ED}"/usr/share/doc/{${PF},${CTARGET}-${PF}} || die
+	fi
+}

+ 18 - 0
cross-avr/avr-libc/metadata.xml

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer type="person">
+		<email>k4be@pirc.pl</email>
+		<name>k4be</name>
+	</maintainer>
+	<longdescription>
+		Local bump of cross-avr/avr-libc to 2.3.x.  The version in ::gentoo
+		(2.1.0) predates avr-libc 2.2.0, which is the first release to ship
+		the tinyAVR 0/1/2-series and megaAVR-0 (avrxmega3) device headers,
+		startup code and device libraries.  Without this the crossdev avr
+		toolchain cannot build for parts like the ATtiny3217.
+	</longdescription>
+	<upstream>
+		<remote-id type="github">avrdudes/avr-libc</remote-id>
+	</upstream>
+</pkgmetadata>

+ 1 - 0
profiles/categories

@@ -1,4 +1,5 @@
 app-text
+cross-avr
 dev-util
 sys-kernel
 sys-power