avr-libc-1.6.8.ebuild 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. # Copyright 1999-2010 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. CHOST="avr"
  4. CTARGET="avr"
  5. inherit flag-o-matic
  6. DOCS_PV="1.6.2"
  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-${DOCS_PV}.tar.bz2
  11. doc? ( https://savannah.nongnu.org/download/avr-libc/${PN}-user-manual-${DOCS_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. pkg_setup() {
  21. # check for avr-gcc, bug #134738
  22. ebegin "Checking for avr-gcc"
  23. if type -p avr-gcc > /dev/null ; then
  24. eend 0
  25. else
  26. eend 1
  27. eerror
  28. eerror "Failed to locate 'avr-gcc' in \$PATH. You can install an AVR toolchain using:"
  29. eerror " $ crossdev -t avr"
  30. eerror
  31. die "AVR toolchain not found"
  32. fi
  33. }
  34. src_compile() {
  35. strip-flags
  36. strip-unsupported-flags
  37. mkdir obj-avr
  38. cd "${S}"/obj-avr
  39. ECONF_SOURCE="${S}" \
  40. econf \
  41. || die "econf failed"
  42. emake || die "emake failed"
  43. }
  44. src_install() {
  45. cd "${S}"/obj-avr
  46. emake DESTDIR="${D}" install || die "make install failed"
  47. cd "${S}"
  48. dodoc AUTHORS ChangeLog* NEWS README
  49. # man pages can not go into standard locations
  50. # as they would then overwrite libc man pages
  51. dosed "s:\$(VERSION):${PVR}:" /usr/bin/avr-man
  52. insinto /usr/share/doc/${PF}/man/man3
  53. doins "${WORKDIR}"/man/man3/*
  54. prepman /usr/share/doc/${PF}
  55. use doc && dohtml "${WORKDIR}"/${PN}-user-manual-${DOCS_PV}/*
  56. }