1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python2_7 )
9 inherit multilib cmake-utils python-single-r1
11 DESCRIPTION="A library to decode Bluetooth baseband packets"
12 HOMEPAGE="http://libbtbb.sourceforge.net/"
14 if [[ ${PV} == "9999" ]] ; then
15 EGIT_REPO_URI="https://github.com/greatscottgadgets/libbtbb.git"
20 S=${WORKDIR}/${PN}-${MY_PV}
21 SRC_URI="https://github.com/greatscottgadgets/${PN}/archive/${MY_PV}.tar.gz -> ${PN}-${MY_PV}.tar.gz"
22 KEYWORDS="~amd64 ~arm ~x86"
27 IUSE="extras static-libs wireshark-plugins"
29 RDEPEND="extras? ( ${PYTHON_DEPS} )
31 >=net-analyzer/wireshark-1.8.3-r1:=
35 wireshark-plugins? ( dev-libs/glib
38 REQUIRED_USE="extras? ( ${PYTHON_REQUIRED_USE} )"
40 get_PV() { local pv=$(best_version $1); pv=${pv#$1-}; pv=${pv%-r*}; pv=${pv//_}; echo ${pv}; }
43 if has_version '>=net-analyzer/wireshark-2.2.0'; then
45 elif has_version '>=net-analyzer/wireshark-1.12.0'; then
46 plugins="btbb btbredr"
47 elif has_version '<net-analyzer/wireshark-1.12.0'; then
48 plugins="btbb btle btsm"
54 BUILD_DIR="${S}"_build
55 cmake-utils_src_prepare
57 if use wireshark-plugins; then
61 sed -i 's#column_info#packet#' wireshark/plugins/${i}/cmake/FindWireshark.cmake || die
62 if has_version '>=net-analyzer/wireshark-2.0'; then
63 CMAKE_USE_DIR="${S}"/wireshark/plugins/${i}
65 CMAKE_USE_DIR="${S}"/wireshark/plugins-legacy/${i}
67 BUILD_DIR="${WORKDIR}"/${i}_build
68 cmake-utils_src_prepare
75 BUILD_DIR="${S}"_build
77 -DENABLE_PYTHON=$(usex extras)
78 -DBUILD_STATIC_LIB=$(usex static-libs)
81 cmake-utils_src_configure
83 if use wireshark-plugins; then
86 if has_version '>=net-analyzer/wireshark-2.0'; then
87 CMAKE_USE_DIR="${S}"/wireshark/plugins/${i}
89 CMAKE_USE_DIR="${S}"/wireshark/plugins-legacy/${i}
91 BUILD_DIR="${WORKDIR}"/${i}_build
93 -DCMAKE_INSTALL_LIBDIR="/usr/$(get_libdir)/wireshark/plugins/$(get_PV net-analyzer/wireshark)"
95 cmake-utils_src_configure
102 BUILD_DIR="${S}"_build
103 cmake-utils_src_compile
105 if use wireshark-plugins; then
108 if has_version '>=net-analyzer/wireshark-2.0'; then
109 CMAKE_USE_DIR="${S}"/wireshark/plugins/${i}
111 CMAKE_USE_DIR="${S}"/wireshark/plugins-legacy/${i}
113 BUILD_DIR="${WORKDIR}"/${i}_build
114 cmake-utils_src_compile
121 BUILD_DIR="${S}"_build
124 if use wireshark-plugins; then
127 if has_version '>=net-analyzer/wireshark-2.0'; then
128 CMAKE_USE_DIR="${S}"/wireshark/plugins/${i}
130 CMAKE_USE_DIR="${S}"/wireshark/plugins-legacy/${i}
132 BUILD_DIR="${WORKDIR}"/${i}_build
140 BUILD_DIR="${S}"_build
141 cmake-utils_src_install
143 if use wireshark-plugins; then
146 if has_version '>=net-analyzer/wireshark-2.0'; then
147 CMAKE_USE_DIR="${S}"/wireshark/plugins/${i}
149 CMAKE_USE_DIR="${S}"/wireshark/plugins-legacy/${i}
151 BUILD_DIR="${WORKDIR}"/${i}_build
152 cmake-utils_src_install