libftdi-1.2-r1.ebuild 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. PYTHON_COMPAT=( python2_7 python3_4 python3_5 python3_6 )
  5. inherit cmake-utils python-single-r1
  6. MY_P="${PN}1-${PV}"
  7. if [[ ${PV} == 9999* ]] ; then
  8. EGIT_REPO_URI="git://developer.intra2net.com/${PN}"
  9. inherit git-2
  10. else
  11. SRC_URI="http://www.intra2net.com/en/developer/${PN}/download/${MY_P}.tar.bz2"
  12. KEYWORDS="~amd64 ~arm ~arm64 ~mips ~ppc ~ppc64 ~sparc ~x86"
  13. fi
  14. DESCRIPTION="Userspace access to FTDI USB interface chips"
  15. HOMEPAGE="http://www.intra2net.com/en/developer/libftdi/"
  16. LICENSE="LGPL-2"
  17. SLOT="1"
  18. IUSE="cxx doc examples python static-libs test tools"
  19. RDEPEND="virtual/libusb:1
  20. cxx? ( dev-libs/boost )
  21. python? ( ${PYTHON_DEPS} )
  22. tools? (
  23. !<dev-embedded/ftdi_eeprom-1.0
  24. dev-libs/confuse
  25. )"
  26. DEPEND="${RDEPEND}
  27. python? ( dev-lang/swig )
  28. doc? ( app-doc/doxygen )"
  29. REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
  30. pkg_setup() {
  31. use python && python-single-r1_pkg_setup
  32. }
  33. S=${WORKDIR}/${MY_P}
  34. src_configure() {
  35. mycmakeargs=(
  36. -DFTDIPP=$(usex cxx)
  37. -DDOCUMENTATION=$(usex doc)
  38. -DEXAMPLES=$(usex examples)
  39. -DPYTHON_BINDINGS=$(usex python)
  40. -DSTATICLIBS=$(usex static-libs)
  41. -DBUILD_TESTS=$(usex test)
  42. -DFTDI_EEPROM=$(usex tools)
  43. -DCMAKE_SKIP_BUILD_RPATH=ON
  44. )
  45. cmake-utils_src_configure
  46. }
  47. src_install() {
  48. cmake-utils_src_install
  49. use python && python_optimize
  50. dodoc AUTHORS ChangeLog README TODO
  51. if use doc ; then
  52. # Clean up crap man pages. #356369
  53. rm -vf "${CMAKE_BUILD_DIR}"/doc/man/man3/_* || die
  54. doman "${CMAKE_BUILD_DIR}"/doc/man/man3/*
  55. dodoc -r "${CMAKE_BUILD_DIR}"/doc/html
  56. fi
  57. if use examples ; then
  58. docinto examples
  59. dodoc examples/*.c
  60. fi
  61. }