summaryrefslogtreecommitdiff
blob: fc11bce8f469bc41e039b9ccea0b9be98bd46bf4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit toolchain-funcs multilib-minimal

DESCRIPTION="Audio processing system for plugins to extract information from audio data"
HOMEPAGE="https://www.vamp-plugins.org"
SRC_URI="https://github.com/c4dm/${PN}/archive/${PN}-v${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="BSD"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
IUSE="doc"

RDEPEND="media-libs/libsndfile:0=[${MULTILIB_USEDEP}]"
DEPEND="${RDEPEND}"
BDEPEND="
	virtual/pkgconfig
	doc? ( app-doc/doxygen )
"

S="${WORKDIR}/${PN}-${PN}-v${PV}"

src_prepare() {
	default
	multilib_copy_sources
}

multilib_src_configure() {
	# multilib for default search paths
	sed -i -e "s:/usr/lib/vamp:${EPREFIX}/usr/$(get_libdir)/vamp:" \
		src/vamp-hostsdk/PluginHostAdapter.cpp || die
	econf
}

multilib_src_compile() {
	emake \
		AR="$(tc-getAR)" \
		RANLIB="$(tc-getRANLIB)"

	if multilib_is_native_abi && use doc; then
		cd build || die
		doxygen || die "creating doxygen doc failed"
		HTML_DOCS=( "${BUILD_DIR}"/build/doc/html/. )
	fi
}

multilib_src_install() {
	emake \
		DESTDIR="${D}" \
		INSTALL_SDK_LIBS="${EPREFIX}"/usr/$(get_libdir) \
		INSTALL_PKGCONFIG="${EPREFIX}"/usr/$(get_libdir)/pkgconfig \
		INSTALL_PLUGINS="${EPREFIX}"/usr/$(get_libdir)/vamp \
		install

	# fix .pc files
	sed -Ei "s/lib$/$(get_libdir)/g" "${D}"/usr/$(get_libdir)/pkgconfig/*.pc
}

multilib_src_install_all() {
	einstalldocs

	# don't want static archives, #474768
	find "${D}" -name '*.a' -delete || die
}

pkg_postinst() {
	elog
	elog "You might also want to install some Vamp plugins."
	elog "See media-plugins/vamp-*"
	elog
}