i2c-tools-3.1.1-r1.ebuild 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="5"
  4. PYTHON_COMPAT=( python{2_7,3_4,3_5} )
  5. DISTUTILS_OPTIONAL="1"
  6. inherit flag-o-matic toolchain-funcs distutils-r1
  7. DESCRIPTION="I2C tools for bus probing, chip dumping, register-level access helpers, EEPROM decoding, and more"
  8. HOMEPAGE="http://www.lm-sensors.org/wiki/I2CTools"
  9. SRC_URI="http://dl.lm-sensors.org/i2c-tools/releases/${P}.tar.bz2"
  10. LICENSE="GPL-2"
  11. SLOT="0"
  12. KEYWORDS="amd64 arm ~arm64 ~mips ~ppc ~ppc64 ~sparc x86"
  13. IUSE="python"
  14. RDEPEND="!<sys-apps/lm_sensors-3
  15. python? ( ${PYTHON_DEPS} )"
  16. DEPEND="${RDEPEND}"
  17. src_prepare() {
  18. epatch "${FILESDIR}"/${PN}-3.1.1-python-3.patch #492632
  19. use python && distutils-r1_src_prepare
  20. }
  21. src_configure() {
  22. use python && distutils-r1_src_configure
  23. }
  24. src_compile() {
  25. emake CC=$(tc-getCC) CFLAGS="${CFLAGS}"
  26. emake -C eepromer CC=$(tc-getCC) CFLAGS="${CFLAGS} -I../include"
  27. if use python ; then
  28. cd py-smbus || die
  29. append-cppflags -I../include
  30. distutils-r1_src_compile
  31. fi
  32. }
  33. src_install() {
  34. emake install prefix="${D}"/usr
  35. dosbin eepromer/eepro{g,m{,er}}
  36. rm -rf "${D}"/usr/include # part of linux-headers
  37. dodoc CHANGES README
  38. local d
  39. for d in eeprom eepromer ; do
  40. docinto ${d}
  41. dodoc ${d}/README*
  42. done
  43. if use python ; then
  44. cd py-smbus || die
  45. docinto py-smbus
  46. dodoc README*
  47. distutils-r1_src_install
  48. fi
  49. }