dev-embedded/libftdi: amd64 stable wrt bug #617136
[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         EGIT_REPO_URI="git://developer.intra2net.com/${PN}"
12         inherit git-2
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
25 RDEPEND="virtual/libusb:1
26         cxx? ( dev-libs/boost )
27         python? ( ${PYTHON_DEPS} )
28         tools? (
29                 !<dev-embedded/ftdi_eeprom-1.0
30                 dev-libs/confuse
31         )"
32 DEPEND="${RDEPEND}
33         python? ( dev-lang/swig )
34         doc? ( app-doc/doxygen )"
35
36 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
37
38 pkg_setup() {
39         use python && python-single-r1_pkg_setup
40 }
41
42 S=${WORKDIR}/${MY_P}
43
44 src_configure() {
45         mycmakeargs=(
46                 -DFTDIPP=$(usex cxx)
47                 -DDOCUMENTATION=$(usex doc)
48                 -DEXAMPLES=$(usex examples)
49                 -DPYTHON_BINDINGS=$(usex python)
50                 -DSTATICLIBS=$(usex static-libs)
51                 -DBUILD_TESTS=$(usex test)
52                 -DFTDI_EEPROM=$(usex tools)
53                 -DCMAKE_SKIP_BUILD_RPATH=ON
54         )
55         cmake-utils_src_configure
56 }
57
58 src_install() {
59         cmake-utils_src_install
60         use python && python_optimize
61         dodoc AUTHORS ChangeLog README TODO
62
63         if use doc ; then
64                 # Clean up crap man pages. #356369
65                 rm -vf "${CMAKE_BUILD_DIR}"/doc/man/man3/_* || die
66
67                 doman "${CMAKE_BUILD_DIR}"/doc/man/man3/*
68                 dodoc -r "${CMAKE_BUILD_DIR}"/doc/html
69         fi
70         if use examples ; then
71                 docinto examples
72                 dodoc examples/*.c
73         fi
74 }