libftdi-0.20-r1.ebuild 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. if [[ ${PV} == 9999* ]] ; then
  7. EGIT_REPO_URI="git://developer.intra2net.com/${PN}"
  8. inherit git-2
  9. else
  10. SRC_URI="http://www.intra2net.com/en/developer/${PN}/download/${P}.tar.gz"
  11. KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~sparc ~x86"
  12. fi
  13. DESCRIPTION="Userspace access to FTDI USB interface chips"
  14. HOMEPAGE="http://www.intra2net.com/en/developer/libftdi/"
  15. LICENSE="LGPL-2"
  16. SLOT="0"
  17. IUSE="cxx doc examples python"
  18. RDEPEND="virtual/libusb:0
  19. cxx? ( dev-libs/boost )
  20. python? ( ${PYTHON_DEPS} )"
  21. DEPEND="${RDEPEND}
  22. python? ( dev-lang/swig )
  23. doc? ( app-doc/doxygen )"
  24. REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
  25. pkg_setup() {
  26. use python && python-single-r1_pkg_setup
  27. }
  28. src_prepare() {
  29. if use python; then
  30. sed -i \
  31. -e "s:[$]{PYTHON_LIB_INSTALL}/../site-packages:$(python_get_sitedir):" \
  32. bindings/CMakeLists.txt || die
  33. fi
  34. sed -i \
  35. -e '/SET(LIB_SUFFIX /d' \
  36. CMakeLists.txt || die
  37. eapply "${FILESDIR}"/${P}-cmake-{include,version}.patch
  38. eapply_user
  39. }
  40. src_configure() {
  41. mycmakeargs=(
  42. -DFTDIPP=$(usex cxx)
  43. -DDOCUMENTATION=$(usex doc)
  44. -DEXAMPLES=$(usex examples)
  45. -DPYTHON_BINDINGS=$(usex python)
  46. -DCMAKE_SKIP_BUILD_RPATH=ON
  47. )
  48. cmake-utils_src_configure
  49. }
  50. src_install() {
  51. cmake-utils_src_install
  52. use python && python_optimize
  53. dodoc ChangeLog README
  54. if use doc ; then
  55. # Clean up crap man pages. #356369
  56. rm -vf "${CMAKE_BUILD_DIR}"/doc/man/man3/{_,usb_,deprecated}*
  57. doman "${CMAKE_BUILD_DIR}"/doc/man/man3/*
  58. dodoc -r "${CMAKE_BUILD_DIR}"/doc/html
  59. fi
  60. if use examples ; then
  61. docinto examples
  62. dodoc examples/*.c
  63. fi
  64. }