tcc-9999.ebuild 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. # Copyright 1999-2014 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="5"
  4. inherit eutils toolchain-funcs git-r3
  5. DESCRIPTION="A very small C compiler for ix86/amd64"
  6. HOMEPAGE="http://bellard.org/tcc/"
  7. EGIT_REPO_URI="http://repo.or.cz/r/tinycc.git"
  8. LICENSE="LGPL-2.1"
  9. SLOT="0"
  10. KEYWORDS=""
  11. DEPEND="dev-lang/perl" # doc generation
  12. # Both tendra and tinycc install /usr/bin/tcc
  13. RDEPEND="!dev-lang/tendra"
  14. IUSE="test"
  15. src_prepare() {
  16. # Don't strip
  17. sed -i -e 's|$(INSTALL) -s|$(INSTALL)|' Makefile || die
  18. # Fix examples
  19. sed -i -e '1{
  20. i#! /usr/bin/tcc -run
  21. /^#!/d
  22. }' examples/ex*.c || die
  23. sed -i -e '1s/$/ -lX11/' examples/ex4.c || die
  24. # fix texi2html invocation
  25. sed -i -e 's/-number//' Makefile || die
  26. sed -i -e 's/--sections//' Makefile || die
  27. }
  28. src_configure() {
  29. use test && unset CFLAGS LDFLAGS # Tests run with CC=tcc etc, they will fail hard otherwise
  30. # better fixes welcome, it feels wrong to hack the env like this
  31. # not autotools, so call configure directly
  32. ./configure --cc="$(tc-getCC)" \
  33. --prefix="${EPREFIX}/usr" \
  34. --libdir="${EPREFIX}/usr/$(get_libdir)" \
  35. --docdir="${EPREFIX}/usr/share/doc/${PF}"
  36. }
  37. src_compile() {
  38. emake AR="$(tc-getAR)"
  39. }
  40. src_install() {
  41. emake DESTDIR="${D}" install
  42. dodoc Changelog README TODO VERSION
  43. #dohtml tcc-doc.html
  44. exeinto /usr/share/doc/${PF}/examples
  45. doexe examples/ex*.c
  46. }
  47. src_test() {
  48. # this is using tcc bits that don't know as-needed etc.
  49. TCCFLAGS="" emake test
  50. }