smatch-1.57.ebuild 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # Copyright 1999-2012 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="4"
  4. inherit multilib 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. fi
  10. DESCRIPTION="static analysis tool for C"
  11. HOMEPAGE="http://smatch.sourceforge.net/"
  12. if [[ ${PV} == "9999" ]] ; then
  13. SRC_URI=""
  14. #KEYWORDS=""
  15. else
  16. # The repo.or.cz site does not produce stable tarballs,
  17. # so we have to cache our own copy of the snapshot.
  18. #SRC_URI="http://repo.or.cz/w/smatch.git/snapshot/${PV}.tar.gz -> ${P}.tar.gz"
  19. SRC_URI="mirror://gentoo/${P}.tar.gz"
  20. KEYWORDS="~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
  21. fi
  22. LICENSE="OSL-1.1"
  23. SLOT="0"
  24. IUSE=""
  25. RDEPEND="dev-db/sqlite"
  26. DEPEND="${RDEPEND}"
  27. S=${WORKDIR}/${PN}
  28. src_prepare() {
  29. sed -i \
  30. -e '/^PREFIX=/s:=.*:=/usr:' \
  31. -e '/^CFLAGS =/{s:=:+=:;s:-O2 -finline-functions:${CPPFLAGS}:}' \
  32. Makefile || die
  33. }
  34. src_compile() {
  35. emake PREFIX=/usr V=1 CC="$(tc-getCC)" smatch
  36. }
  37. src_install() {
  38. # default install target installs a lot of sparse cruft
  39. dobin smatch
  40. insinto /usr/share/smatch/smatch_data
  41. doins smatch_data/*
  42. dodoc FAQ README
  43. }