tcc-0.9.26-r1.ebuild 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="5"
  4. inherit eutils toolchain-funcs
  5. DESCRIPTION="A very small C compiler for ix86/amd64"
  6. HOMEPAGE="http://bellard.org/tcc/"
  7. SRC_URI="http://download.savannah.gnu.org/releases/tinycc/${P}.tar.bz2"
  8. LICENSE="LGPL-2.1"
  9. SLOT="0"
  10. KEYWORDS="~amd64 ~x86"
  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. --bindir=/usr/bin \
  34. --libdir=/usr/$(get_libdir) \
  35. --tccdir=tcc \
  36. --includedir=/usr/include \
  37. --docdir=/usr/share/doc/${PF} \
  38. --mandir=/usr/share/man
  39. }
  40. src_compile() {
  41. emake AR="$(tc-getAR)"
  42. }
  43. src_install() {
  44. emake DESTDIR="${D}" install
  45. dodoc Changelog README TODO VERSION
  46. #dohtml tcc-doc.html
  47. exeinto /usr/share/doc/${PF}/examples
  48. doexe examples/ex*.c
  49. }
  50. src_test() {
  51. # this is using tcc bits that don't know as-needed etc.
  52. TCCFLAGS="" emake test
  53. }