dietlibc-0.33_pre20110403.ebuild 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. # Copyright 1999-2014 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="3"
  4. inherit eutils flag-o-matic toolchain-funcs
  5. GITHUB_AUTHOR="hollow"
  6. GITHUB_PROJECT="dietlibc"
  7. GITHUB_COMMIT="4e86d5e"
  8. DESCRIPTION="A libc optimized for small size"
  9. HOMEPAGE="http://www.fefe.de/dietlibc/"
  10. SRC_URI="https://nodeload.github.com/${GITHUB_AUTHOR}/${GITHUB_PROJECT}/tarball/v${PV} -> ${P}.tar.gz"
  11. LICENSE="GPL-2"
  12. SLOT="0"
  13. KEYWORDS="~alpha amd64 ~arm ia64 ~mips sparc x86 ~amd64-linux ~x86-linux"
  14. IUSE="debug"
  15. DEPEND=""
  16. RDEPEND=""
  17. S="${WORKDIR}"/${GITHUB_AUTHOR}-${GITHUB_PROJECT}-${GITHUB_COMMIT}
  18. DIETHOME=/usr/diet
  19. pkg_setup() {
  20. # Replace sparc64 related C[XX]FLAGS (see bug #45716)
  21. use sparc && replace-sparc64-flags
  22. # gcc-hppa suffers support for SSP, compilation will fail
  23. use hppa && strip-unsupported-flags
  24. # debug flags
  25. use debug && append-flags -g
  26. # Makefile does not append CFLAGS
  27. append-flags -nostdinc -W -Wall -Wextra -Wchar-subscripts \
  28. -Wmissing-prototypes -Wmissing-declarations -Wno-switch \
  29. -Wno-unused -Wredundant-decls -fno-strict-aliasing
  30. # only use -nopie on archs that support it
  31. gcc-specs-pie && append-flags -nopie
  32. }
  33. src_compile() {
  34. emake prefix="${EPREFIX}"${DIETHOME} \
  35. CC="$(tc-getCC)" \
  36. CFLAGS="${CFLAGS}" \
  37. STRIP=":" \
  38. || die "make failed"
  39. }
  40. src_install() {
  41. emake prefix="${EPREFIX}"${DIETHOME} \
  42. DESTDIR="${D}" \
  43. install-bin \
  44. install-headers \
  45. || die "make install failed"
  46. dobin "${ED}"${DIETHOME}/bin/* || die "dobin failed"
  47. doman "${ED}"${DIETHOME}/man/*/* || die "doman failed"
  48. rm -r "${ED}"${DIETHOME}/{man,bin}
  49. dodoc AUTHOR BUGS CAVEAT CHANGES README THANKS TODO PORTING
  50. }