Line 0
Link Here
|
0 |
- |
1 |
# Copyright 1999-2022 Gentoo Authors |
|
|
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
|
4 |
EAPI="8" |
5 |
|
6 |
CHOST="avr" |
7 |
CTARGET="avr" |
8 |
|
9 |
inherit flag-o-matic |
10 |
|
11 |
DESCRIPTION="C library for Atmel AVR microcontrollers" |
12 |
HOMEPAGE="http://www.nongnu.org/avr-libc/" |
13 |
SRC_URI="https://savannah.nongnu.org/download/avr-libc/${P}.tar.bz2 |
14 |
https://savannah.nongnu.org/download/avr-libc/${PN}-manpages-${PV}.tar.bz2" |
15 |
|
16 |
LICENSE="BSD" |
17 |
SLOT="0" |
18 |
# 'amd64' is a blessed placeholder for crossdev. It could |
19 |
# be any other arch. See bug #620316#c5 |
20 |
# Don't add more arches to KEYWORDS. |
21 |
KEYWORDS="amd64" |
22 |
IUSE="headers-only" |
23 |
|
24 |
DEPEND=">=sys-devel/crossdev-0.9.1" |
25 |
[[ ${CATEGORY/cross-} != ${CATEGORY} ]] \ |
26 |
&& RDEPEND="!dev-embedded/avr-libc" \ |
27 |
|| RDEPEND="" |
28 |
|
29 |
DOCS="AUTHORS ChangeLog* NEWS README" |
30 |
|
31 |
pkg_setup() { |
32 |
# check for avr-gcc, bug #134738 |
33 |
ebegin "Checking for avr-gcc" |
34 |
if type -p avr-gcc > /dev/null ; then |
35 |
eend 0 |
36 |
else |
37 |
eend 1 |
38 |
|
39 |
eerror |
40 |
eerror "Failed to locate 'avr-gcc' in \$PATH. You can install an AVR toolchain using:" |
41 |
eerror " $ crossdev -t avr" |
42 |
eerror |
43 |
die "AVR toolchain not found" |
44 |
fi |
45 |
} |
46 |
|
47 |
src_prepare() { |
48 |
default |
49 |
|
50 |
# work around broken gcc versions PR45261 |
51 |
local mcu |
52 |
for mcu in $(sed -r -n '/CHECK_AVR_DEVICE/{s:.*[(](.*)[)]:\1:;p}' configure.ac) ; do |
53 |
if avr-gcc -E - -mmcu=${mcu} <<<"" |& grep -q 'unknown MCU' ; then |
54 |
sed -i "/HAS_${mcu}=yes/s:yes:no:" configure |
55 |
fi |
56 |
done |
57 |
|
58 |
strip-flags |
59 |
strip-unsupported-flags |
60 |
} |
61 |
|
62 |
src_install() { |
63 |
default |
64 |
|
65 |
# man pages can not go into standard locations |
66 |
# as they would then overwrite libc man pages |
67 |
docinto man/man3 |
68 |
dodoc -r "${WORKDIR}"/man/man3/. |
69 |
|
70 |
# Make sure diff cross-compilers don't collide #414075 |
71 |
mv "${ED}"/usr/share/doc/{${PF},${CTARGET}-${PF}} || die |
72 |
} |