summaryrefslogtreecommitdiff
blob: 943c2de4042bc93c217d0118e272e9a7abe9765c (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
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

GTEST_VERSION="1.8.0"
inherit cmake-multilib

DESCRIPTION="Library implementing a custom algorithm for extracting audio fingerprints"
HOMEPAGE="https://acoustid.org/chromaprint"
SRC_URI="https://github.com/acoustid/${PN}/releases/download/v${PV}/${P}.tar.gz
	test? ( https://github.com/google/googletest/archive/release-${GTEST_VERSION}.tar.gz -> gtest-${GTEST_VERSION}.tar.gz )
"

LICENSE="LGPL-2.1"
SLOT="0/1"
KEYWORDS="alpha amd64 arm arm64 hppa ia64 ppc ppc64 sparc x86"
IUSE="libav test tools"
RESTRICT="!test? ( test )"

# note: use ffmpeg or libav instead of fftw because it's recommended and required for tools
RDEPEND="
	libav? ( >=media-video/libav-11:0=[${MULTILIB_USEDEP}] )
	!libav? ( >=media-video/ffmpeg-2.6:0=[${MULTILIB_USEDEP}] )
"
DEPEND="${RDEPEND}
	test? ( dev-cpp/gtest[${MULTILIB_USEDEP}] )"

PATCHES=(
	"${FILESDIR}"/${P}-test-bigendian.patch
	"${FILESDIR}"/${P}-cmake.patch
)

DOCS=( NEWS.txt README.md )

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

multilib_src_configure() {
	export GTEST_ROOT="${WORKDIR}/googletest-release-${GTEST_VERSION}/googletest/"
	local mycmakeargs=(
		-DBUILD_TOOLS=$(multilib_native_usex tools ON OFF)
		-DBUILD_TESTS=$(usex test ON OFF)
		-DFFT_LIB=avfft
		-DAUDIO_PROCESSOR_LIB=$(usex libav avresample swresample)
	)
	cmake-utils_src_configure
}

multilib_src_test() {
	emake check
}