avr-libc-1.6.4.ebuild 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. # Copyright 1999-2009 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 nls 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. $(use_enable nls) \
  42. || die "econf failed"
  43. emake || die "emake failed"
  44. }
  45. src_install() {
  46. cd "${S}"/obj-avr
  47. emake DESTDIR="${D}" install || die "make install failed"
  48. cd "${S}"
  49. dodoc AUTHORS ChangeLog* NEWS README
  50. # man pages can not go into standard locations
  51. # as they would then overwrite libc man pages
  52. dosed "s:\$(VERSION):${PVR}:" /usr/bin/avr-man
  53. insinto /usr/share/doc/${PF}/man/man3
  54. doins "${WORKDIR}"/man/man3/*
  55. prepman /usr/share/doc/${PF}
  56. use doc && dohtml "${WORKDIR}"/${PN}-user-manual-${DOCS_PV}/*
  57. }