avr-libc-1.8.0.ebuild 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. # Copyright 1999-2013 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="4"
  4. CHOST="avr"
  5. CTARGET="avr"
  6. inherit flag-o-matic eutils
  7. DESCRIPTION="C library for Atmel AVR microcontrollers"
  8. HOMEPAGE="http://www.nongnu.org/avr-libc/"
  9. SRC_URI="https://savannah.nongnu.org/download/avr-libc/${P}.tar.bz2
  10. https://savannah.nongnu.org/download/avr-libc/${PN}-manpages-${PV}.tar.bz2
  11. doc? ( https://savannah.nongnu.org/download/avr-libc/${PN}-user-manual-${PV}.tar.bz2 )"
  12. LICENSE="BSD"
  13. SLOT="0"
  14. KEYWORDS="amd64 ppc ppc64 x86"
  15. IUSE="doc crosscompile_opts_headers-only"
  16. DEPEND=">=sys-devel/crossdev-0.9.1"
  17. [[ ${CATEGORY/cross-} != ${CATEGORY} ]] \
  18. && RDEPEND="!dev-embedded/avr-libc" \
  19. || RDEPEND=""
  20. DOCS="AUTHORS ChangeLog* NEWS README"
  21. pkg_setup() {
  22. # check for avr-gcc, bug #134738
  23. ebegin "Checking for avr-gcc"
  24. if type -p avr-gcc > /dev/null ; then
  25. eend 0
  26. else
  27. eend 1
  28. eerror
  29. eerror "Failed to locate 'avr-gcc' in \$PATH. You can install an AVR toolchain using:"
  30. eerror " $ crossdev -t avr"
  31. eerror
  32. die "AVR toolchain not found"
  33. fi
  34. }
  35. src_prepare() {
  36. epatch_user #455828
  37. # work around broken gcc versions PR45261
  38. local mcu
  39. for mcu in $(sed -r -n '/CHECK_AVR_DEVICE/{s:.*[(](.*)[)]:\1:;p}' configure.ac) ; do
  40. if avr-gcc -E - -mmcu=${mcu} <<<"" |& grep -q 'unknown MCU' ; then
  41. sed -i "/HAS_${mcu}=yes/s:yes:no:" configure
  42. fi
  43. done
  44. # Install docs in correct directory
  45. sed -i -e "/DOC_INST_DIR/s:\$(VERSION):${PVR}:" configure || die
  46. strip-flags
  47. strip-unsupported-flags
  48. }
  49. src_install() {
  50. default
  51. # man pages can not go into standard locations
  52. # as they would then overwrite libc man pages
  53. insinto /usr/share/doc/${PF}/man/man3
  54. doins "${WORKDIR}"/man/man3/*
  55. use doc && dohtml "${WORKDIR}"/${PN}-user-manual-${PV}/*
  56. # Make sure diff cross-compilers don't collide #414075
  57. mv "${ED}"/usr/share/doc/{${PF},${CTARGET}-${PF}} || die
  58. }