1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python2_7 python3_6 )
8 inherit autotools python-single-r1
10 DESCRIPTION="Ham radio backend rig control libraries"
11 HOMEPAGE="https://www.hamlib.org"
12 SRC_URI="https://www.github.com/${PN}/${PN}/releases/download/${PVR}/${P}.tar.gz"
14 LICENSE="LGPL-2 GPL-2"
17 IUSE="doc perl python tcl"
25 perl? ( dev-lang/perl )
26 python? ( ${PYTHON_DEPS} )
27 tcl? ( dev-lang/tcl:0= )"
32 >=sys-devel/libtool-2.2
33 doc? ( app-doc/doxygen )"
35 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
37 DOCS=(AUTHORS NEWS PLAN README README.betatester README.developer TODO)
40 use python && python-single-r1_pkg_setup
44 # fix hardcoded libdir paths
45 sed -i -e "s#fix}/lib#fix}/$(get_libdir)/hamlib#" \
46 -e "s#fix}/include#fix}/include/hamlib#" \
47 hamlib.pc.in || die "sed failed"
49 # Correct install target to whatever INSTALLDIRS says and use vendor
50 # installdirs everywhere (bug #611550)
51 sed -i -e "s#install_site#install#" \
52 -e 's#MAKEFILE="Hamlib-pl.mk"#MAKEFILE="Hamlib-pl.mk" INSTALLDIRS=vendor#' \
53 bindings/Makefile.am || die "sed failed patching for perl"
55 # make building of documentation compatible with autotools-utils
56 sed -i -e "s/doc:/html:/g" doc/Makefile.am || die "sed failed"
65 --libdir=/usr/$(get_libdir)/hamlib \
68 $(use_with perl perl-binding) \
69 $(use_with python python-binding) \
70 $(use_with tcl tcl-binding)
79 emake DESTDIR="${D}" install
81 use doc && HTML_DOCS=( doc/html/ )
84 insinto /usr/$(get_libdir)/pkgconfig
87 echo "LDPATH=/usr/$(get_libdir)/hamlib" > "${T}"/73hamlib
88 doenvd "${T}"/73hamlib