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