peg-0.1.15-r1.ebuild 896 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit toolchain-funcs
  5. DESCRIPTION="Recursive-descent parser generators for C"
  6. HOMEPAGE="http://piumarta.com/software/peg/"
  7. SRC_URI="http://piumarta.com/software/${PN}/${P}.tar.gz"
  8. LICENSE="MIT"
  9. SLOT="0"
  10. KEYWORDS="~amd64 ~x86"
  11. IUSE="test"
  12. # FIXME: tests don't respect {C,LD}FLAGS and build stuff in runtime.
  13. RESTRICT="test"
  14. src_prepare() {
  15. sed -i \
  16. -e '/strip/d' \
  17. -e '/^CFLAGS/d' \
  18. -e 's/$(CC) $(CFLAGS) -o/$(CC) $(CFLAGS) $(LDFLAGS) -o/g' \
  19. Makefile || die "sed failed"
  20. }
  21. src_compile() {
  22. emake \
  23. CC="$(tc-getCC)" \
  24. CFLAGS="${CFLAGS}" \
  25. LDFLAGS="${LDFLAGS}"
  26. }
  27. src_install() {
  28. dodir "/usr/bin"
  29. emake -j1 \
  30. ROOT="${D}" \
  31. PREFIX="/usr" \
  32. install
  33. rm -rf "${D}/usr/man" || die "rm failed"
  34. doman src/${PN}.1
  35. }
  36. src_test() {
  37. emake check
  38. emake test
  39. }