smatch-9999.ebuild 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. # Copyright 1999-2014 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="4"
  4. inherit toolchain-funcs
  5. if [[ ${PV} == "9999" ]] ; then
  6. EGIT_REPO_URI="git://repo.or.cz/${PN}.git
  7. http://repo.or.cz/r/${PN}.git"
  8. inherit git-2
  9. else
  10. SRC_URI="http://repo.or.cz/w/smatch.git/snapshot/${PV}.tar.gz -> ${P}.tar.gz
  11. mirror://gentoo/${P}.tar.gz"
  12. KEYWORDS="~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
  13. fi
  14. DESCRIPTION="static analysis tool for C"
  15. HOMEPAGE="http://smatch.sourceforge.net/"
  16. LICENSE="OSL-1.1"
  17. SLOT="0"
  18. IUSE=""
  19. RDEPEND="dev-db/sqlite"
  20. DEPEND="${RDEPEND}"
  21. S=${WORKDIR}/${PN}
  22. src_prepare() {
  23. sed -i \
  24. -e '/^CFLAGS =/{s:=:+=:;s:-O2 -finline-functions:${CPPFLAGS}:}' \
  25. Makefile || die
  26. }
  27. _emake() {
  28. # gtk/llvm/xml is used by sparse which we don't install
  29. emake \
  30. PREFIX="${EPREFIX}/usr" \
  31. V=1 \
  32. AR="$(tc-getAR)" \
  33. CC="$(tc-getCC)" \
  34. LD='$(CC)' \
  35. HAVE_GTK2=no \
  36. HAVE_LLVM=no \
  37. HAVE_LIBXML=no \
  38. "$@"
  39. }
  40. src_compile() {
  41. _emake smatch
  42. }
  43. src_test() {
  44. _emake check
  45. }
  46. src_install() {
  47. # default install target installs a lot of sparse cruft
  48. dobin smatch
  49. insinto /usr/share/smatch/smatch_data
  50. doins smatch_data/*
  51. dodoc FAQ README
  52. }