smatch-1.57-r1.ebuild 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. # Copyright 1999-2013 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="4"
  4. inherit multilib toolchain-funcs eutils
  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. epatch "${FILESDIR}"/${P}-restrict.patch
  30. sed -i \
  31. -e '/^PREFIX=/s:=.*:=/usr:' \
  32. -e '/^CFLAGS =/{s:=:+=:;s:-O2 -finline-functions:${CPPFLAGS}:}' \
  33. Makefile || die
  34. }
  35. src_compile() {
  36. emake PREFIX=/usr V=1 CC="$(tc-getCC)" smatch
  37. }
  38. src_install() {
  39. # default install target installs a lot of sparse cruft
  40. dobin smatch
  41. insinto /usr/share/smatch/smatch_data
  42. doins smatch_data/*
  43. dodoc FAQ README
  44. }